Programming Music
Instead of a piano keyboard, let's use a computer keyboard for coding music.
As a programmer, I love seeing an innovative approach to established paradigms of how things should be.
This is not the first time this has been made. Well, it is, but there was a similar approach to music in the early 80s called MOD. Born in the late 1980s on the Commodore Amiga, it was itself a hacker’s answer to limited hardware. You had a few sound channels, a set of samples stored in memory, and a vertical grid where time advanced in rows much like an Excel sheet of music. Each cell told the machine what to play, how to play it, and when to stop.
Something like:
C-3 01 20
--- -- --
E-3 02 A0Notes, instrument numbers, and effects. Every column, every row was tightly packed data telling the sound chip what to do. It was deterministic, constrained, and brutally efficient. Every byte counted. Every row meant something. The composer was half musician, half assembler programmer. A MOD file wasn’t just a song; it was an instruction sheet for sound, and I loved it. To this day, I love 8bit music.
I remember hours spent listening to MOD music using FastTracker II. There’s a whole post about that legendary player.
Enough about MOD and old school music formats. Let’s look at Strudel.
Strudel, at its core, is the JavaScript reincarnation of TidalCycles. It runs entirely in your browser with no installation, no compilation, no setup headaches, unlike TidalCycles. You open a tab, write a few lines of code, and sound emerges. Its design feels lightweight but conceptually dense. You’re not writing imperative code that “plays” a note; you’re defining patterns, rules, and transformations that unfold over time. Time itself becomes a variable, a playground. Its syntax can be cryptic at first, like any new programming language, but as soon as you “get it,” it becomes second nature to use.
Now, there are issues. Browsers are imprecise timekeepers; JavaScript timers jitter, and latency can vary across devices. Also, you get synths built from oscillators, samples, filters, and the creative limits of JavaScript’s Web Audio API. It sounds good, but could be better.
Sonic Pi, on the other hand, descends from a different lineage. Originally conceived as an educational project for the Raspberry Pi, it grew into a fully fledged live performance environment.
Sonic Pi is a desktop app. It connects directly to SuperCollider, a veteran sound synthesis engine that powers serious digital instruments. That link gives Sonic Pi a richness Strudel can’t yet match: complex synthesizers, modulated effects, MIDI integration, network sync, and rock-solid scheduling. Its loops are threaded through a scheduler that guarantees temporal precision, even while you rewrite them on the fly. It’s less ephemeral than Strudel, more grounded, more mature.
Strudel treats time as a pattern to be reshaped, where everything is data, everything is transformable. Sonic Pi treats time as flow or something to be looped, synchronized, stretched, but always flowing forward.
They’re not rivals. They’re parallel evolutions in the same ecosystem. Strudel for immediacy, Sonic Pi for depth. Together, they remind us that code is not just logic. When we type, we don’t just command a machine, we compose, we improvise, we listen. Strudel and Sonic Pi are proof that sometimes, the most elegant code doesn’t just print “Hello, world.”
There is a collection of Strudel songs on GitHub for you to tryout and enjoy. And if you would like to save any music to your local drive, use warm.strudel.cc, which has an export function. But I found that it has a tendency to crash if you are exporting long songs. There is a Python script on BarnLab’s GitHub that can do that.


