Ring modulation and oscillator sync
What it is#
Two of the sid's control-register bits couple a voice to its neighbour: sync ($02) hard-syncs one oscillator to another, ring ($04) replaces a voice's triangle output with a ring-modulated combination of the two. The test bit ($08) is the third special bit: it "silences sound and resets the oscillator" (sources: s-goattracker-readme, s-witchmaster-creating-chiptunes-with-sid-wizard).
Why it works#
From the 6581 datasheet (source: s-mos-6581-datasheet; quoted in the SID-Wizard book): hard sync "synchronizes the fundamental frequency of oscillator 1 with the fundamental frequency of oscillator 3", and varying one against the other "produces a wide range of complex harmonic structures"; the modulator must be at a non-zero and "preferably lower" frequency. Ring modulation gives "a wide range of non-harmonic overtone structures for creating bell or gong sounds and for special effects"; it only works with the triangle selected on the modulated voice. The modulator is always the voice to the left — voice 3 modulates voice 1, 1 modulates 2, 2 modulates 3 — and no other parameter of the modulating voice matters — the datasheet itself lists the chain register by register: voice 2's SYNC "synchronizes Oscillator 2 with Oscillator 1" and its RING MOD uses "Oscillators 2 and 1", voice 3's use oscillator 2 (sources: s-mos-6581-datasheet, s-witchmaster-creating-chiptunes-with-sid-wizard, s-goattracker-readme). The Programmer's Reference Guide describes sync differently — "basically a logical ANDing of two wave forms. When either is zero, the output is zero" — where the datasheet speaks of synchronising the fundamental; the datasheet's wording is the one the trackers' behaviour matches (source: s-c64-prg-chapter-4-sound). The designer's description settles what the two bits do inside the chip: sync is "clearing the accumulator of an Oscillator based on the accumulator MSB of the previous oscillator", and ring modulation is "substituting the accumulator MSB of an oscillator in the EXOR function of the triangle waveform generator with the accumulator MSB of the previous oscillator. That is why the triangle waveform must be selected to use Ring Modulation" — the triangle itself being made by inverting the accumulator's upper bits with its own MSB through EXOR gates (sid; source: s-sidmusic-yannes-interview). Newman hears the result in rob-hubbard's work: pitched, ring-modulated percussion "simultaneously performing rhythmic and contrapuntal duties" (commando, The Last V8), and sanxion's "heavily ring modulated lead and supporting lines" that "sound utterly cacophonous" alone and "gel together" in the mix; martin-galway's driver was built around waveform manipulation, ring modulation and PWM (source: s-newman-driving-the-sid-chip).
How to do it#
SID-Wizard#
- In the note column:
Shift+R/C=+Rswitch ring modulation on/off,Shift+S/C=+Sswitch sync on/off — shown as small symbols after the note. - As effects:
$Exsets the control nybble (test / ring / sync / gate) as a small effect;$04 xxwrites the whole waveform/control register. - In the instrument's wave table any
$10–$FDentry is a full waveform/control byte, so ring/sync/test can be switched per frame (wavetable-programming): control nibble1gate +4ring =5, e.g.$15for a gated ring-modulated triangle; the 1.6 charts and the beginners' tutorial spell the nybble out —1gate,2sync,4ring,8test;3= sync + gate,5= ring + gate,7= both with gate, and "you need to keep the gate bit turned on" (sources: s-sid-wizard-charts-and-tables, s-chipmusic-c64-music-for-dummies). - The Bare and Demo players drop the waveform/ring/sync small effects (sid-player-routine).
(sources: s-sid-wizard-manual, s-witchmaster-creating-chiptunes-with-sid-wizard)
What the player actually does (SW 1.97 player.asm)#
From m64's duet research (player.asm 3101–3108; source: s-duet-research-sidwizard-deep):
- The note-column flags flip single bits in the channel's waveform ghost:
$79/$7Aset/clear the sync bit,$7B/$7Cthe ring bit — and they persist only until a WF-table waveform row replaces the whole byte or the next note starts. An instrument whose wave table keeps writing waveform values will silently erase a pattern's ring/sync flag on its next table step; the flags survive only over table rows that hold ($00–$0Frepeats,$FFend). - Small-FX
$Exreplaces the ghost's entire low nibble (gate/sync/ring/test at once),$4xthe high nibble; big-FX$04the whole byte, raw.
GoatTracker#
Set the bits in the wavetable byte: $02 sync, $04 ring ("most effective with the triangle waveform"), $08 test — e.g. 15 = triangle + ring + gate. The inaudible values $00–$0F are typed as E0–EF, so test + gate is E9; the instrument's 1stFrame Wave is normally $09 (gate + test) (source: s-goattracker-readme).
In BASIC (the Programmer's Reference Guide)#
The 1982 manual's two examples write the control register in decimal (source: s-c64-prg-chapter-4-sound):
| effect | POKE S+4 | bits | modulator (voice 3) |
|---|---|---|---|
| "mosquito" — sync | 19 on, 18 off | gate + sync + triangle | voice 3 high byte 28 against voice 1 high byte 100; attack 13, decay 11 |
| "clock chime" — ring | 21 on, 20 off | gate + ring + triangle | voice 3 high byte 30 against voice 1 high byte 130; attack 0, decay 9, twelve dings |
The chime paragraph calls ring modulation "bit 3 of register 4", but 21 = 16 + 4 + 1 sets bit 2 — the datasheet's assignment (ring = bit 2, test = bit 3) is the correct one.
SID Factory II#
Test bit at note start: flag $10 in the instrument's third byte (Shift+Enter opens a bit editor). It also unlocks the noise generator after a "forbidden" noise combination (source: s-chordian-sf2-instruments).
Furnace#
Instrument checkboxes Ring Modulation ("the channel's output will be multiplied with the previous channel's") and Oscillator Sync ("as the previous channel's oscillator finishes a cycle, it resets the period of the channel's oscillator"), a Special macro that switches ring, sync, the gate bit and the test bit per tick, and the compatibility effects 1E4y (ring) and 1E5y (sync). Its test-bit semantics: set = "immediately mute channel", and "if the channel is a source of ring mod and/or hard sync, those stop working until the bit is reset" — a test bit on the modulator silences the modulated voice's effect too (source: s-furnace-c64-docs).
defMON#
Ring and sync live in the gate nibble of the sidTAB's second WG column: +1 gate, +2 sync, +4 ring mod, +8 test bit — additive, so 07 = ring + sync + gate and 05 = ring + gate. defMONing 102 states the pairing: "1+2, 2+3, 3+1 … e.g. used in channel 1 means channel 3 modifies channel 1". Because the two WG columns are ORA'd together before the register write, $55 can be entered as 5401 or 5005 — so you can hold the ring-mod bit in one column while switching waveforms per line in the other, a per-line ring-mod switch (Amelinium's technique, 2018-12) (sources: s-defmon-wiki-defmoning-102, s-defmon-wiki-defmoning-101, s-chipmusic-defmon-thread). The manual states the column split that makes this work: of the two WG columns, the yellow one is the waveform and you "use only the first digit" (1x triangle, 2x saw, 4x pulse, 8x noise), while the green one is gate plus hardsync and ring modulation and you "use only the second digit" (source: s-defmon-wiki-manual).
CheeseCutter#
The same two nibbles, read off the editor's own SID cheat sheet: the waveform high nybble (with LOCK flagged on $9–$F, the noise combinations that silence the generator until a test bit) and the gate / sync / ring / test low nybble, entered in the wave program. Its note beside them is the one that decides whether a sound survives the wrong machine: "Waveforms $3, $6 and $7 are audible only on new SID (8580)" — the combined waveforms, not the ring and sync bits, are what varies between chips (source: s-cheesecutter-guide; sid).
The test bit, precisely#
- It resets the oscillator immediately and holds it at zero while set; it does not touch the envelope, so it is not a substitute for hard-restart (sources: s-witchmaster-creating-chiptunes-with-sid-wizard, s-lemon64-hard-restart-threads). Datasheet: "resets and locks Oscillator 1 at zero until the TEST bit is cleared. The Noise waveform output of Oscillator 1 is also reset and the Pulse waveform output is held at a DC level" — intended for testing, but usable "to synchronize Oscillator 1 to external events"; the noise lock-up is cleared "by the TEST bit or by bringing RES (pin 5) low" (source: s-mos-6581-datasheet).
- Combining noise with any other waveform locks the noise generator (silence, and plain
81stays silent) until the test bit is set; a test bit on every note's first frame keeps noise drums safe — "Setting the test bit has no downsides" (source: s-chordian-sf2-instruments). The cause, from the designer: combined waveforms "could lock up the pseudo-random sequence generator by filling it with zeroes" (source: s-sidmusic-yannes-interview). A scene-provenance note: per JCH's memoir, johannes-bjerregaard "discovered how to use a test bit in the SID chip to reset the random numbers used internally by the noise waveform" — while visiting JCH, making noise "more predictable … slightly more metallic" (source: s-chordian-my-computer-chronicles). - Hermit's reason for the 1st-frame
$09setting: reset the oscillators before the sound starts "and get a short 'sexy' start of the sound" (source: s-witchmaster-creating-chiptunes-with-sid-wizard). - A "reset" done with the test bit and the pulse-width register (a codebase64 technique for software-controlled pulses) is a different subject from hard restart (encore, source: s-lemon64-hard-restart-threads).
- Measured (asger-alstrup, 1995): the oscillator counter "is held reset to 0 when the test bit is 1" and "starts counting" as soon as it is cleared, waveform selected or not — an immediate phase reset; the noise shift register, by contrast, restarts "$2000-$8000 cycles later (this figure varies greatly)", 8–33 ms, and then from the fixed value
$7FFFF8(source: s-sidmusic-alstrup-waveform-examinations). Practical consequence: one frame of test bit reliably resets a triangle or pulse phase, but a noise reset may land in the next frame. - The forum's "metal noise" list uses exactly that:
$88–$8F(noise + test) "reset noise", and$F9for a frame followed by$81"resets the internal pseudo random generator, so the noise waveform play different, on some sids … more 'metallic' depending on the value and running SID cycles" (4mat, source: s-chipmusic-sid-music-hints-n-tips).
- Heard in code — Galway's Rambo loader (1986): ring modulation as an instrument, and as a mid-phrase edit. Instrument 5 of the galway-player is
$41 | RINGBIT, $ee, $0f, $05, $32, commented in the source "instr5 for rising ringmod effect"; elsewhere the song stream pokes the playing instrument's control byte directly —+ISET $18,$15 ; ctrl: tri + gate + ringmod— so the effect is switched on partway through a phrase rather than being a property of the note. dmx87's timestamps mark where to listen: "01:40 rising notes used with sync" (source: s-realdmx-galway-rambo-player). - Heard in code — Hunter's Moon's "plonk" (1987): Martin Walker's effect engine pairs voice 2 (triangle + ring, control
$15, SR$98, frequency$F400, high-byte step$0Dadded for 8 frames then subtracted) with a silent triangle on voice 3 ($10, frequency$2011, step$01moving the opposite way) — "a vibrato like sound, but is uses ring modulation" (hunters-moon; source: s-sidin14-hunters-moon). scarzix on the same bits in 2015: "I love its pulse waveform and the things you can do with sync of a second channel. Used that a lot in Forgotten Times and Electrosphere Part 1" (source: s-sidin14-scarzix-interview).
Tips & pitfalls#
- The modulator voice is the neighbour: its pitch is part of the sound, so program it even if it stays silent (gate off or test bit).
- Sync needs the modulator lower than the modulated voice; ring needs triangle on the modulated voice — otherwise nothing audible happens (datasheet).
- Start with sync from the bass: "have the bassline voice as the sync source, and turn on the sync bit in the lead voice. This adds a distortion or 'screaming' quality, somewhat like an electric guitar" (Lasse Öörni). But "for making 'regular' sounds for sid tunes, you will most likely never use either ringmod nor sync. don't even bother with those unless you understand everything else" (Tobias); both "effectively require two out of three channels" (commodorejohn, who also describes ring mod as working "between the triangle output of the channel with the ring-mod bit set and the square output of the previous channel" — consistent with the datasheet's "no other parameter of the modulating voice matters") (source: s-lemon64-learning-sid-sound-design).
- From outside the C64: "awesome buzzy ring modulator" heads a chipmusic.org poster's list of typically SID sounds (source: s-chipmusic-typical-sid-sounds). From inside it, goto80 names the same thing first when asked what he likes about the chip — "ringmodulation, knee-deep pulsemodulating bass sounds and the freedom of the SID", adding "Setting bits n' bytes to make sound&music is superfresh" (source: s-remix64-goto80-interview).
Heard in#
commando, The Last V8, sanxion (Hubbard's ring-modulated percussion and leads) (source: s-newman-driving-the-sid-chip). Forum attributions (source: s-lemon64-learning-sid-sound-design): the Sanxion loader — "the most well known tune that does it … also one of the first" (NM156); the "bell" tone of the main tune of The Lord of the Rings (ring mod) and the Crazy Comets theme (sync) (commodorejohn); NM156's own tune for International Karate Ultimate Competition.
Related#
wavetable-programming · instrument-design · sid · hard-restart · c64-programmers-reference-guide · furnace · defmon · randomization-and-probability · bob-yannes · cheesecutter · galway-player
Sources#
s-sid-wizard-manual · s-goattracker-readme · s-witchmaster-creating-chiptunes-with-sid-wizard · s-chordian-sf2-instruments · s-lemon64-hard-restart-threads · s-newman-driving-the-sid-chip · s-mos-6581-datasheet · s-c64-prg-chapter-4-sound · s-sid-wizard-charts-and-tables · s-chipmusic-c64-music-for-dummies · s-lemon64-learning-sid-sound-design · s-furnace-c64-docs · s-sidmusic-alstrup-waveform-examinations · s-chipmusic-sid-music-hints-n-tips · s-chipmusic-typical-sid-sounds · s-sidmusic-yannes-interview · s-sidin14-hunters-moon · s-sidin14-scarzix-interview · s-defmon-wiki-defmoning-101 · s-defmon-wiki-defmoning-102 · s-chipmusic-defmon-thread · s-chordian-my-computer-chronicles · s-duet-research-sidwizard-deep · s-duet-research-sidwizard · s-defmon-wiki-manual · s-cheesecutter-guide · s-realdmx-galway-rambo-player · s-remix64-goto80-interview