C64 Audio
The Commodore 64 makes sound with the SID chip, the 6581 in early machines and the 8580 later. It has three independent voices, each a full synthesiser with its own frequency, waveform and envelope, plus a shared filter and master volume. Its registers sit at $D400–$D41C.
Overview
SID is a three-voice analogue synthesiser on a chip. Each voice generates a waveform at a chosen pitch, shapes its volume with an ADSR envelope, and can be routed through a shared filter. A master volume sets the overall level. Once its registers are written the chip plays on its own, so music runs under a game.
| Property | Value |
|---|---|
| Chip | SID 6581 (early) or 8580 (late) |
| Registers | $D400–$D41C |
| Voices | 3, each 7 registers |
| Waveforms | Triangle, sawtooth, pulse, noise |
| Envelope | ADSR per voice |
| Filter | One shared, low-pass, band-pass, high-pass |
The three voices
Each voice has a 16-bit frequency, so pitch is set finely across the audible range. The waveform is chosen by the control register: triangle, sawtooth, a pulse whose width comes from a 12-bit register, or noise. A voice's volume over time follows its ADSR envelope, started and released by the gate bit.
| Parameter | Width | Role |
|---|---|---|
| Frequency | 16 bits | Pitch of the voice. |
| Pulse width | 12 bits | Duty of the pulse waveform. |
| Waveform | 4 select bits | Triangle, sawtooth, pulse, noise. |
| Attack / decay | 4 bits each | Rise, then fall to sustain. |
| Sustain / release | 4 bits each | Held level, then fall to silence. |
Voice register map
Each voice occupies seven consecutive registers. Voice 1 starts at $D400, voice 2 at $D407, voice 3 at $D40E; the layout repeats. The control register holds the gate bit and the four waveform selects along with ring modulation and sync flags.
| Offset | Register | Contents |
|---|---|---|
| +0 | Frequency low | Low 8 bits of the 16-bit frequency. |
| +1 | Frequency high | High 8 bits of the frequency. |
| +2 | Pulse width low | Low 8 bits of the 12-bit pulse width. |
| +3 | Pulse width high | High 4 bits of the pulse width. |
| +4 | Control | Gate (bit 0), sync, ring mod, test, and waveform selects (triangle, sawtooth, pulse, noise). |
| +5 | Attack / decay | Attack in the high nibble, decay in the low nibble. |
| +6 | Sustain / release | Sustain in the high nibble, release in the low nibble. |
Filter and volume
SID has one filter shared by the voices. Its cutoff is 11 bits across two registers, and the resonance and per-voice routing sit in another. The mode-and-volume register $D418 picks low-pass, band-pass or high-pass, cuts voice 3 if wanted, and sets the 4-bit master volume in its low nibble.
| Register | Contents |
|---|---|
| $D415 | Filter cutoff low (3 bits used). |
| $D416 | Filter cutoff high (8 bits). |
| $D417 | Resonance (high nibble) and filter enable per voice (low bits). |
| $D418 | Filter mode (LP, BP, HP bits), voice 3 off, and master volume (low nibble). |
Setting more than one mode bit combines responses; low-pass and high-pass together give a notch. The filter shapes whichever voices are routed to it while the rest pass through untouched.
Register map
The whole chip fits in 29 registers from $D400. The three voices take the first 21, the filter and volume the next four, and the last four are read-only sensing registers.
| Address | Use |
|---|---|
| $D400–$D406 | Voice 1 (7 registers). |
| $D407–$D40D | Voice 2 (7 registers). |
| $D40E–$D414 | Voice 3 (7 registers). |
| $D415–$D418 | Filter cutoff, resonance, mode and master volume. |
| $D419–$D41A | Paddle X and Y (analogue inputs, read-only). |
| $D41B | Voice 3 oscillator output (read-only). |
| $D41C | Voice 3 envelope output (read-only). |