[comp.sys.amiga.tech] Digitized audio playback.

leo@tandem.Tandem.com (Leo Hejza) (06/23/89)

I'm in the process of writing a sound generation program for the amiga.
Basically It reads a score file, (ascii note freq, length, etc.), and
calculates what the resultant waveform would look like at each sample
time. All the voices which are active at a given sample time are summed
together and the result is saved to a file.

To test the program I currently load about a 1.5 meg portion of the file
and play it back through the D/A subsystem. The generation code is
working fairly well. The playback code also works, but only for the segment
of the file which is in memory.

The question: How can I go about playing back the samples and reading the next
segment into memory at the same time. If I write my own low level audio 
routines I can have them interrupt the read routine as needed. I don't
want to do this. Basically I need to have a playback task and a read task
which use mesages to synchronize the producer and consumer aspects of the
combined process. I don't have a good feel for how to do this however.

Any help, code, or references will be appreciated. If its any help
the playback is in stereo at the maximum sample rate that the audio/dma
hardware will support, about 28K bytes/second per channel.

If you need more information to help solve the problem please e-mail me
and I'll supply whatever I can.

Thanks, Leo.