← Back to Blog
Retro Computing Web Development

Building an In-Browser Commodore 64 SID Synthesizer & .SID File Player (MOS 6581 & 8580)

If you have ever spent an evening on the workbench probing Pin 27 (AUDIO OUT) of a MOS 6581 or MOS 8580 Sound Interface Device—or simply had a Rob Hubbard, Martin Galway, or Jeroen Tel bassline stuck in your head—this latest addition to Smiggy's Bench & Diagnostics Tools is for you.

We have just launched two connected, zero-dependency Commodore 64 audio tools that run 100% client-side in your browser and pipe their output directly into the Smiggy Music Lab real-time oscilloscope and 64-bar FFT spectrum analyser:

  1. The 3-Voice WebAudio SID Chiptune Synthesizer (`/bench-tools/sid-synth`) — an interactive subtractive synth modelling both the 1982 NMOS 6581 and 1986 HMOS-II 8580 with 1%–99% Pulse Width Modulation, ADSR envelopes, a multimode resonant filter, a 50Hz/60Hz fast arpeggiator, a 16-step tracker sequencer, and live 6502 Assembly / BASIC code generation.
  2. The Commodore 64 .SID File Player, PSID/RSID Header Inspector & Live Register Editor (`/bench-tools/sid-player`) — a drag-and-drop .SID player with a built-in MOS 6502/6510 CPU + 64KB RAM emulator, binary header metadata patcher, per-voice Mute/Solo mixer, live $D400–$D418 filter override, and 16-bit PCM .WAV exporter.

1. Inside the 3-Voice WebAudio MOS 6581 / 8580 SID Chiptune Synthesizer

Designed in 1981 by Bob Yannes (who later co-founded Ensoniq), the original SID chip was lightyears ahead of the simple square-wave beepers found in early 1980s microcomputers. In our new WebAudio SID Chiptune Synthesizer, every stage of the signal path is exposed on a single workbench screen:

  • Three Independent Voices ($D400–$D414): Switch each oscillator between Triangle ($10), Sawtooth ($20), band-limited Pulse ($40) with a continuously variable 1% to 99% Duty Cycle (12-bit $000–$FFF) plus a PWM LFO sweep, and an authentic clocked 23-bit LFSR 8-bit Noise generator ($80) for pitched C64 snares, hi-hats, and arcade explosions.
  • Authentic 4-Bit ADSR Envelopes: Dial in Attack (2 ms–8 s), Decay (6 ms–24 s), Sustain (0%–100%), and Release (6 ms–24 s) per voice—or link all three voices globally—while watching the live SVG envelope curve update in real time.
  • 6581 (12V NMOS) vs. 8580 (9V HMOS-II) Multimode Filter ($D415–$D418): Route any combination of Voice 1, Voice 2, and Voice 3 through the combinable Low-Pass ($10), Band-Pass ($20), and High-Pass ($40) filter network. Toggle between MOS 6581 (modelling the warm asymmetric FET saturation of a longboard C64 ASSY 250407/250425 with 470 pF filter caps) and MOS 8580 (modelling the crisp, high-Q response of a shortboard C64C / C128DCR with 22 nF filter caps).
  • 50Hz PAL / 60Hz NTSC Fast Arpeggiator & 16-Step Sequencer: Because the C64 only had three hardware voices, classic composers simulated rich polyphonic chords by cycling semitone offsets on every VIC-II raster interrupt (50 times per second on PAL, 60 times per second on NTSC). Choose from Major, Minor, Sus4, Hubbard Dual-Octave, Dominant 7th, Laser Pitch Dive, or enter your own custom CSV semitone table, then fire up the 16-step pattern sequencer or play live on the 2-octave QWERTY/touch piano keyboard.

8 One-Click Presets, Shareable Patch URLs & 6502 / BASIC Code Export

To get you making noise straight away, the synth ships with eight built-in presets: Commando Lead, Monty Bassline, 8-Bit Arpeggio, Laser SFX, Space Ambient, Hubbard Lead, Galway Swarm, and C64 Percussion. Clicking Share Patch URL encodes your entire 3-voice patch and 16-step pattern into a bookmarkable #patch=... link.

