Mario Schallner
Building unusual systems at the intersection of low-level engineering and creative computing
Back to speakersSID-GPT: AI-Generated Commodore 64 Music with a Pure Zig Transformer Engine
What happens if you train a transformer not on text, but on the raw hardware state of a 1982 sound chip?
SID-GPT is a language model that generates Commodore 64 chiptune music by predicting the SID chip's register values frame-by-frame. Instead of producing MIDI or symbolic notes, the model directly outputs the 25 SID registers at 50 Hz, learning the behavior of oscillators, envelopes, filters, and classic tracker techniques from 52,000 songs in the HVSC music archive.
The training pipeline renders thousands of .sid files through zigreSID, extracting frame-accurate register streams that become the model's token sequence. The model itself is a 271-million-parameter LLaMA-style transformer trained in PyTorch - but inference runs in a pure Zig engine with SIMD vectorization, Q8 quantization, and a custom binary weight format.
The project demonstrates that a hand-written Zig inference engine can efficiently run transformer inference for autoregressive token-by-token generation: no ML framework, no runtime dependencies, and performance tuned specifically for small-model CPU inference.
Generated output is converted back into the SID ecosystem via a custom Zig-based exporter that delta-compresses register frames and injects a hand-written 6510 machine-code player routine, producing .sid files that run on original Commodore 64 hardware. The resulting system combines a Zig-based data pipeline, transformer inference engine, SID chip emulator, playback engine, SID exporter, and a web-based SID-GPT Studio for prompting and exploring the creative space - implemented as five Zig binaries with zero external runtime dependencies.
In this talk we’ll explore:
- How to represent a sound chip as a token language
- Building a full ML data pipeline with Zig tools
- Writing a high-performance transformer inference engine in Zig
- Prompting the model with fragments of existing SID music to generate new pieces in the same style
- Exporting AI-generated music back into the SID ecosystem, down to 6510 machine code
- Live demos of AI-generated chiptunes
If you've ever wondered what happens when LLMs meet the demoscene, this talk is for you.
About the speaker...
Mario Schallner started programming in 6502 assembly on a Commodore 64 and never quite moved on. Over 25 years later - through Intel assembly, C/C++, Go, and now Zig - he still enjoys building unusual systems at the intersection of low-level engineering and creative computing. His projects range from experimental games and AI systems to microcontroller agents and distributed infrastructure. He previously spoke at Zigtoberfest 2025 about movy, his Zig terminal rendering engine. https://m64.io/