I Made a Fruit Fly Brain Compose Music. Here’s What Happened.

Published: 2026-09-18 • Updated: 2026-10-09 • Read Time: 8 Minutes

I hooked a digitized fruit fly connectome to an evolutionary music engine. What came out wasn't random noise; and it offers a glimpse into the future of biological computational substrates.

What happens when you connect a 8,192-neuron fruit fly brain connectome to a generative AI music system? See how biological neural wiring can compose structured music.

INTRO

I asked a fruit fly to make music.

I gave it a brain, a genre, and a simple instruction:

Make something that sounds good.

A few moments later, it had produced a piece of music.

FlyWire Composer Sample 1
FlyWire Composer Sample 2
FlyWire Composer Sample 3
FlyWire Composer Sample 4

Not random beeps. Not a translation of neuron spikes into notes.

Actual musical structure.

So naturally, the first question is:

How does a fruit fly know how to make music?

The short answer is: it doesn't.

But getting to that answer requires looking inside the machine.

Fruit fly brain

1. THE FLY

Fruit flies have no business making music.

They did not evolve to write melodies. They don't understand harmony. They have never listened to a house record and thought, "That kick needs more punch."

Their brains evolved for much more practical problems: seeing, moving, sensing their environment, finding food, avoiding danger, and surviving.

But underneath all of that is something fascinating: a huge network of interconnected neurons.

If you can reconstruct that network, you don't necessarily have to use it for the thing nature originally designed it to do.

And that gave me an idea.

What if I took the wiring diagram of a fruit-fly brain and dropped it into a completely different problem?

What if that problem was music?

2. THE BRAIN

The biological part of the system comes from FlyWire, a project that reconstructs the wiring of the fruit-fly nervous system as a digital connectome.

For this experiment, I used the FAFB v783 dataset and a working subnetwork of 8,192 neurons, including their real synaptic connections.

That gives the composer something very unusual: a real biological network rather than a conventional artificial neural network designed specifically for music.

The neurons are connected as a directed graph. Activity can propagate through that graph, and the resulting dynamics become part of the system's decision-making process.

But there was still a rather large problem.

The fly brain knows absolutely nothing about music.

I couldn't just connect the neurons to a synthesizer and wait for a hit record.

A neuron firing doesn't mean "play a C minor chord." Another neuron doesn't mean "put the kick on beat four." The biological network has no reason to understand any of those concepts.

So instead of asking the fly to understand music, I built a musical world around it.

3. TEACHING THE MACHINE WHAT MUSIC LOOKS LIKE

The composer needs a vocabulary before it can start exploring.

Part of that vocabulary comes from MIDI and MusicXML corpora.

  • MAESTRO v3.0.0 provides piano performances and musical relationships that help the system learn harmony, melody, voice leading, timing, and other symbolic musical structures.
  • Groove MIDI v1.0.0 provides human drum performances and the timing patterns that make rhythms feel less mechanical.

But MIDI alone has a limitation.

It can tell the machine about musical events, but it doesn't fully capture what a finished genre actually sounds like.

So I added something new.

Reference songs.

I can now place actual reference tracks into genre-specific folders and let the composer analyze them.

Instead of telling the program that House should have a particular rhythm or energy profile by hand, the system can extract characteristics from reference audio and build a compact representation of the genre.

It looks at things such as rhythm, bass activity, harmonic and melodic characteristics, density, arrangement, phrase behavior, and energy.

The result is not a pretrained audio-generation model.

It is a statistical fingerprint of what the reference music actually does.

4. NOW LET'S MAKE A SONG

This is where all the pieces finally meet.

Imagine the composer starting a new House track.

First, the FlyWire network becomes active.

Its activity influences decisions inside the composer: tempo, tonal choices, musical possibilities, and the directions explored during generation.

The system then begins producing candidate musical ideas.

Not one.

Many.

Motifs. Phrases. Chord progressions. Bass lines. Drum patterns.

Some sound promising.

Some sound terrible.

Most are somewhere in between.

And this is where the machine gets its second brain.

The Critic

Every candidate is judged automatically.

The critic looks at multiple dimensions of the composition, including harmony, melody, rhythm, phrase structure, form, tension, novelty, voice leading, learned musical fit, and; importantly; genre identity.

A technically pleasant piece that sounds nothing like the requested genre is no longer good enough.

The system has to make something that belongs somewhere.

Weak candidates are discarded.

Strong candidates survive.

Then They Evolve

The surviving candidates are mutated and evaluated again.

A phrase can change.

A bass pattern can move.

A drum accent can appear or disappear.

A chord can change.

And then the new version goes back to the critic.

Generate → Judge → Select → Mutate → Repeat

The process runs across generations, gradually searching for musical structures that satisfy the system's competing requirements.

5. THE MACHINE NOW LISTENS TO THE GENRE

