I was 13 when my first computer showed up: a Commodore 64. Beige, heavy, slightly warm after ten minutes, and β the part that really got me β it could make music. Not beeps. Music. The chip responsible is called the SID, and it has owned a corner of my heart ever since. Years later, as a computer science student, I said thank you the only way I knew how: I wrote an emulator for the C64βs processor, the MOS 6510, in C. I wrote real love letters back then too, by the way β this was just the only one that compiled. π
Blame Ivo
Before all that, there was Ivo. Sixth grade, the first friend of mine who owned a computer, and he would not stop talking about his C64. I genuinely did not get it. How is that supposed to be fun? You write something, it stays inside the box, and nothing in the actual world moves an inch. Where exactly is the payoff?
Then he invited me over, and the thing was playing the Ghostbusters theme. Hit the space bar and it yelled Ghostbusters! right back at you. I went home, returned with my cassette recorder, taped the song off the TV speaker and played it everywhere for weeks.

Point taken. I needed one of these. A year later, my parents had bought a C64 for the family β along with a 1541 floppy drive and a pretty cool monitor. π
Every Year, a New Trick
And it kept going. Axel F. Ten-second digitized samples β Material Girl, Born in the U.S.A., Kung Fu Fighting β coming out of a machine that had no business doing any of that. Then the experiments started: a home-made digitizer, a speech synthesizer, later the whole circus again on the Amiga with more memory, cleaner sound and actual stereo. None of it would raise an eyebrow today. Watching it arrive, year by year, was still very exciting.
A Whole C64, Squeezed Into One File
So this one is a heart project: a SID player that lives in a single HTML file.
Open it, drag a ‘*.sid’ file in, and a complete Commodore 64 sound path boots up inside your browser: a 6510 CPU running the original music routine, the SID with its oscillators, ADSR envelopes and that wonderfully moody filter, CIA timers, raster timing, the works. No plugins, no install, no ROMs, no excuses. Oscilloscopes wiggle, the spectrum dances, and a hex dump of the SID registers flickers along like it’s 1987.
256 Opcodes and One Beloved Bug
The emulator was built together with Claude Code (Fable 5.1). I brought the nostalgia, the chip lore and the stubbornness about details; Claude brought the patience to write all 256 opcodes of the 6502, including the “illegal” ones that demo coders used anyway. We even reproduced the SID’s famous ADSR delay bug on purpose, because a SID without its bugs is like a C64 without a datasette: technically better, emotionally wrong.

Image by Konstantin Lanzet – CPU collection, CC BY 3.0
That’s the 6510, the C64’s brain: a 6502 with an extra I/O port bolted on, ticking away at roughly one megahertz. It runs the music routine, pokes a handful of registers fifty times a second and then, frankly, gets out of the way. Because the chip that actually makes the noise sits a little further along the board: the MOS 6581, better known as the SID, the Sound Interface Device. Its designer, Bob Yannes, was a synthesizer nerd who wanted a real synth on a single chip β and later went on to co-found Ensoniq, so he clearly meant it. Three voices, four waveforms each, an ADSR envelope per voice, ring modulation, hard sync and an analogue multimode filter with enough manufacturing tolerance that no two SIDs sound quite alike. In a home computer. In 1982. Most machines of the day made do with beeps; the C64 shipped with a synthesizer. If the 6510 is the musician reading the score, the SID is the instrument β and this whole project exists because of how that instrument sounds.

The Tune That Started All of This
And since you’re asking (you weren’t, but still): my favourite song of all time is the title tune of Krakout by Ben Daglish. That filter sweep at the start? That’s where my musical taste was born, and it never fully recovered. You’ll find it in the High Voltage SID Collection (search for “Krakout”, “Ghostbusters”, “Axel-F”, …). Load it, pick subtune 1, turn it up. You’re welcome!
For the Curious: What Actually Runs in That Tab
Nothing in a ‘*.sid’ – file is a recording. No samples, no instrument bank, no wavetable I lovingly prepared in advance. What’s in there is a program β i.e. the music routine Ben Daglish wrote back in 1987 β and when you hit play, your browser starts pretending to be a Commodore 64 so that the program can run, one instruction at a time, exactly like it did back then.
The loop is gloriously dumb in the best possible way. The audio thread asks for 128 samples. For each one, the emulator advances the C64 by 22.34 clock cycles β PAL ticks at 985’248 Hz, 44.1 kHz audio refuses to divide into that neatly, so the leftover fraction is carried to the next sample and the pitch never drifts. During those cycles a 6510 CPU executes real code, two CIA timers count down, the VIC raster counter rolls on, and the SID produces a fresh 12-bit value per voice *per cycle* β roughly a million per second. All of those get averaged into one number, three voices are mixed, the filter runs once, and out comes a single sample. Do that 44’100 times a second and it sounds like 1987.
That’s around 22 million emulated cycles per second of music, in JavaScript, and a modern machine barely notices. Rendering a minute of Krakout offline takes 2.4 seconds here β 25Γ faster than real time. The player spends that headroom on seeking: click into the progress bar and it silently replays the tune at speed, a minute of music in about a second. All of it runs in an AudioWorklet, so the emulation sits next to the audio hardware instead of fighting the user interface for attention.
The whole machine is about 1’600 lines of JavaScript. A 6510 with all 256 opcodes and exact cycle counts, undocumented instructions included β demo coders used them, so a player that skips them simply crashes. A SID with oscillators, the noise LFSR, envelopes with that famous ADSR delay bug, ring modulation, sync, combined waveforms and the moody analogue filter. No original ROMs: the KERNAL routines the tunes call are answered by a stand-in. No dependencies, no code lifted from other emulators β everything written from the chip behaviour the C64 scene has documented publicly for four decades. The build squeezes the lot into a single 140 KB HTML file, and 69 tests make sure the CPU agrees with the cycle tables and the SID gets things wrong in exactly the right places.
For Ben Daglish (1966β2018)
Krakout was one of well over a hundred soundtracks he wrote. The Last Ninja, Deflektor, Trap, Auf Wiedersehen Monty together with Rob Hubbard β through the eighties Ben Daglish turned out music for the C64, the Spectrum and the Amstrad at a pace that looks impossible today, for a while under the glorious banner W.E.M.U.S.I.C., the partnership he formed with programmer Tony Crowther, an old schoolmate. Three voices. A few kilobytes. Melodies people still hum four decades later.
What I only learnt much later is that he was a proper musician away from the chip as well β flute, guitar, penny whistle, keyboards, whatever the song asked for β and that he kept playing those old game tunes live, with a violinist, with bands, in front of rooms full of grown-up children at retro gatherings. He was diagnosed with lung cancer in 2015 and died on 1 October 2018, aged 52. Much too early for someone who had quietly written the soundtrack to so many childhoods.
If you want to hear how far that Krakout melody can travel: Tomasz MoΕko transcribed it for pipe organ and plays it in a church.
A tune written for a chip with three voices, pouring out of a few thousand pipes. That may be the highest compliment a piece of chip music can receive, and it says everything about what Ben Daglish actually was: a composer, who happened to have a very small orchestra.
Thank you, Ben. This one is for you.
Related Posts: commodore 64, Ode to a Legend of the Eighties β The Commodore 64
