[Coco] Orchestra 90CC

Jeff Teunissen deek at d2dc.net
Mon Jan 29 04:54:40 EST 2007


Joel Ewy wrote:
> Bob Devries wrote:
>> James,
>> While it's true that the ROM in the Orchestra-90 does do what you describe, 
>> any third-party and OS9 software does its own handling of the data, 
>> including the timing between the sending of the data to the ports.
>>
>>   
> Right.
>> So unless the new hardware has some way of knowing how much time to insert 
>> between "packets" of 2-byte stereo pairs, indeed the FIFO will make no 
>> difference. In fact, I'd rather think that it would completely screw up the 
>> timing that's necessary for the Orch-90 to work correctly.
>>
>>   
> And that's what Kevin's original post said.  See below.
> So how are such things done on PC sound cards?  Is there some logic for
> pushing the data out at a defined sample rate, or is it all done in
> software?

With PC sound cards, the most common method is to use a ring buffer, and tell
the chip to read it at a certain rate using DMA.

Say you want to play back 8-bit stereo data at 8000 samples per second of raw
audio data; at the least you need a buffer, a command interface, and a return
offset into that buffer. Once you set the playback to begin, all you have to
do to keep playing audio is stay ahead of playback.

If you fail to keep up, the chip will continue to make noise using the
contents of the buffer, going back to the beginning when it reaches the end.
For music, this is a feature -- if you fill the buffer with a wave, you can
tell it to begin playback and you won't have to do anything else until you
want to change notes.

Of course stereo data takes twice the number of bytes in the buffer, so you
can only fit 128 samples in it. At 8000 samples per second, you get 0.016
seconds of buffered audio--so you have about 14318 cycles until you need to
have the buffer "topped up" again -- 28636 if you're in high-speed mode.

With a sound device that operates like this, and no-halt disks, a CoCo2/3
could fairly easily keep up with (and play sound equivalent to) a PC
SoundBlaster Pro (capable of 22050Hz 8-bit stereo). The opposite method could
be used to digitize analog waveforms (IOW, record :) ); clear and set a ring
buffer, set the command to record, and follow the chip as it continually fills
the buffer.

I believe that this could be done with 4 bytes of CoCo address space -- one
for the command byte, one for the offset into the buffer, and two for the
current command's operand.

-- 
| Jeff Teunissen -=- Pres., Dusk To Dawn Computing -=- deek at d2dc.net
| GPG: 1024D/9840105A 7102 808A 7733 C2F3 097B 161B 9222 DAB8 9840 105A
| Core developer, The QuakeForge Project     http://www.quakeforge.net/
| Specializing in Debian GNU/Linux           http://www.d2dc.net/~deek/



More information about the Coco mailing list