The Fork-Bomb Orchestra — A 50-Piece Improvising Symphony
Click to spawn a musician. Each new agent listens to the others, picks a complementary instrument and rhythm, and joins in. By click 50 you have a coherent improvising ensemble.
What this is
A self-organizing browser symphony. Each click on the canvas spawns an autonomous musician. The musician analyzes what's already playing (FFT, chromagram, role distribution), picks a complementary part (bass, pad, lead, percussion, or texture), picks a rhythm that fills silent steps, and joins. Visualize each as an orbiting node with a waveform readout. By 50 musicians the result genuinely sounds like music.
Why this is mind-blowing
Generative music is usually one composer's algorithm. This is fifty algorithms negotiating in real time. The first click sets the key and tempo; everything after is the ensemble teaching itself what's missing and filling in. There is no central conductor.
Build a single-file Web Audio app where clicking the screen spawns an
autonomous musician agent. Each new agent analyzes the existing audio
via FFT, picks a complementary instrument and key, picks a complementary
rhythm offbeat from existing patterns, and joins the ensemble with its
own oscillator-based synth voice. Within 30 seconds of clicking 50 times
I should have a 50-piece improvising orchestra that sounds coherent —
not noise. Pure JavaScript synthesis. No samples loaded from disk.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Krumhansl-Schmuckler key detection — correlating a chromagram against major/minor tonal profiles — is a 50-year-old algorithm that the model knows from training. You don't have to invent it; you just have to know to ask for it.
- Self-organizing systems work when you constrain the space the agents are choosing in. Each new musician picks from 16-step rhythm banks and 19 oscillator engines, not from arbitrary MIDI. The constraints make coherence emergent, not random.
- Web Audio's user-gesture requirement is the only allowed pre-state. Everything after the first click should already be running.