Even better for programmers: as you move any slider, the live 25-Register SID Map ($D400–$D418 / 54272–54296) updates in real time and generates copy-ready MOS 6502/6510 Assembly (LDA #$xx / STA $D4xx) or Commodore BASIC V2 (POKE 54272+I, V) that you can paste directly into our In-Browser 6502 Cross-Assembler to compile a runnable .PRG binary!


2. The Commodore 64 .SID File Player, PSID/RSID Header Editor & Live Register Monitor

Alongside the synthesizer, we built a dedicated Commodore 64 .SID File Player & Header Inspector (`/bench-tools/sid-player`) designed for dissecting real C64 music drivers and High Voltage SID Collection (HVSC) tunes in the browser:

  • Drag-and-Drop .SID Playback + 6 Bundled Multi-Subtune Suites: Drop any .sid file onto the page (or pick one of the six bundled multi-subtune C64 suites). Behind the scenes, a full client-side MOS 6502 / 6510 CPU emulator loads the binary into a 64KB C64 RAM image ($0000–$FFFF), executes JSR initAddress with the selected subtune in the Accumulator, and runs JSR playAddress (or the installed $0314/$0315 IRQ vector) at 50Hz PAL or 60Hz NTSC.
  • PSID / RSID Binary Header Inspector & Patcher ($00–$7C): Inspect the magic header signature (PSID v1–v4 or RSID), loadAddress, initAddress, playAddress, RAM footprint, and IEEE 802.3 CRC32 hash. Need to fix a typo or change the default startup song or chip flag in a .sid file? Edit the 32-byte ASCII Title ($16), Author ($36), Released / Copyright ($56), Default Subtune ($10), PAL/NTSC Clock Flag, or 6581/8580 Model Flag ($76) and click Download Updated .SID Binary.
  • Per-Voice Mute / Solo Mixer & Live Filter Override: Isolate individual bass, lead, or arpeggio channels with MUTE and SOLO buttons on Voices 1, 2, and 3 while watching each voice's decoded musical note, frequency in Hz, waveform/gate byte, pulse-width duty percentage, and ADSR nibbles. Flip on Override .SID Filter Live to take manual control of the Low-Pass, Band-Pass, and High-Pass filter cutoff and resonance over any playing .sid tune—and click Export .WAV to save a 44.1 kHz 16-bit PCM audio recording.

3. Hardware Bench Notes: Why 6581 and 8580 SIDs Cannot Be Swapped Blindly

While building the 6581 and 8580 filter models, we also made sure both tools cross-link directly into our Commodore 64 Machine Hub, SX-64 Executive Portable Hub, and Signal & Trace Visualizer. If you are diagnosing a C64 with missing or distorted audio on the physical bench, keep two critical hardware rules in mind:

  1. Pin 28 (VDD) Supply Voltage Trap: The original NMOS MOS 6581 requires +12 V DC on Pin 28 (with +5 V logic on Pin 25), whereas the HMOS-II MOS 8580 / 6582 requires +9 V DC on Pin 28. Plugging an 8580 into an unmodified 12V longboard C64 socket will overheat and destroy its analog output stage.
  2. Pins 1–4 (CAP1A/B & CAP2A/B) Filter Capacitors: The 6581 uses 470 pF caps across Pins 1–2 and Pins 3–4, while the 8580 requires 22 nF (223 code — check it in our Resistor & Capacitor Calculator). Fitting the wrong cap values shifts the cutoff frequency out of range.

Ready to test your ears—or your speakers? Jump straight into the C64 WebAudio SID Synthesizer, drop your favourite chiptunes into the .SID File Player & Header Editor, or check out the step-by-step walkthrough in Module 08 of the How-To & Bench Tools User Guide!

Share: 𝕏 f in

Comments (0)

No comments yet. Be the first to comment on Smiggy's article!

Leave a Comment

Theme Palette

Default Dark
High-contrast dark
Amber Terminal
Monochrome amber
Matrix CRT
Phosphor green
Workbench Light
Clean light mode

Audio & Display

Relay Click Sounds Web Audio API — soft mechanical clicks
CRT Scanline & Flicker Pure CSS overlay effect

System Info

Customization Panel Theme preference, audio FX, and CRT overlay settings are saved to your browser's localStorage and persist between visits. No cookies or server-side storage is used.
Keyboard Shortcuts Press Esc to close this panel. Use the header moon/sun icon to cycle themes.