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

I gave a fruit fly brain a new job: making music. Have a listen, then come behind the scenes to see how its wiring helped shape the tracks.

I gave a digitized fruit fly brain a new job: composing music. Listen to the results and follow the experiment to see how neural wiring and a music engine shaped the songs together.

I gave a fruit fly brain a new job: making music.

I chose a genre, started the program, and waited to hear what it would come up with. There were melodies, bass lines, and drum patterns. Some felt awkward. Others had enough going on that I wanted to listen again. A fruit fly brain was involved in making this. That still feels like a strange sentence to write.

Before you hear what it made, let me show you what I gave it to work with. Then you can decide how much credit you'd give the fly.

A brain, a genre, and a music engine

I call the project FlyWire Composer. The basic idea was to connect a digital reconstruction of fruit fly neural wiring to a music engine. As activity moved through that network, it helped shape the musical ideas the engine explored. I gave it a genre to work toward and let the process run.

The engine made several ideas, scored them, kept the more promising ones, and changed them before trying again. That cycle continued over several generations. A melody could take a different turn, or a drum pattern could change. Gradually, those little revisions became part of a larger composition.

A few good notes aren't a song. I needed phrases that belonged together, a bass line that worked with the drums, and a reason to keep listening after the first loop.

Here are four samples. They don't sound like club-ready tracks, of course. I could use more sophisticated instrument and sound libraries to give them a more polished, professional sound. But that's not what I'm testing here. I want to hear what the composition process comes up with: the melodies, rhythms, and how the parts fit together. Keep that in mind when you press play.

House Sample
Techno Sample
French House Sample
Ambient Sample

How an idea became a track

With several melodies, chord sequences, bass lines, and drum patterns to choose from, the engine needed a way to decide what to keep. I built a piece of software to score those ideas. I call it the critic.

The name sounds grander than the job. It checks whether notes fit together, whether rhythms and phrases hold up, and whether the result belongs to the requested genre. Each idea gets scores that help decide which versions get another chance. It doesn't listen the way you or I do.

The program then changes the stronger ideas and scores them again. A bass pattern moves, a chord changes, a drum accent appears. This is evolutionary search: keep promising versions, make variations, and see where they lead. The word sounds technical, but the cycle is easy to follow.

The scores only get you so far. Some results were repetitive; others missed the style. You can hear the samples and make up your own mind. That's a more useful test than taking the program's word for it.

Think about repetition. The same phrase can pull you into a groove or make you reach for the stop button. A surprise can be exciting or feel completely out of place. Balancing those things is hard to put into rules. The critic gives the search direction, but it can't promise that you'll love what survives.

Where the brain came from

The brain wiring comes from FlyWire, a project that maps neurons and their connections in a fruit fly brain. That map is called a connectome. I used a smaller network of 8,192 neurons from the FAFB v783 dataset, keeping their mapped connections.

In my program, simulated activity travels through those connections. The patterns it produces feed into choices about tempo, tonal direction, and the musical possibilities the engine tries. This is where the brain's wiring enters the process you heard in the samples.

The connections matter. Where activity can go depends on how the neurons are linked. I brought that particular structure into the music engine, keeping the routes between neurons intact.

Visualization of a fruit fly brain

What the engine learned from music

The engine also needed musical examples to work from. I used two datasets, each bringing something different:

  • MAESTRO v3.0.0: piano performances that provide examples of melody, harmony, and timing.
  • Groove MIDI v1.0.0: human drum performances that provide examples of rhythm and expressive timing.

Then I added reference songs in folders for different genres. The program looked at things like rhythm, bass movement, how busy the music was, and how its energy changed. Those measurements gave it a guide to the style I wanted. I wasn't training an audio-generation model on those songs.

House made the problem especially clear. Some earlier results hung together musically but felt more like lounge music than a dance track. A steady kick, repeating phrases, and sections that build and release energy gave the engine something more useful to aim for.

Think of the drums returning after a breakdown. The music has made room for that moment. The references helped the engine account for those changes in energy and density.

Inside the Python build

Behind all this was a fairly unglamorous stretch of programming, testing, and listening.

FlyWire Composer Python code

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

The code connects FlyWire's neural wiring, numerical and scientific processing, musical examples, reference analysis, idea generation, and scoring. It also handles MIDI generation and audio rendering.

Much of the work happens as symbolic music. That means instructions about notes: when they start, how long they last, and how strongly they're played. MIDI can store those instructions. Rendering gives them instrument sounds so we can hear them. Keeping those stages separate let me work on the composition before turning it into audio.

"Artificial music" might make you think of Suno, where you can describe a song and get a finished track. These samples came from the custom system I built, rather than Suno or a similar service. Here, the neural network, musical rules, and repeated revisions help develop the musical events that are then rendered into sound. That process is the experiment.

