lotus

previous page: 18.020 How can I connect my Imagewriter II to a PC?
  
page up: Apple II Csa2 FAQs
  
next page: 19.002 Is there a way to output quadrphonic sound on a IIgs?

19.001 If the GS only has eight output chanels, then it would seen to me that it could only play eight different sounds at a time. So how can I digitize fifteen different sounds and play them all back simultaneously?




Description

This article is from the Apple II Csa2 FAQ, by Jeff Hurlburt with numerous contributions by others.

19.001 If the GS only has eight output chanels, then it would seen to me that it could only play eight different sounds at a time. So how can I digitize fifteen different sounds and play them all back simultaneously?

    By:  Todd Whitesel

To summarize the following lecture:

There are 32 oscillators (16 generators) and 16 channels. Not all are used for
actual sound output.

Oscillators are "smart voices" Generators are oscillator pairs that can
generate extra effects with each other Channels are actual independent output
lines like left and right speaker

That said, let's start at the top.

The DOC is a coprocessor with its own dedicated 64K of RAM. All the sound
samples have to be put in this RAM before they can be played.

The DOC has 32 'oscillators' which are essentially smart DMA channels. Their
basic function is to sweep through areas of the DOC memory reading samples and
playing them. They can do so at variable speeds (automatically repeating or
skipping sample values as necessary), they can loop on a power of two boundary,
they can stop when they read a zero, they have independent volume settings, and
various other things that aid in reproducing complex instruments without
loading down the main CPU.

But when you come down to it, the DOC is capable of playing 32 sounds
simultaneously and independent of each other, provided that all the sample data
fits in the DOC RAM.

The oscillators are not all perfectly identical in operation. For the basic
sample playing and looping they are, but for some more complex functions they
must be paired. This is where the concept of 'generators' comes from -- the 16
generators ARE operationally identical and that is why software prefers the
generator concept. Both oscillators and generators are numbered from 0, so
oscillators 0 & 1 are generator 0, oscillators 2 & 3 are generator 1, and so
on.

Generator 15 (oscillators 30 & 31) is reserved for system use (one oscillator
is set to loop slowly at zero volume, to generate tempo; I forget if the other
is used by anything, it's probably used to play mono samples).

Most software use one generator per voice. Since 15 generators are left over,
spec'ing the GS as having "15 voice sound capability" is a fair statement.

The actual output that comes out the DOC is a 'time-domain multiplexed' sound
output and five digital bits. What happens is this: the DOC services each
oscillator in turn, and for each oscillator the current sample value is
multiplied by the oscillators' volume setting and a voltage proportional to the
product is output on the sound output. Four of the digital bits are set to the
'channel number' setting for the oscillator and the last one simply changes
voltage from about 3 volts to about 0.5 (for you EE

folks out there, this is the negative edge of an output-valid strobe).

External hardware is responsible for splitting off the various channels (4 bits
means that there can be 16 of them) and outputting them seperately. The
motherboard hardware just ignores the channel setting and mixes all the sound
outputs into the speaker/earphone. The sound connector on the motherboard only
has room for 3 of the four bits, so expansion cards that plug into the sound
connector can only get 8 seperate output channels. Most stereo cards (AE's
sonic blaster, for example) only pay attention to

the lowest bit, so even numbered channels are left and odd numbered channels
are right (or is it the other way round? I forget).

No, it isn't simple, but it gives a lot of flexibility -- most of which is
largely untapped.
    

 

Continue to:













TOP
previous page: 18.020 How can I connect my Imagewriter II to a PC?
  
page up: Apple II Csa2 FAQs
  
next page: 19.002 Is there a way to output quadrphonic sound on a IIgs?