Path: utzoo!attcan!uunet!ubvax!ardent!rap From: rap@ardent.UUCP (Rob Peck) Newsgroups: comp.sys.amiga Subject: Re: SendMorse (oops -- I forgot a file) Summary: just a little bit more to it than that... Message-ID: <733@ardent.UUCP> Date: 23 Nov 88 19:08:37 GMT References: <5574@louie.udel.EDU> <6283@dayton.UUCP> Organization: Dana Computer, Inc., Sunnyvale, CA Lines: 103 In article <6283@dayton.UUCP>, joe@dayton.UUCP (Joseph P. Larson) writes: > In reply to one of my messages, Bill Kinnersley writes: > >: > >I surely would like to see an audio example in which two channels are > >"attached", so that the output of one modulates the output of the other. > >Any chances of that? > If you just want to allocate 2 channels and modulate them equally, all I > would have to do with SendMorse is change one subroutine call and reinsert > some code from Rob Peck's book. That is, I call something like > "AllocateAnyChannel" and what I should have used to begin with was > "AllocateAnyStereoPair" (they're called something more reasonable, but I > don't remember and you get the general idea anyways). > > Then, if I'm not mistaken, one audio.device request would (or at least > could) modulate both channels equally. For doing cross-channel modulation, you have to allocate "special" stereo pairs. The cross-channel modulation is set up so that each channel, if attached, can modulate the output of the next-higher-numbered channel. So channel 0 can modulate channel 1, and/or channel 1 modulates channel 2, and/or channel 2 modulates channel3 (but I don't remember if channel 3 can modulate channel 0, someone will have to check the Hardware Manual for that.). I THINK so but I don't remember for sure. Once you have a compatible cross-modulating pair, you have to go directly to the hardware to set the attach-bit. The output of the modulaTOR (he who is doing the modulating) is disabled, so you automatically lose one channel of real output in the process. The sampling rate of the modulaTOR channel determines how often the output of the modulaTOR channel is fed to the moduLEE (hehe, new term for he who is modulated) in the form of alternating AMPLITUTE VALUE, PERIOD VALUE for the modulee. In other words, it no longer matters WHAT value you have given to the Amplitude and Sampling rate of the moduLEE when you first started its output because it will be replaced by the modulaTOR at HIS sampling rate. So, assuming that the Amplitude values are the odd words of the modulator's data stream and the Period values are the even words of the modulators data stream (odd/even may be swapped, check hdw man): To do amplitute modulation only, modify the odd words of the modulaTOR's data stream to reflect the amplitude modulation. This will then affect the volume control (max range 0-64). Keep the period values exactly the same for each even word, that is, the same value at which you started the output of the moduLEE. To do frequency modulation only, modify the even words of the modulaTOR's data stream to reflect the frequency modulation to be performed on the moduLEE. This will then affect the period value of the moduLEE. Keep the Amplitude values exactly the same for each even word, that is, the same value at which you started the output of the moduLEE. To do both amplitude and frequency modulation, modify both. And the rate at which the modulation changes are applied is dependent on the period value (sampling rate) of the ModulaTOR. So you can see, it is NOT a simple sine-wave data that is contained in the ModulaTOR's data stream, but actually a full amplitude and freqency control data stream. A bit more complicated, but very versatile. I'll be adding attached-channel modulation functions to the AudioTools, but I cannot squish out any time for that until at least February. At that time, I can probably post an example, as well. By the way, the reason that I added "GetStereoPair" to the tools as contained in the Programmers' Guide To The Amiga was to enable me to start or stop "ControlChannel" both channels at the same time. This way the same "secret code" would apply to both channels and a single command could control both. I temporarily dropped "GetStereoPair", I believe, from the current version of the Audiotools because I was trying to make certain commands work alike whether they were working on a stereo pair or a single channel. Something got in the way of this compatibility and rather than deal with it, I temporarily suspended the idea. Note that the Audiotools are a considerable extension to the material I included in chapter 8(?) of the Programmers' Guide and got a LOT more testing (which is why some of the functions changed at least a little bit). If, before February, someone else adapts the Audiotools to include an attached-channel function, I would be pleased to accept it for inclusion in my own distribution. Additionally, those who were at DEVCON have the latest version of the Audiotools and the docs indicate which other functions I would like to add or see added to the tools. Again, I am open to accepting any help I can get on those suggested additions. So few folks are working with Amiga audio. Seems that the tools have inspired SOME action and some folks are using them but I get very little direct feedback on the Audiotools, so I figure most folks must either not know they exist or are perfectly satisfied with the functionality they provide. (sigh). Well, no news is good news, right? Rob Peck