FlyWire Composer Python code

The composer also saves what it has learned between runs. It can carry that knowledge forward instead of starting from scratch each time.

Hundreds of experimental runs helped me find out what worked and what sounded terrible. There was plenty of the latter.

Getting a program to produce notes is one thing. Getting to the point where you want to let it keep playing takes considerably more patience.

So who actually wrote the music?

The fly's reconstructed neural network has a share in this music. So do the software, the musical examples, and the framework I built to bring them together. The composition came out of that shared process.

The network helped shape which possibilities were explored. Musical examples supplied a vocabulary, references and rules gave direction, and the critic and evolutionary search selected and revised ideas. Each part had a job. Together, they took those choices toward a track.

That's what I mean when I say I gave a fruit fly brain a job making music. Its wiring became a working part of the composer. It contributed to choices that the surrounding system helped turn into melody, rhythm, and structure.

The contribution comes from reconstructed wiring; it doesn't depend on a living fly understanding a chorus. Measuring how much that wiring improved the result would need a controlled comparison. These samples alone can't put a percentage on its share.

Give one of the samples another listen. There is biological neural wiring in the process behind it, alongside musical examples and code. For me, that's enough to want to keep exploring. I'd like to hear where this unlikely little contributor can take the next track.

Questions & Answers

What is FlyWire and what is a fruit fly connectome?

FlyWire maps the wiring of a fruit fly's nervous system. The resulting connectome is a detailed map of neurons and the connections between them. It's the biological starting point for this experiment.

How large is the FlyWire connectome, and how much of it does FlyWire Composer use?

The full connectome contains roughly 130,000-140,000 reconstructed neurons and more than 50 million synaptic connections. My composer uses a smaller working network of 8,192 neurons, keeping their mapped connections.

How was the fruit fly brain reconstructed as a digital connectome?

Researchers took millions of ultra-thin electron microscopy images, then used computer vision and reconstruction methods to trace neurons and their connections. That work produced a three-dimensional digital map of the wiring.

Can a scanned fruit fly brain think or feel inside a computer?

This experiment doesn't establish thought, feeling, or consciousness. The map gives me neural structure to work with. Simulated activity in that structure contributes to musical choices inside the program.

Can a fruit fly brain actually compose music on its own?

The fly network contributes as part of the system I built around it. Its activity helps shape musical choices; examples, references, rules, scoring, and evolutionary search help turn those choices into tracks. It has a share in the composition, alongside those other parts.

How does FlyWire Composer use the fruit fly connectome to generate music?

Activity in the 8,192-neuron network helps shape the melodic and rhythmic possibilities the engine explores. The composition software scores and revises those ideas, so the network's contribution becomes part of a longer process of making and changing the music.

What musical datasets does FlyWire Composer learn from?

I use MAESTRO v3.0.0 for piano performances and relationships between notes, including harmony, melody, timing, and how musical lines move together. Groove MIDI v1.0.0 supplies human drum performances and their expressive timing.

How does FlyWire Composer learn what a genre sounds like?

I put reference songs in folders for different genres. The composer measures things like rhythm, bass movement, melody, harmony, density, arrangement, and energy. Those measurements give it a compact guide to the style I'm asking for.

How do reference songs influence the generated music?

They can guide where notes fall, how the rhythm and bass move, how busy a section gets, and how the arrangement develops. Reference information can also reach the FlyWire network as extra context while it helps generate ideas.

Does FlyWire Composer use reference songs as training data?

The program analyzes the references to collect measurements that guide composition. It doesn't use them to train a generative audio model. Their role is to give the engine useful information about the target genre.

How does the Critic evaluate generated compositions?

The critic is my name for the software that scores musical ideas. It checks harmony, melody, rhythm, phrases, overall form, tension, novelty, how musical lines move together, and genre fit. Those scores guide selection; they aren't a guarantee that you'll enjoy the result.

How does the evolutionary process improve the music?

The composer makes several ideas, scores them, and keeps stronger ones. It changes or combines those survivors, then scores the new versions. Repeating that cycle lets it search for more promising compositions.

What is the difference between neural sonification and FlyWire Composer?

Neural sonification turns neural activity directly into sounds, such as clicks or tones. Here, the activity contributes to decisions inside a music-making system. Musical examples, genre information, rules, scoring, and revision help develop those decisions into a composition.

Does the FlyWire network make the music by itself?

It contributes alongside the other parts. The network helps shape exploration, musical examples supply knowledge, references describe the genre, and rules set boundaries. The critic and evolutionary search select and revise ideas. You're hearing their combined work.

What makes FlyWire Composer different from conventional AI music generators?

I built it to explore what reconstructed biological wiring could contribute to composition. The network works with musical examples, genre references, rules, and evolutionary search. The samples come from that custom process, rather than a service such as Suno.

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