What was on the desk
One Commodore 64. One TV set as monitor. One cassette drive (or, with luck, a 1541 floppy). One MIDI cable to a synthesizer. One stack of Commodore Magazine issues. That was the entire toolchain.
Keeps this page in sync as the body changes. Pause it any time for a quieter view.
Path /people/c64-midi-interface
Last refresh never
Work · Commodore 64 · Switzerland · ~1984-1985 · age 13 · first programming
Age 13. A Commodore 64. No reference documentation, no books — only Commodore Magazine and pages of assembly hex code typed in by hand. From those sources alone, this body wrote a working MIDI interface with an interrupt-service handler in 6510 assembly called from a BASIC host program. Self-taught in the most literal sense: BASIC was the first language; assembly was the second; the C64 hardware was the textbook. The earliest load-bearing piece in the body of evidence and the place where this body's relationship to programming first crystallised.
What 'self-taught' actually meant in 1984
In a Swiss household in 1984, computing reference material was what arrived on the news-stand once a month. Commodore Magazine printed long listings — sometimes BASIC, sometimes raw assembly hex — and the way you got them onto your machine was: type them. Every byte. With no syntax highlighting, no auto-complete, no error checker. A typo meant the program wouldn't run, and finding the typo meant re-reading the page against the screen until the eye caught it. The 13-year-old who wrote this MIDI interface spent days doing that, not because of dedication, but because there was no other path. The relationship to programming this body still carries — every byte matters, every instruction is yours to own — comes from those afternoons.
One Commodore 64. One TV set as monitor. One cassette drive (or, with luck, a 1541 floppy). One MIDI cable to a synthesizer. One stack of Commodore Magazine issues. That was the entire toolchain.
The user port on the back of the C64 was the door to the outside world: 8 bidirectional data lines, control signals, and access to the CIA (Complex Interface Adapter) chip's interrupt machinery. MIDI runs at 31.25 kbaud, a non-standard rate the C64's hardware UART couldn't generate cleanly — so the interface was hand-built around the CIA's shift register and timer, with the timing recovered in software at the byte boundaries.
Why an interrupt handler
MIDI's 31.25 kbaud means a byte every 320 microseconds. BASIC on a 1 MHz 6510 cannot poll fast enough to catch bytes at that rate without dropping events. The only way to capture incoming MIDI cleanly was to handle it in an interrupt-service routine in assembly: when the CIA signalled "byte available," the CPU would jump to the handler, read the byte, push it into a ring buffer, and return — all in less than 320 microseconds, leaving BASIC free to run musical-application logic on top of the buffered stream.
Writing that kind of code at 13 with no documentation meant: figure out where to install the IRQ vector ($0314/$0315 on the C64), how to chain to the kernel's existing IRQ handler so the system kept running, what the CIA's interrupt-control register bits meant, and how to ring- buffer in the zero page for fastest access. The magazine articles named the tools; the integration was on the 13-year-old.
Two pieces fit together: BASIC was the framework; the assembly handler was the engine.
This is the same architecture this body would commit to again and again in later decades: a fast inner loop in a low-level language, an expressive outer surface in a higher-level one, and a clean buffer or message contract between them. BMCPU at the bottom + BML on top ( 2000 thesis ); QuarkXPress runtime at the bottom + Virtual DOM on top ( 2000-2005 ); FastAPI + Neo4j at the bottom + Next.js + the curated page you are reading on top ( now ). The shape was named on a Commodore 64 at 13.
Three convictions seeded here