This is one of the biggest changes in the newer version of the composer.

The reference songs don't simply sit in a folder as examples for a human to listen to.

The program analyzes them.

Their rhythmic fingerprints can influence actual note placement. Their energy profiles can influence how the arrangement develops. The reference information can also enter the FlyWire actor as additional context.

That means a House reference can influence the machine toward the rhythmic behavior, density, and energy patterns found in the House material it was given.

The same principle can be applied to other genres.

And this creates an important distinction.

The composer isn't simply being told:

"This is House. Now make House."

It is being given examples of what the target actually sounds like and extracting measurable characteristics from them.

The learned representation then becomes another influence inside the composition process.

Why This Matters for House

This became particularly important for House and French House.

Earlier generations could produce music that was musically coherent but felt more like lounge or generic electronic music than something designed for a dance floor.

The newer system puts much more emphasis on genre identity.

House harmony is held in more compact repeated phrases. The kick pattern is treated as a genre anchor. Claps and snares reinforce the backbeat. Offbeat hats and percussion can be guided by the learned reference rhythm. Bass movement is shaped toward a more recognizably dance-oriented groove.

The arrangement also matters.

A dance track needs more than the right notes. It needs movement: introduction, buildup, main sections, breakdown, and re-entry.

The newer arrangement layer therefore uses the learned energy fingerprint while preserving an explicit dance-floor structure.

6. SO... DID THE FLY ACTUALLY WRITE THE SONG?

No.

There is no tiny fruit-fly Mozart hiding inside the computer.

The fly brain isn't listening to the track and deciding whether it likes the chorus.

It doesn't understand House.

It doesn't understand chords.

It doesn't understand music at all.

And that's actually what makes the experiment interesting.

The connectome is being used as a biological computational substrate inside a much larger system.

The musical corpora provide learned symbolic relationships.

Reference tracks provide genre-specific statistical fingerprints.

Musical rules constrain the possibilities.

The FlyWire network influences the exploration.

The critic judges what comes out.

Evolution keeps the better ideas and changes them.

So the song isn't coming from the fly brain alone.

It emerges from the interaction between all of these components.

The fly doesn't know what music is.
It doesn't have to.

7. WHAT THIS EXPERIMENT ACTUALLY SHOWS

The experiment doesn't demonstrate that fruit flies are secretly musicians.

It demonstrates something considerably more useful.

A biological neural network can be reconstructed digitally and placed inside a computational environment completely different from the one it evolved for.

In this case, that environment is a music generator.

The interesting part is not that any one component can make music by itself.

The interesting part is what happens when they are connected.

  • FlyWire provides real biological topology and neural dynamics.
  • Musical corpora provide symbolic musical knowledge.
  • Reference tracks provide measurable examples of genre-specific sound and behavior.
  • The critic provides selection pressure.
  • Evolution searches through the enormous space of possible compositions.

None of those pieces is a complete composer.

Together, they can produce something that none of them produces alone.

8. DOES IT ACTUALLY SOUND GOOD?

This is where I have to be honest.

Not every generation is good.

Some are surprisingly convincing.

Others are repetitive, awkward, or simply miss the genre.

That's expected. The system is searching through an enormous musical space, and the critic is still only an approximation of human musical judgment.

This isn't Suno.

It isn't a professional producer.

And the goal was never to pretend that it is.

The goal was to answer a much stranger question:

Can the wiring of a biological brain become part of a machine that creates something it was never evolved to create?

So far, the answer appears to be yes.

9. BUILDING IT

Getting to this point was considerably less glamorous than the final idea makes it sound.

FlyWire Composer Python code

The project required a full week of development and more than 7,000 lines of Python.

It combines libraries and systems for symbolic music, numerical computation, scientific processing, FlyWire connectivity, audio decoding, persistent learning, genre analysis, evolutionary search, MIDI generation, and professional audio rendering.

FlyWire Composer Python code

The composer also maintains persistent learned state, so the system can continue building knowledge rather than starting from zero every time.

Hundreds of experimental runs were needed to discover what worked and, perhaps more importantly, what sounded terrible.

That last part is important.

Building a system that can generate notes is easy.

Building one that generates something you actually want to listen to is much harder.

10. WHAT HAPPENS NEXT?

The current system is still an experiment.

The biological network can become larger or more specialized. The musical memory can become richer. Reference representations can become more sophisticated. The critic can become better at understanding what makes a composition genuinely compelling rather than merely technically valid.

And there is an even bigger possibility.

Music may only be the beginning.

If a biological neural architecture can be placed inside a creative system, what else could it do?

Image generation?

Sound design?

Game behavior?

Optimization?

Something nobody has thought to try yet?

We usually build artificial systems that are inspired by biological brains.

This experiment takes a different approach.

