Commodore Banner Exchange

SID, the Commodore 64 sound chip

The sound chip of the Commodore 64 is the famous SID chip. This is one of the features of the Commodore 64 that made it legendary. But what’s so special about this chip?

The SID chip may be regarded as a simple sound synthesizer. To the original intentions of its designer, Robert “Bob” Yannes, it should have been more complex, but time constraints led to a simpler design.

Most home computers and game consoles sound chips of the time did not allow for a precise frequency control. As a result, most of them sounded detuned. Bob Yannes didn’t like this at all and was willing to come up with something much better.

The SID features a very fine frequency control for each voice. Frequency control registers are 16 bit wide, and they can be set to any frequency, from 0 to 4000 Hz, in 65536 steps. That covers more than eight octaves, and allows for very smooth portamentos. Each musical note can be reproduced with its exact frequency. That makes the difference over similar chips such as the Atari’s POKEY and the AY/YM chips found on other 8 bit machines. Those chips don’t have such a fine frequency control, and you can hear it. But even with less frequency resolution, those chips can do very nice things anyway. After all, it’s also a matter of personal taste.

The SID offers three voices. That’s not much, but each voice can be programmed with great flexibility, making it possible to use some software sound multiplexing schemes. As a result, you can make the illusion of more than one instrument playing at the same time with just a single voice. Bass and drums mixed on a single voice it’s the most common example of this approach.

Each voice, or oscillator, or channel, offers many parameters to be set. ADSR settings and waveforms are independently selectable for each voice. Filters may also be turned on or off for each cannel, but the cut-off frequency is the same for all three channels. More on this later.

Volume level is the same for all three voices as well.

Each sound may be seen as a combination of simple soundwaves. So, a complex sound is made up of simple soundwaves combined together. Each soundwave has its own frequency. The pitch of the note is determined by the fundamental frequency. The other frequencies determine how the sound “looks” to our ears. So, when we set the frequency to play a given musical note, by using the frequency control registers, we are actualy choosing the fundamental frequency of that sound. It is not possible to directly select the other frequencies to “shape” the sound. But we can select the waveform. Each waveform is different from the other because of its particular frequency content. And the tone, or sound shape, changes accordingly.

Also, we can cut some frequencies from a soundwave, or make some frequencies stronger than others, in order to change the shape of the sound. This is what is achieved by using filters. Usually, by applying a filter, you get a quiter, cleaner sound.

There are four waveforms available on the SID chip: triangle, sawtooth, squarewave and white noise. Those waveforms may be changed while a sound is being played. That makes it possibile to create complex sounds, and even mixed instruments. For example, you can mix a drum with a bass sound to make the illusion of bass and drum played at the same time on a single channel.

The square wave is the more versatile, because you can change its duty cycle. This is also called pulse width, and by modifying it, you can change the sound shape dramatically. Without going into further details, just think about an acustic guitar. If you have one, you’ll have realized that the sound changes if you plunk the cord near the guitar hole or far from it. Modifiying the duty cycle  on a square wave gives you more or less that change in sound.

Triangle and sawtooth waveforms are fixed. No duty cycle. The triangle may be used for flutes, while a sawtooth may be fine for violins and brasses.

White noise is not used to play notes. Instead, it is intended to reproduce various kinds of noises. The sound of the wind, explosions, drums… all may be synthesized by using this waveform. It sounds very crude and I don’t like it that much when unfiltered. I tend to prefer noises produced by other sound chips, such as the Pokey and even the VIC chip. But combined with filters, SID chip white noise is very nice.

Another powerful SID feature is the ADSR generator. There is one for each voice.

The ADSR determines the envelope of a note, that is, the way volume changes while a note is being played. On an organ, when you press a key, you suddenly get full volume, and it stays full as long as you keep that key depressed. When you release that key, the sound just stops immediately, e.g. volume suddenly goes to zero. On a piano instead, even if you keep the key depressed, the sound fades to zero. So a piano has a different envelope than an organ. As a consequence, these instruments require different ADSR settings.

ADSR stands for Attack/Decay/Sustain/Release. Attack is the time required for a note to reach it’s full volume. Decay is the time required for the volume to fall to a particular level, which is set by the Sustain parameter. The Sustain volume level keeps itself constant as long as the key of the organ is depressed. Finally, Release is the time required for a note to fade to zero. The Release phase starts when the key of the organ is released.

There is a bit in each waveform register that determines if the key of the organ is depressed or not. When this bit is on, the key is depressed and the Attack/Decay/Sustain phases start. When this bit goes to 0, the key is released and the Release phase starts and the note being played fades to zero. Of course, I was talking about an organ just to make an example, but the above explained behaviour is the same for any instrument being synthesized.

To obtain complex waveforms, the SID also offers ring modulation and synchronization. Those are rather advanced features for a home computer sound chip and are useful to reproduce bells and buzzing sounds. Many more uses are possible too.

This is a quick explanation of the SID chip features. To go into further details, you may read the “Commodore 64 Programmer’s Reference Guide”, Chapter 4, and the SID register entries from the excellent book “Mapping the Commodore 64” by Sheldon Leemon.

I did some BASIC experiments with Commodore 64 sounds, but I usually do SID music by using the cross-platform tool Goattracker. It’s very easy to use, but still, you need a full understanding of SID registers to make a good use of it. So, I think the above references are of great help.

Documents are useful, but still, some tricks may be learnt by doing. For example, changing sound parameters while a sound is being reproduced is the key to obtain complex sounds. As we said, mixed instruments can be obtained by changing the waveform while a sound is being played. We can also change filter settings as well.

Another nice trick, while using the square wave, is to gradually change the duty cycle while a note is being played. That is commonly used to make lead sounds.

Chords are more notes played at the same time that make up an harmony. While hearing a chord, you may feel happy or sad… that depends on the notes used to build that chord. A sequence of several chords defines the structure of a song.

As the three channels provided by the SID are not much, if you play a chord made up of three notes, you don’t have any free space for a melody to be played with the chord at the same time. This problem has been addressed by the concept of arpeggio, or arp. If you change the frequency of the note being played in a very fast way, cycling between the various frequencies required to make the desidered chord, you obtain a telephone ring-like sound just matching that chord. This way, you obtain a sound that may seem weird at first, but you actually have something very close to a chord and the other two channels are free. Arps are heavily used on SID music and they do have their charm.

As for music itself, I am not a musician. I more or less learned the basics of harmonics by just listening to C64 tunes from games. Also, playing some chords on a guitar and studying songs’ chords helped me a lot. I nearly can’t read music, but still, I can do simple SID tunes. Anyway, I have always had the ability of guessing the notes of a given song by ear.

On the next articles, I’ll share what I know about SID music making.

One Reply to “SID, the Commodore 64 sound chip”

1. pzawa says:

Very good articles ! And very good blogs !

Commodore Banner Exchange
Insert math as
$${}$$