A visualizer reacts to the music. Here the rows are the music.
Murmur runs a Wolfram cellular automaton and plays it as it scrolls: each row you see is the row you hear, the same event. Quantizing to a scale is the trick that keeps even rule 30 listenable.
A music visualizer is always a step behind. The audio plays, an analyser reads it, and bars jump in response. The picture is a reaction to the sound, which means you can never quite point at the thing that caused a given note. Murmur closes that gap by refusing to have two things in the first place. The pattern scrolling down the screen isn't reacting to the melody. It is the melody, drawn.
One rule, then everything
The engine underneath is an elementary cellular automaton, Wolfram's rules 0 through 255. You have a row of cells, each on or off. To compute the next row, you look at every cell together with its two neighbors, three cells, eight possible patterns of on and off. The rule is just a lookup: for each of those eight patterns, is the cell below alive or dead? Eight yes/no answers pack into an 8-bit number, and that single number, 0 to 255, is the entire program. Rule 90 draws a Sierpinski triangle. Rule 110 is Turing-complete. Rule 30 looks like static and is used as a random number generator. That such range falls out of eight bits is the reason these things have posters made of them.
Murmur advances one row per tempo tick and draws top to bottom, like a piano roll scrolling past. The twist is what happens the instant a row is computed: every live cell in it triggers a note. Not on a separate audio clock that hopes to stay lined up with the animation, on the same event. The row is calculated, the row is drawn, the row is sounded, in that one tick. There is nothing to drift out of sync because there is only one timeline.
Why it doesn't sound like static
Here is the part that took the actual thinking. If you map a cell's column straight to a frequency, almost every rule turns into noise, and a chaotic rule like 30 is unbearable. The fix is to never let a cell pick an arbitrary pitch. Each column maps to a scale degree, and you choose the scale (major, minor, pentatonic) and the root note. So a live cell can only ever trigger a note that belongs in the key. Chaos in the automaton becomes a busy melody instead of a car alarm, and calm rules become sparse, pretty phrases. Quantizing to a scale is the one decision that turns "nudge a rule bit and hear it change" into something pleasant rather than punishing.
The sound itself is pure synthesis, no samples anywhere. Every note is a Web Audio
OscillatorNode shaped by a GainNode envelope, and all the voices sum through a shared
DynamicsCompressorNode so a row full of live cells doesn't clip. Zero audio files means the
repo has no assets to load and the timbre can later react to the automaton's own state.
The rule is the whole control panel
Rather than a wall of sliders, Murmur exposes the rule as its eight bits, eight toggles, one per neighborhood pattern. Flip one and the next row's shape and its notes both change on the spot, no restart. That is the single interaction that most directly shows cause and effect: small change in rule, visible and audible change in outcome. And because the rule, seed, tempo, scale, and root are all encoded in the URL, sharing a sound you found is sharing a link, not a paragraph of settings someone has to re-enter.
Try it
Open Murmur and press Play. A random rule starts scrolling and playing in the same breath. Flip one of the eight switches and listen to the next row shift. Then load the rule 90 or rule 110 preset, pick a scale you like, and hit Share to copy a link that reproduces the exact pattern and melody on any device.
This post is part of the build log: every app my automated factory ships gets written up here, honestly. Browse everything at apps.charliekrug.com. Comments are open below.
Loading comments…