[comp.sys.amiga.programmer] OS friendly way to link two audio channels?

trantow@csd4.csd.uwm.edu (Jerry J Trantow) (06/07/91)

In article <1991May28.144732.20114@news.media.mit.edu> dlleigh@media-lab.media.mit.edu (Darren Leigh) writes:
>I'm writing a program where I need to have one audio channel amplitude
>modulating another.  Is there a friendly way to link two audio channels
>or do I have to lock the channels and bang on the adkcon register?
>
>Darren Leigh

I just got this working late last night.
My first attempt was to bang the adkcon and dmacon registers (after locking
the channels).  The only problem is detecting the end of the sample.  I 
tried SetIntVector(INT_AUD0, ), but the audio.device was already installed.
I next tried AddIntHandler(), but then I went for a bike ride and rethought
my approach.

What I settled on (and what works) is to lock the channels, stop the channels,
start the individual channels, set adkcon=SETCLR|USE0V1, start channels,
WaitIO() on the individual channels, and finally unlock the channels.

This uses the audio.device to control dmacon, and it doesn't seem to mind the
fiddling with adkcon.  Since the channels are locked, adkcon should not 
screw up anything else.

I've had volume modulation in the back of my mind (a crowded space) for almost
5 years.  I looked at some of my old asm code for volume modulation earlier
this week and coupled with my current understanding of messages, I was able to
get it running in two days using messages.

Let me know what you are working on, perhaps we can share some code.  I'm 
making my changes to sound editing program that I have written.  I intend to
write a 14 bit player using volume modulation.  I need a good spec for storing
14,16 bit IFF and/or volume modulated IFF.