# Drosophila MANC Connectome Synthesizer ### Neurological Dataset Synthesis and Physical Model DSP by Benn Jordan with support of Google Research. An interactive, in-browser physical modeling synthesizer and biological simulation driven by the Janelia Male Adult Nerve Cord (MANC) connectome dataset. The instrument models the neuromuscular circuits and thoracic biomechanics used by male fruit flies (*Drosophila melanogaster*) to sing courtship songs to females. Runs 100% client-side in standard web browsers using the Web Audio API, Canvas 2D, and Vanilla JavaScript. --- ### Explain Like I'm 5 Boy fruit flies sing love songs to girl fruit flies by sticking out one wing and vibrating it really fast. They can make two different sounds: - Little ticking clicks (like tapping a tiny fingernail on a desk). - A soft buzzing hum. When the girl fly walks farther away, the boy fly pushes his wing harder through the air to sing louder. When she comes close enough to touch him, he gets super excited and his voice gets wobbly, squeaky, and jittery. This project is a playable instrument on the internet that uses the actual wiring map of a fly's brain and body to make those exact sounds live on your computer. --- ### Explain Like I'm a Normal Person In biology, male fruit flies court females by extending one wing and vibrating it to create acoustic patterns. They produce two distinct vocalizations: a rhythmic series of clicks called "pulse song" and a continuous hum called "sine song." Scientists at the Janelia Research Campus and Google recently completed a synaptic-resolution map of the male fruit fly's entire central nervous system (the MANC connectome). They mapped out every single neuron and connection responsible for how a fly senses a mate, decides which song to sing, and moves its wing muscles. This project turns that wiring map into a digital sound synthesizer. Instead of playing pre-recorded audio samples, a simulation of the fly's nervous system runs in your browser in real time. It calculates how neurons fire, sends electrical impulses to simulated wing muscles, and passes those vibrations through an acoustic model of an insect's body. You can drag a female fly closer or farther away on screen to watch how the male responds: - At a distance, he sings loud pulse clicks to get her attention. His wings push harder against air resistance, creating natural distortion. - Up close, he switches to an intimate hum. - When they physically bump into each other, the excitement causes pitch instability, micro-chirps, and mechanical resonance changes matching real-world bioacoustic laboratory recordings. You can tweak nerve settings, introduce rival flies to jam the song, test genetic mutations, and record the audio to WAV files for music production or sound design. --- ### Explain Like I'm Obsessed with Things Like Mapping Fruit Fly Brains This application couples a real-time conductance-based spiking neural network to a physical modeling acoustic pipeline, derived directly from the Janelia Male Adult Nerve Cord (MANC) connectome (Cheong et al., 2023) and empirical courtship neuroethology (Coen et al., Nature 2014; Ding et al., Current Biology 2019). #### 1. Neural Circuit Architecture The simulation implements the thoracic courtship circuit as an interactive integrate-and-fire network: - **P1 Interneurons**: Act as the master integration hub, processing sensory proximity, speed, and contact pheromones. - **pIP10 & pPR1 Descending Neurons**: Command channels descending from the brain into the VNC to gate pulse song and sine song modes, respectively. - **vPR6 & GABA-T2 Reciprocal Loop**: The thoracic Central Pattern Generator (CPG) in neuromere T2. vPR6 drives burst timing while reciprocal GABAergic interneurons control the characteristic ~35 ms Inter-Pulse Interval (IPI). - **Flight Motor Neurons**: Direct motor drive into MN-b1 (impulsive wing-flick transient trigger) and MN-b2 (continuous basalar oscillation). #### 2. Physical Modeling DSP & Acoustics Rather than playing back wavetables, the audio engine runs modular Web Audio DSP: - **Pulse Synthesis**: Generates polyphasic damped wavelets (carrier ~250–350 Hz, fast attack ~0.6 ms, ring-down ~3.5 ms) coupled with high-frequency mechanical sclerite snap transients. - **Sine Synthesis**: A ~162 Hz fundamental sinusoidal oscillator driven by MN-b2 depolarization, with aerodynamic flutter and second-harmonic distortion. - **Aerodynamic Saturation (Loudness Scaling)**: In living flies, distance-dependent amplitude changes are governed by muscle power pushing into non-linear air resistance. The engine models this using a variable tanh waveshaper: as distance increases from 2 mm to 25 mm, drive increases from 0.8x to 3.2x, compressing waveforms and generating upper harmonics that raise perceived dB without arbitrary linear gain jumps. - **Touch-Contact Stochasticity**: Physical touch (< 2.0 mm) excites foreleg mechanosensory and gustatory inputs, expanding pulse jitter up to ±105 Hz, producing pitch sweeps, and introducing micro-chirps observed in high-speed acoustic recordings. - **Dynamic Thoracic Box Resonator**: Models the acoustic impedance and resonant damping of the thoracic exoskeleton. Center frequencies wander across dynamic ranges (up to ±85 Hz) and filter Q fluctuates between 1.0 and 14.0, scaling dynamically with courtship proximity. - **Genetic Alterations**: Includes models for the *Slowpoke* (*slo*) mutant (impaired BK Ca²⁺-activated K⁺ channels, resulting in broadened damping and lower carrier frequencies) as well as sibling species (*D. simulans* and *D. yakuba*).