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. One year later, I had one.
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.
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.