GUS Programmer's Digest Thu Jun 10 00:07 Volume 2: Issue 8 Today's Topics: GUS Programmer's Digest V2 #7 (2 msgs) SMPTE through audio in/out ? Standard Info: - Meta-info about the GUS can be found at the end of the Digest. - Before you ask a question, please READ THE FAQ. ---------------------------------------------------------------------- Date: Wed, 9 Jun 93 17:33:05 +0200 From: d91-sme@nada.kth.se Subject: Re: GUS Programmer's Digest V2 #7 Message-ID: <9306091533.AA29942@dront.nada.kth.se> av@omega.ssw.de (Andreas Vogel) writes: -------------------------------------- > I thought that this feature might help. But I really don't understand, > how to "implement a ping-pong buffer algorithm" using this method. > Does someone have an idea on this? Is the problem this: you want to play a large sample that doesn't fit into the GUS memory? Ok, let's write a picture: A piece of GUS memory: ----------------------------------------------- ^ ^ ^ A B C A = Start of Buffer #1 B = Start of Buffer #2 C = End of the buffers 1. Fill A-C with sample data. 2. Play the sound from A to C, looping. 3. IRQ at B. 4. Fill A-B with new sample data. 5. IRQ at C. 6. Fill B-C with new sample data. 7. Go to 3. Exactly how you create the IRQ's is actually uninteresting. Anyhow, you will not have any pops or anything with this algorithm. I don't know if the following will work, but it's an idea: Piece of GUS memory: ------------------------------ ^ ^ A B A = Start of buffer B = End of buffer 1. Start DMA transfer from A to B. 2. Play the sound from A to B, looping bi-directionally. 3. IRQ at B. 4. Start DMA transfer from B to A. 5. IRQ at A. 6. Start DMA transfer from A to B. 7. Go to 3. The crucial part is that the DMA-transfer must have started and transfered at least FC bytes/words before 1.6 ms after the generation of the IRQ, (FC = frequency counter, the number of bytes/words the GUS will skip when playing the next data element in a sample.) The whole idea builds upon the fact that DMA is faster than the GUS. Maybe it will work, maybe it won't. Has anybody tried this? If it works you can simplify the code, and save processor time. /Smedis (Niklas Smedberg, d91-sme@nada.kth.se) ------------------------------ Date: Wed, 9 Jun 93 12:03:32 CDT From: eason@ncrnd3.StPaul.NCR.COM (Dale Eason) Subject: Re: GUS Programmer's Digest V2 #7 Message-ID: <9306091703.AA04449@ncrnd3.StPaul.NCR.COM> In regards to using two buffers I think this is the way to do it although I haven't tried it. Load buffer a, load buffer b. Loop: Enable interrupt on end of a. Start a playing. When interrupt is received. start a playing and enable interrupt on end of b. Reload a. When interrupt is received. Start b playing and enable interrupt on end of a. reload b. End loop There should be enough time when an interrupt is received to start the other buffer playing without hearing any delay or pops. They say you can even start the loading of the buffer using DMA and then start the voice playing and the DMA will stay ahead of the voice playing. The interrupt processing must be short enough that the new voice is started before the next sample needs to go out to the DAC. This will keep pops from happening. Dale ------------------------------ Date: Wed, 9 Jun 93 09:29:26 -0400 From: mas@elm.circa.ufl.edu (Mark Schneider) Subject: SMPTE through audio in/out ? Message-ID: <9306091329.AA05616@elm.circa.ufl.edu> Has anyone though about the feasibility of implementing SMPTE through the GUS audio in and out jacks? Imagine all the benefits! --------------------------------------------------------------------------- | Mark Schneider University of Florida | | mas@elm.circa.ufl.edu 904-335-6511 (voice) | --------------------------------------------------------------------------- ------------------------------ End of GUS Programmer's Digest V2 #8 ************************************ To post to tomorrow's digest: To (un)subscribe or get help: To contact a human (last resort): FTP sites: archive.epas.utoronto.ca pub/pc/ultrasound wuarchive.wustl.edu systems/msdos/ultrasound Hints: - Get the FAQ from the FTP sites or the request server. - Mail to for info about other GUS related mailing lists (UNIX, OS/2, GUS-MIDI, etc.)