What if we stopped merely imitating biological intelligence
and started using the real thing as computational material?

For now, the fruit fly has a new job.

It's making music.

Related Questions And Answers

  • • What is FlyWire and what is a fruit fly connectome?
    FlyWire is a project that reconstructs the wiring of the fruit fly nervous system as a digital connectome: a detailed map of neurons and their synaptic connections.
  • • How large is the FlyWire connectome, and how much of it does FlyWire Composer use?
    The full FlyWire connectome contains roughly 130,000–140,000 reconstructed neurons and more than 50 million synaptic connections. FlyWire Composer currently uses a working subnetwork of 8,192 neurons with their real synaptic connections.
  • • How was the fruit fly brain reconstructed as a digital connectome?
    Researchers captured millions of ultra-thin electron microscopy images of a fruit fly's nervous system. Computer vision and reconstruction methods were then used to trace neurons and their connections, producing a three-dimensional digital wiring diagram.
  • • Can a scanned fruit fly brain think or feel inside a computer?
    No. A connectome is a digital representation of neural structure, not a conscious mind. In FlyWire Composer, the reconstructed network is used computationally as a biological substrate whose activity influences decisions inside a larger software system.
  • • Can a fruit fly brain actually compose music on its own?
    No. The fruit fly brain does not understand music theory, harmony, genre, or aesthetics. Its digitized 8,192-neuron FlyWire network acts as an active computational substrate inside a larger music-generation framework that also uses musical corpora, genre references, rules, critics, and evolutionary search.
  • • How does FlyWire Composer use the fruit fly connectome to generate music?
    Activity in the 8,192-neuron FlyWire network influences musical decisions and exploration, including melodic and rhythmic possibilities. The resulting candidates are then evaluated and refined by the rest of the composition system.
  • • What musical datasets does FlyWire Composer learn from?
    The composer uses MAESTRO v3.0.0 for piano performances and symbolic musical relationships such as harmony, melody, timing, and voice leading, and Groove MIDI v1.0.0 for human drum performances and expressive rhythmic timing.
  • • How does FlyWire Composer learn what a genre sounds like?
    The composer can analyze reference songs placed in genre-specific folders and extract measurable characteristics such as rhythm, bass activity, harmonic and melodic behavior, density, arrangement, phrase structure, and energy. These characteristics form a compact statistical representation of the target genre.
  • • How do reference songs influence the generated music?
    Reference-song characteristics can influence actual note placement, rhythmic behavior, bass movement, arrangement, energy, and other composition decisions. Reference information can also be provided to the FlyWire actor as additional context during generation.
  • • Does FlyWire Composer use reference songs as training data?
    No. The reference songs are not used to train a generative audio model. Instead, the system analyzes them and extracts statistical characteristics that describe the target genre, which are then used to guide the composition process.
  • • How does the Critic evaluate generated compositions?
    The Critic evaluates candidate compositions across multiple dimensions, including harmony, melody, rhythm, phrase structure, form, tension, novelty, voice leading, learned musical fit, and genre identity.
  • • How does the evolutionary process improve the music?
    The composer generates many candidate musical ideas, evaluates them with the Critic, selects stronger candidates, mutates or recombines them, and evaluates the new versions again. This process repeats across generations to search for increasingly suitable musical structures.
  • • What is the difference between neural sonification and FlyWire Composer?
    Direct neural sonification converts neural activity directly into sound, often producing clicks, tones, or other audio representations of neural signals. FlyWire Composer uses connectome activity as an influence on structured musical decisions within a larger system that already has a musical vocabulary, genre information, rules, evaluation, and evolutionary search.
  • • Does the FlyWire network make the music by itself?
    No. The music emerges from the interaction of several components: the biological FlyWire network influences exploration, musical corpora provide symbolic musical knowledge, reference tracks provide genre-specific statistical characteristics, musical rules constrain possibilities, the Critic evaluates candidates, and evolutionary search selects and modifies stronger ideas.
  • • What makes FlyWire Composer different from conventional AI music generators?
    Instead of relying primarily on a conventional neural music-generation model, FlyWire Composer incorporates a reconstructed biological neural network as a computational substrate inside an evolutionary symbolic-music system. The result comes from the interaction between biological network dynamics, learned musical relationships, genre references, evaluation, and evolutionary search.
Keywords: fruit fly brain composes music • flywire connectome experiment • fruit fly experiments • biological neural networks music composition • insect brain ai music generator • flywire fafb v783 dataset • biological ai creative substrate • can a fruit fly brain write music • reconstructed connectome evolutionary algorithms • biological neural network reinforcement learning • fafb fly brain connectome ai projects • what can you do with a fruit fly connectome • biological neural substrate music composition • flywire brain map experiments • connectome playing beat saber doom crypto trading • how does flywire connectome work in ai • fruit fly brain controlling games and systems