Build notesAI & music
An instrument wired like a fruit fly.
I asked Codex how you’d build something around a fly’s brain, and within the hour it was an instrument. How Murmur works, what’s real about it and what isn’t, and how it came to run in your browser.

Murmur A simulated fly brain, playing in your browser.
In September I came across Fly Review by Ramp Labs, a demo built on a simulation of a fruit fly's brain. I wanted to build something around a fly brain too. Before deciding what, I asked Codex how I'd even do it.
Within the hour I had an instrument. It's called Murmur, and you can play it here. The whole simulation runs in your browser.
One thing first: this isn't a fly brain. It's a computer model built from a fly's wiring diagram, and the music follows rules we wrote.
The wiring diagram
In 2024 the FlyWire project published the wiring of an entire adult fruit fly brain: 127,400 neurons and about 14.7 million connections between them. The same year, Philip Shiu and colleagues built a simple simulation on top of it. Every neuron in their model behaves the same way, and only the wiring differs. Even so, it predicted how real parts of the fly's brain respond, including its sense of taste.
Their code and data are public. So you don't need to scan a brain or train anything. As Codex put it in its first answer, the interesting part is deciding what the brain receives, and what its activity means.
A little brain
I said "go for it", and 22 minutes later I had a lab running on my laptop.
It's one experiment from the paper. You give a signal to 21 neurons that sense sugar, the simulation runs for a fraction of a second, and you watch MN9, a motor neuron involved in feeding. With the default settings, MN9 fires at 60 Hz.
Then you test the connection. The lab runs the same signal again, with the sugar neurons' outgoing connections cut. They still fire, but nothing downstream does, and MN9 drops to 0 Hz.

Codex suggested a next step: a small 2D world with a virtual fly that finds food. I didn't want to do that. I asked what it could actually do.
An instrument
The honest answer was that it turns simple stimulation into patterns of activity. It can't understand anything. But that activity could drive something else, like sound.
So I asked: "could we turn it into an instrument? think brian eno. javascript/procedural music". I asked for its own page and an exceptional bar: particles, or the film Arrival.
Eight minutes later Murmur was playing. When you press play:
- it gives a signal to the 21 sugar neurons;
- it simulates 300 milliseconds of the brain and records which neurons fire;
- it slows that recording right down, so 300 milliseconds becomes about a minute of music;
- the overall activity sets a low drone, and neurons further downstream trigger bells and plucks, on notes chosen to work together;
- the next burst is prepared while you listen.
Around it, a ring of 24,000 particles moves with the activity and the sound, like ink in water.
The fly isn't imagining music. We built an instrument that plays its simulated electrical activity.
That's Codex, explaining it to me. We chose the instruments and the rules. The brain supplies the variation.
That first version is still here, and you can play Murmur 001. Each phrase starts from scratch, with no memory of the last one.
A duet
Next I asked what would make it 100 times better. The answer was to give it memory, and let the music change the brain's next response. I said "do all of that", and fifteen minutes later Murmur 002 had:
- a brain that carries on between phrases, instead of starting fresh each time;
- feedback: how loud, bright and busy the music is feeds back into the brain;
- a ring you can play: touch it to stimulate one of three groups of neurons, hold to keep going, or Shift-touch to quiet a pathway for 15 seconds;
- remembered motifs, slow changes of harmony and deliberate rests;
- a way to compare the same moment, played by the fly's wiring, by the same wiring shuffled, and by random signals.
One thing you can hear is real. The bells and plucks only sound when neurons beyond the sugar neurons fire. Disconnect the circuit and they stop, leaving only the drone.
The comparison is a listening test, not proof of anything. In the run below, the fly's wiring produced 3,253 spikes downstream and MN9 fired at 96.7 Hz. Shuffled, that fell to 822 and 0 Hz. Random signals matched to the fly's average gave 3,281 and 133.3 Hz, with different timing.
What's real and what isn't
The wiring is real: it's the published FlyWire data. The rest is a model and a piece of music.
- The model is simple. No learning, no body, and every neuron is the same apart from its connections.
- I wrote the brief, and Codex wrote the musical rules. The three groups on the ring and their names are artistic choices, not biology.
- The "listening" is a few measurements of the sound, not hearing.
- The musical memory is designed. The fly isn't remembering anything.
- The ring is artistic. Its arcs show the brain responding, not paths between real neurons.
Moving it here
The original ran on my laptop: a Python server using Brian2, a simulator for neuroscience. Each 300 milliseconds of brain took about 6.4 seconds to compute and 1.7 GB of memory. Running that on a server for everyone would have meant gigabytes of memory per visitor.
To put it on this site, I asked Claude Code to port the simulator to JavaScript. It now runs in your browser, and matches the original spike for spike in 54 of 54 test runs. Each phrase takes about 40 milliseconds to compute on my laptop, instead of 6.4 seconds, and everyone gets their own brain.
The catch is the wiring diagram itself: a 25 MB download the first time you press play, which your browser then keeps. Once it's loaded, the brain takes about 100 MB of memory.
You can play Murmur here, play the first version, or try the lab.
Credits
The connectome is from the FlyWire whole-brain connectome, public release v630, by the FlyWire Consortium, under CC BY-NC 4.0. Here it's re-encoded and compressed so it can run in a browser. The model follows Shiu et al. (2024), using their code and prepared data. The idea came from Ramp Labs' Fly Review. No Ramp code or artwork is used.
Thanks for reading.
Back to all notesI led the work, and AI helped along the way. Badge by AI Honesty Badge.