Live Coding

Live Coding: My First Breakbeat in Strudel

#strudel#tidal#rhythm

I’ve been dipping into live coding music, and Strudel — a JavaScript port of TidalCycles — is a great entry point because it runs entirely in the browser. No install, and I can embed a playable version right in this post.

The simplest possible loop

Everything in Strudel is a pattern. Here’s a four-on-the-floor kick:

sound("bd*4")

bd is the bass drum sample; *4 repeats it four times per cycle. Press play below and you’ll hear it. Try editing the pattern live:

strudel — interactive, press play open in strudel.cc ↗

Adding a backbeat and hats

Now layer a snare on beats 2 and 4, and some off-kilter hats using stack:

strudel — interactive, press play open in strudel.cc ↗

The ~ is a rest. gain(0.4) pulls the hats back so they sit under the kick. Already this is a recognisable beat.

Not everything runs in the browser

Some of my experiments are in Sonic Pi or on hardware, which can’t be embedded as a live REPL — so those get posted as recordings instead:

Late-night ambient jam Sonic Pi

Note: drop the actual audio file at public/audio/example-jam.mp3. The player is set to preload="none" so it costs nothing until played.

That’s the whole workflow — embed a REPL when the tool is browser-native, attach a recording when it isn’t.