Skip to content
Techniques & Technology

Filter Sweeps

Moving through the frequency spectrum

Filter sweeps create dynamic timbral changes by gradually adjusting filter cutoff frequency, a signature effect of the C64's SID chip.

commodore-64 soundsidsynthesis 1982–present

Overview

A filter sweep moves a synthesiser's cutoff frequency over time, producing timbral motion from bright to dark or vice versa. The SID's state-variable analogue filter — running on the same die as the digital oscillators — made sweeps a signature sound of C64 music. Composers like Rob Hubbard, Martin Galway, and Tim Follin built their identity around modulating it.

Fast facts

  • Definition: gradual change of filter cutoff frequency.
  • Effect: timbral brightness variation, often with a resonant peak.
  • SID advantage: built-in resonant state-variable filter (LP/BP/HP) per chip.
  • Programming: rewrite cutoff registers each frame from an IRQ.
  • Uses: bass growls, evolving pads, transitions, percussion fakes.

SID filter registers

The SID's filter is configured by four registers; the cutoff is not at $D418. Per the 6581/8580 register map:

RegisterFieldPurpose
$D415 (FCLO)bits 2:0Filter cutoff, low 3 bits
$D416 (FCHI)bits 7:0Filter cutoff, high 8 bits
$D417 (RES/FILT)bits 7:4Resonance (0–15)
bit 3Route external audio in through filter
bit 2Route voice 3 through filter
bit 1Route voice 2 through filter
bit 0Route voice 1 through filter
$D418 (MODE/VOL)bits 6:4LP/BP/HP mode bits (mix-selectable)
bit 7Voice 3 off (cuts V3 from output)
bits 3:0Master volume (0–15)

The cutoff is an 11-bit value: cutoff = (FCHI << 3) | (FCLO & 7). Voices with their $D417 bit clear bypass the filter and go straight to the mixer.

Filter modes

$D418 bits 4-6 are mix-selectable, so combinations are legal:

Bits setResult
LP only (bit 4)Low-pass — bright → dark
BP only (bit 5)Band-pass — emphasises a frequency range
HP only (bit 6)High-pass — dark → bright
LP + HPNotch (band-reject)
LP + BP + HPApproximately all-pass — filter effectively bypassed

Setting all bits clear silences any voice routed through the filter.

A simple downward sweep

Update the cutoff each frame from an IRQ:

sweep_cutoff:    .word $07F8        ; start near max cutoff
sweep_step:      .word $0030        ; per-frame decrement

update_filter:
    ; cutoff -= step
    sec
    lda sweep_cutoff
    sbc sweep_step
    sta sweep_cutoff
    lda sweep_cutoff+1
    sbc sweep_step+1
    sta sweep_cutoff+1

    ; bottom 3 bits → FCLO, top 8 bits → FCHI
    lda sweep_cutoff
    and #$07
    sta $d415
    lda sweep_cutoff+1
    sta $d416
    rts

For a routed-and-resonant sweep, set $D417 once with the desired voice routes and resonance:

    lda #$F1          ; resonance %1111, voice 1 routed through filter
    sta $d417
    lda #%00010000    ; LP only, master volume 0 — set volume separately
    ora #$0F          ; volume = 15
    sta $d418

Musical uses

ApplicationEffect
Bass growlsSlow LP cutoff sweep over a sustained bass note
Pad texturesGentle BP sweep across a held chord
TransitionsCutoff ramp synced to a section change
Percussion fakesSnap the cutoff down with high resonance to imitate hi-hats and snares
Wobble bassLFO-style triangle-wave sweep — the precursor to dubstep wobble

6581 vs 8580

The two SID variants behave very differently in the filter:

6581 (12V, original)8580 (9V, revised)
Cutoff curveWildly per-chip non-linearNear-linear, predictable
DistortionAudible at high signal levelsMostly clean
ResonanceLess pronouncedStronger, more peaky
Sound"Warm", "dirty""Clean", "crisp"

A piece written for the 6581 — most pre-1986 SID music — often sounds wrong on an 8580 because the cutoff curve and distortion are fundamental to how the music was tuned. Modern players (reSIDfp, libsidplayfp) approximate per-chip cutoff curves to compensate.

See also