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.

C64 Audio

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.

PropertyValue
ChipSID 6581 (early) or 8580 (late)
Registers$D400–$D41C
Voices3, each 7 registers
WaveformsTriangle, sawtooth, pulse, noise
EnvelopeADSR per voice
FilterOne 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.

ParameterWidthRole
Frequency16 bitsPitch of the voice.
Pulse width12 bitsDuty of the pulse waveform.
Waveform4 select bitsTriangle, sawtooth, pulse, noise.
Attack / decay4 bits eachRise, then fall to sustain.
Sustain / release4 bits eachHeld 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.

OffsetRegisterContents
+0Frequency lowLow 8 bits of the 16-bit frequency.
+1Frequency highHigh 8 bits of the frequency.
+2Pulse width lowLow 8 bits of the 12-bit pulse width.
+3Pulse width highHigh 4 bits of the pulse width.
+4ControlGate (bit 0), sync, ring mod, test, and waveform selects (triangle, sawtooth, pulse, noise).
+5Attack / decayAttack in the high nibble, decay in the low nibble.
+6Sustain / releaseSustain 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.

RegisterContents
$D415Filter cutoff low (3 bits used).
$D416Filter cutoff high (8 bits).
$D417Resonance (high nibble) and filter enable per voice (low bits).
$D418Filter 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.

AddressUse
$D400–$D406Voice 1 (7 registers).
$D407–$D40DVoice 2 (7 registers).
$D40E–$D414Voice 3 (7 registers).
$D415–$D418Filter cutoff, resonance, mode and master volume.
$D419–$D41APaddle X and Y (analogue inputs, read-only).
$D41BVoice 3 oscillator output (read-only).
$D41CVoice 3 envelope output (read-only).