I was asked recently "The sound chip in the 128K Spectrum was actually reasonably good eh? Wasn't it even better than the Commodore's?"

The truth is, the 128K spectrum's sound chip was a vast improvement on the original spectrum's beeper. It must have been, as the Atari ST used a Yamaha clone of the very same audio chipset.

However, the Atari STFM wasn't exactly known for its audio capabilities either (MIDI capabilities excepted of course). I've heard many people to say that the Commodore 64 "sounds better" than the Atari ST, but this is a bit of a subjective argument. So, as an exercise in noding what you don't know, I thought I'd do some reading and compare the two at a slightly more technical level.

Before we start the comparison, let's understand the most basic sort of audio output you can get from a computer. The Spectrum 48k and even the beeper in your PC simply use a simple pulse generator to drive an amplifier, resulting in a square-wave like this:


***** ***** ***** *****
* * * * * * * *
* * * * * * * *
* ******* ******* ******* *

Now, let's look at the Spectrum 128's audio controller, the General Instruments AY-3-8910 PSG. At its most basic level, this chip starts off by producing a square-wave signal at a specified frequency, just like the one above. However, it has three channels instead of just one to enable it to produce polyphonic sound, and it also has a number of features that let you modify the basic soundwave before you hear it:

  • Each channel has a corresponding white noise generator, which can be mixed with the normal channel output
  • Each channel has a dedicated amplitude modulation envelope, which modifies the volume of a given channel over time, using any one of ten predefined patterns.

The envelope for each channel can be used to provide a slow fade-in and out of each note played to get rid of that "Beep beep beep" sound which people associate with Spectrum 48 style music:


*****
***** * *
***** * * * *
*********** ******* ******* *

Alternatively, I believe that the envelope could be used at a faster rate to effectively change the actual shape of the waveform, like in this "Repeat Attack" example:


** ** ** **
* * * * * * * *
* * * * * * * *
* ******* ******* ******* *

So, the combination of multiple audio channels, variable waveforms and a white noise generator combine to give a pretty good sound chip.

Now, the SID chip also has three channels, a white noise generator and an envelope generator per-channel. But it uses these features in a subtly different way and then throws in a couple more tricks, which is why I still suspect that it's the "better" chip.

Firstly, the SID isn't limited to generating fixed width square waveforms. It can also output triangle waves:


* * * *
* * * * * * * *
* * * * * * * *
* * * * *

...Sawtooth waves:


* * * *
** ** ** **
* * * * * * * *
* ** ** ** *

and it can also vary the pulse width of it's square waves:


*** *** *** ***
* * * * * * * *
* * * * * * * *
* ********* ********* ********* ***

So from the start the SID gives you more control over the sound that you're generating. Additionally, for each channel the SID has an envelope which allows you to control the attack (0-1), decay (1-2), sustain (2-3) and release (3-4) time for each note played:


*
*|*
* | ********
* | | |*
* | | | *
0 1 2 3 4

I think that the PSG and SID envelopes are fundamentally different in this respect. From what I've read, with the PSG you pick an envelope shape and specify a total duration, whereas with the SID you can specify all four points of this graph. Combine this with the SID's ring modulation feature which allows channels 1 and 3 to produce non-standard waveforms, and its built-in low pass, bandpass and high pass filters, and you have a lot more control over the resulting output than the PSG appears to give.

If you're an expert Spectrum 128 or C64 programmer and you think I've missed or misunderstood something, please let me know!