the fly arcade · be the beat · the song · fly band · fly typewriter ·
A fly brain sings
A male fruit fly courts by buzzing one wing in pulses. First, a real fly. Then a simulation of the whole male nervous system, built from its complete wiring diagram, with the neuron that commands the song switched on. Press play and watch its brain light up: every dot is one of its neurons firing, where it sits in the fly. Or make the whole body play: fly band, where you live-code the instruments, or let it write: fly typewriter.
A real fly singing (recording)
26 song pulses in 2 s, about one every 42 ms
Simulated fly: the song command neuron pIP10 switched on
7,246 wing motor neuron spikes in 2 s
The same, with the wiring scrambled
3,256 spikes in 2 s
Real wiring, a different neuron pair switched on (DNg75)
4,578 spikes in 2 s
The wiring carries the courtship command to the wings, but not the beat: in this model the wing motor neurons fire hard, but not at song tempo.
How the simulated sound is made: every spike of any of the 67 wing motor neurons becomes one identical 2 ms click, in real time, at the same volume for all three. The recording is 2 s of a real male courting a female, from the open dataset of Steinfath et al. (2021), chosen by a fixed rule (the stretch where song fills the window and the quietest pulses are loudest) and filtered to 100-1000 Hz. The other neuron pair (DNg75) is the one whose response was nearest the middle of all 29 matched pairs.
What was done
A male fly courts a female by vibrating one wing, a song whose pulses come about 35-40 ms apart (Stern 2014; in the recording above, about 42 ms, within the range reported across strains and temperatures). A pair of neurons called pIP10 is known to command it. Here, both pIP10 neurons were switched on for 2 seconds in a simulation of the whole male nervous system: the MaleCNS v1.0 wiring diagram (166,700 neurons; data public June 2026, Cell paper September 2026), with every neuron modelled as a leaky integrate-and-fire unit using the parameters of Shiu et al. (Nature, 2024).
Before any of this, the simulator was checked: it reproduces the published model spike for spike, it reproduces the published fruit-fly feeding result on the older FlyWire connectome, and that result replicates on MaleCNS (the proboscis motor neuron fires in 30 of 30 trials). The weight per synapse (0.275 mV) was chosen by a rule written in advance.
The four tests, written down before running them
| Test | Counts as yes if | Result | Yes? |
|---|---|---|---|
| Does the signal reach the wings? | ≥ 90% of trials with a wing motor neuron spike | 100% of 30 trials; 7,119 spikes per trial | yes |
| Is it specific to pIP10? | above the 90th percentile of 29 output-matched neuron pairs | above all 29 | yes |
| Is it specific to the real wiring? | above 95% of 30 scrambled brains | above all 30 | yes |
| Does it fire at song tempo? | autocorrelation peak at 30-45 ms, above chance, in ≥ 2/3 of trials | FAIL (peaks at [10, 11, 12, 13, 18, 21] ms) | no |
Exploratory (not pre-registered)
These were looked at after the four tests had been read, so they describe the data; they are not tests. Of all the spikes in the brain during a trial, 5.8% land on the wing motor neurons when pIP10 is switched on. That share is ordinary for the matched pairs (median 6.0%, highest 14.7%; pIP10 is above 41% of them), and it falls to 2.4% in the scrambled brains. pIP10 switches on more neurons in total than the average matched pair (5,135 against 3,807 per trial), so its wing spike count is at the top of the pairs while its wing share is not.
The strongest rhythm in the wing motor neurons repeats every 10-25 ms in 70% of real-wiring trials and 93% of scrambled-brain trials. Because scrambled brains show it at least as often, that rhythm does not come from the real wiring.
Figures
The pre-registration, as written before the experiment
# fly-song — pre-registration
Written 2026-09-10, **before any song-circuit simulation was run.** Anything in the
results that is not listed here is exploratory and will be labelled that way.
## Question
In a connectome model of the male fly's whole nervous system, does switching on the
courtship command neuron pIP10 drive the wing motor neurons, and do those motor
neurons fire at the tempo of real pulse song?
Real *D. melanogaster* pulse song: "this inter-pulse interval is approximately 35 to 40 ms"
(Stern 2014, BMC Biology 12:38, Background).
## Model (fixed before this document)
- Graph: MaleCNS v1.0, 166,700 neurons, 24,644,174 signed connections (`malecns_amine+0`).
- Neuron model: Shiu et al. 2024 LIF, reproduced spike-for-spike from the upstream
PyTorch port (`engine/tests/test_exact_vs_upstream.py`).
- **Weight scale:** chosen by the Phase 0 rule, fixed before any Phase 1 job: the largest of
{1x, 0.75x, 0.53x} × 0.275 mV at which (a) MN9 fires in ≥ 90% of 30 sugar trials and
(b) fewer than 5% of all neurons fire at all (no whole-brain runaway). The other scales are
reported as a sensitivity analysis.
## What was verified in the wiring before simulating
pIP10's ten strongest downstream targets (by synapse count) include dPR1, TN1a (g, i, d, h)
and vPR9 (a, b, c): the song pathway reported in the literature. This is a property of
the data, not of the simulation.
## Stimulus
Both pIP10 neurons (bodyIds 11116, 523998), Poisson drive at 50, 100, 150 and 200 Hz, 2000 ms,
30 independent seeded trials per rate. **150 Hz is the primary rate**; the others give a
dose-response curve.
## Readouts
- `wing_mn`: the 67 motor neurons annotated subclass `wm` (wing, MANC nomenclature).
- `song_pathway`: 52 neurons of types pIP10, vPR6, dPR1, vPR9, TN1a*, vMS12*.
- Collateral column: number of neurons anywhere in the nervous system that fire at all,
per trial. A "song" produced by lighting up half the brain is not a song circuit.
## Arms
| Arm | What is driven | Graph | Unit (effective n) |
|---|---|---|---|
| **A** | pIP10 L+R | real | trial (30 per rate) |
| **B** shuffled brain | pIP10 L+R | 30 independent shuffles (`engine/shuffle.py`), 1 trial each, 150 Hz | shuffle (30) |
| **C** random pair | an L+R pair of one other excitatory descending-neuron type, each within 0.85-1.15x of pIP10's output synapses | real | neuron type (26 types; all 26 run, 3 trials each, 150 Hz) |
- **B preserves** each neuron's in- and out-degree, output synapses and sign, and the
connection totals between every pair of superclasses (267 blocks); it **destroys** which
cell connects to which. Invariant violations are counted per shuffle and must be 0.
- **C dose** is matched on the observable: stimulated neurons follow their Poisson drive
exactly (no refractory period), so delivered drive = stimulus spikes × output synapses.
Gate: ratio to arm A within 0.85-1.15 (`armcard`, `ref=` arm A).
- C is read as a **percentile rank** of pIP10 among the matched pairs, not as a mean
difference.
- *Clarification, 2026-09-10, before any song simulation:* the implemented rule
(`scripts/make_phase1_table.py`) picks, per descending-neuron type, the left and the right
neuron closest to pIP10's per-neuron output, and keeps the type if the **pair's** summed output
is within 0.85-1.15x of pIP10's pair (15,291 synapses). That gives **29 types**
(ratios 0.855-1.139), not the 26 counted per neuron above. All 29 are run.
## Endpoints
1. **Reach.** Share of arm-A trials with at least one wing-motor-neuron spike, and mean
wing-motor-neuron spikes per trial. "It reaches the wings" requires ≥ 90% of trials at 150 Hz.
2. **Specific to pIP10.** pIP10's wing-motor-neuron spikes vs the 26 arm-C types. "Specific"
requires pIP10 above the 90th percentile.
3. **Specific to the wiring.** Arm A vs the 30 shuffles. "The wiring matters" requires arm A
above 95% of shuffles.
4. **Tempo.** Autocorrelation of the pooled wing-motor-neuron spike train, 1 ms bins, per
trial, lags 10-100 ms. Compared against surrogates with the same number of spikes placed
at random times within the trial (1,000 per trial). "Fires at pulse-song tempo" requires
the autocorrelation peak to fall in 30-45 ms and exceed the 99th percentile of surrogates
in at least two-thirds of trials.
- **Power condition:** needs ≥ 200 wing-motor-neuron spikes per trial. Below that, endpoint
4 is reported as *not measurable*, never as *absent*.
## What a pure artifact would look like (written before looking)
- LIF neurons under Poisson drive fire irregularly; the autocorrelation is flat apart from a
dip below ~3 ms (the 2.2 ms refractory period). Lags below 10 ms are excluded for this reason.
- The model's only built-in timescales are 0.1 ms steps, 1.8 ms synaptic delay, 5 ms synaptic
decay and 20 ms membrane decay. Excitation-inhibition loops can therefore ring at roughly
10-25 ms. A peak there is a **property of the model's time constants, not song**, and will be
reported as such, which is why the tempo window is 30-45 ms.
- A rhythm that also appears in the shuffled brain (arm B) at the same lag is a property of the
neuron model, not of the wiring.
## What goes on the site, either way
- Endpoints 1-3 pass, 4 passes: "Drive one pair of neurons in the connectome and the wing
motor neurons fire at pulse-song tempo. Scramble the wiring and it stops."
- 1-3 pass, 4 fails with power: "The wiring carries the command to the wings, but not the
beat. Real flies' song rhythm needs cell properties this model does not have." The sound
is still made from the model's spikes, and the page says it is not song-shaped.
- 1 fails: "In this model, pIP10's signal does not reach the wing motor neurons." That is also
a finding about how much a wiring diagram alone can do, and it gets said plainly.
Credits
- MaleCNS v1.0 connectome: Janelia FlyEM and Google Research, CC-BY 4.0 (Cell, 2026).
- Neuron model: Shiu et al., Nature 634:210 (2024). Validated against the eonsystemspbc/fly-brain PyTorch port.
- FlyWire 783 connectome and cell-type annotations, used for the validation checks.
- Pulse-song interval: Stern, BMC Biology 12:38 (2014).
- Related work: Fly Lab (github.com/Apolotary/fly-lab, MIT), which also turns simulated MaleCNS motor circuits into sound, as music for Ableton Live. fly-song differs in driving the whole-CNS model from pIP10 and testing it against scrambled brains and matched neuron pairs.
- Real song recording: Steinfath et al., eLife 10:e68837 (2021), data doi:10.25625/8KAKHJ (CC0 1.0), recording 161118_1114, 73.90-75.90 s, microphone 0.