Music as Code
What if you could type a line of text and hear a beat? That is how live coders make music.
What if you could type a line of text and hear a beat? That is how live coders make music.
Music starts with rhythm, and rhythm is just a short pattern that repeats. This grid is a mini drum machine holding a real beat. Press play, then click squares on and off to change it.
This grid is a drum machine: eight steps, looping. Every beat you have ever danced to is some pattern like this, repeating under the music.
Live coders skip the clicking. They describe the pattern in words: bd is a kick, hh a hi-hat, sd a snare, and ~ is a rest. Edit the code and watch the grid follow.
This is close to how Strudel and its ancestor TidalCycles actually work. A line like sound("bd hh sd hh") really does play that beat. You just wrote code.
Here is where code beats clicking. Because the pattern is text, you can transform it with a single word: fast doubles it, rev plays it backward, double repeats each hit. Stack transforms and hear it change.
Doing "reverse this rhythm and play it twice as fast" by hand is fiddly. As code, it is two words. That power is why musicians perform live by typing.
One pattern is a beat. Stack several, drums plus a bassline plus a melody, all looping together, and you have a song. Toggle each layer on and hear the track build.
Performances where artists project their code and build music live are called algoraves. The rule of the scene: show your screen. The code is part of the show.
You turned text into rhythm, melody, and a stacked song. This is live coding: music written as patterns you can change while it plays. No piano needed, just a few lines of code. Now open the real thing and jam.
A beat is a short pattern of hits and rests that repeats. Draw a row of steps and you have described a rhythm.
Live coders write patterns as words: "bd hh sd hh" means kick, hat, snare, hat. The text IS the music.
Because it is code, you can speed it up, reverse it, or repeat it with a single word. That is hard to do by hand.
Layer a drum line, a bassline, and a melody, each one a pattern, all looping together. Stacked patterns become a song.
Put your new knowledge into practice!