[comp.sys.atari.st] Strategies for Playing Digitized Sound

dmb@TIS.COM (David M. Baggett) (01/13/89)

   Has anyone experimented with this?  (We've all heard Starglider...)  Looking
in ST Internals, I found that the PSG sound chip has an 8 bit D/A converter.  
Unfortunately, it doesn't look like you can change the value directly; you have
to go through the waveform synthesis stuff (or the frequency/volume registers).
   8 bits of resolution produces decent (listenable) quality sound; does anyone
know how/if it is possible to change the 8 bit digital value directly?  The only
alternative I can see is using the noise generator and the volume control, but this
only gives four bits of resolution (awful).  The Stargilder intro sounds to be about
6 bit resolution -- anyone know how this was done?
   Maintaining timing for the samples is straightforward with Xbtimer, so that isn't
a problem.  44KHz is "correct"; 22KHz should be ok...

   Answers, anyone?

				Thanks,
				Dave Baggett
				arpa: dmb@TIS.COM

If there is interest I will post replies/source code to the net.

kirkenda@psu-cs.UUCP (Steve Kirkendall) (01/15/89)

In article <8901121633.AA12910@TIS.COM> dmb@TIS.COM (David M. Baggett) writes:
>
>   Has anyone experimented with this?  (We've all heard Starglider...)  Looking
>in ST Internals, I found that the PSG sound chip has an 8 bit D/A converter.  
>Unfortunately, it doesn't look like you can change the value directly; you have
>to go through the waveform synthesis stuff (or the frequency/volume registers).
>   8 bits of resolution produces decent (listenable) quality sound; does anyone
>know how/if it is possible to change the 8 bit digital value directly?  The only
>alternative I can see is using the noise generator and the volume control, but this
>only gives four bits of resolution (awful).  The Stargilder intro sounds to be about
>6 bit resolution -- anyone know how this was done?
>   Maintaining timing for the samples is straightforward with Xbtimer, so that isn't
>a problem.  44KHz is "correct"; 22KHz should be ok...

An 8-bit D/A converter?  From the specs I've seen, I thought it had a trio of
4-bit non-linear D/A converters.

You can get a little more than 4 bits of resolution by setting the different
sound channels to different volumes; e.g. by setting channels A and B to, say,
level 6 and channel C to level 7, you get something between levels 6 & 7.

Also, you wouldn't need nearly that many samples.  A sampling rate of 6KHz
at 6 bits per sample sounds like a typical telephone.  A sampling rate of
10KHz should push the Atari's PSG and the monitor's speaker to their practical
limits.

(Sampling like this was popular on the Radio Shack Color Computer a few years
ago.  That machine has a 6-bit D/A converter hooked directly up to its sound
output, and a 4-channel 6-bit A/D converter that could take samples at about
12KHz, but most people dropped down to 6KHz to conserve memory.)

-- 
"If I seem insensitive to what you're going through,
	keep in mind that's the way I am." -- Mr. Spock

brazil@pawl.rpi.edu (Timothy E. Onders) (01/15/89)

In article <1504@psu-cs.UUCP> kirkenda@psu-cs.UUCP (Steve Kirkendall) writes:
>
>Also, you wouldn't need nearly that many samples.  A sampling rate of 6KHz
>at 6 bits per sample sounds like a typical telephone.  A sampling rate of
>10KHz should push the Atari's PSG and the monitor's speaker to their practical
>limits.

Since I am presently developing some digital audio hardware for the ST, I must
comment that a 6KHz or even 10KHz sampling rate is pathetic for decent sound.
The frequency range for a sample is limited to 1/2 the sample rate, or, in this
case 3KHz or 5KHz. While this would be ok for voice, and maybe sound effects,
it would not allow many musical instruments, such as the piccolo, the piano,
and the pipe organ, and would eliminate important first order harmonics,
providing identifyiable sound, but sound on the level of a cheap toy. Even
a simple mac can do this type of sampling.

Since the Atari computers are noted for their large amounts of memory, there
is no reason to be limited to poor quality sound.

Timothy E. Onders      | 'Music is an extension of the soul, much as the eyes 
brazil@pawl.rpi.edu    |  are a window on it.'

P.S. Be on the watch for Central Services Audio products for the ST soon.