drift · how the videos are made

notes into fields

Eight recordings, from a 1909 sitar 78 to Beethoven's Fifth, became 4K music videos drawn by simulations that the notes themselves disturb. This is how a note becomes a mark, how a song is cast, and what broke on the way.

made september 2026 · kesava & claude · every figure below is measured from the code or the finished videos
A frame from the Beethoven video: blue vertical strata with orange rings spreading from each note and thin pale slime trails.
beethoven, symphony no. 5, 7:40. the coda: strata laid by the orchestra, ripple rings dropped by each note, slime trails on top.
  1. 1a recordingpublic domain or creative commons, licence evidence keptcatalog.json
  2. 2cited momentswhere musicians say the piece turns, in barspieces/<id>/moments.json
  3. 3notes on the recordingevery note timed to this performancealign.py → rec_<id>.json
  4. 4the directorsections, systems, blends, each choice tested firstdirector.py → edits/<id>.json
  5. 5the compositorlayers on worker threads, slides, the title cardcompose.html
  6. 64K render3840 × 2160 at 60 fps, frame-exact, audio addedrender.py · finish.py
  7. 7the checkthe finished video is sampled before anyone sees itframes every 2–15 s
1ALIGNMENT

the notes arrive before the sound

An audio-reactive visual guesses at music from a waveform. drift doesn't guess. Before a frame is drawn, every note of the piece is timed to the actual recording: when it starts, its pitch, how long it lasts and how hard it is played, filed under the player who plays it.

That is what lets a picture tell a cello from a viola, or know that a phrase is about to end. The picture reads the score at the clock of the recording, one frame at a time.

Sync is gated with a control clip built to be unambiguous: the note stream and the audio line up at 0 frames of lag. On Mozart's serenade, all 17 twenty-second windows matched at 0 ms.

rec_bach_1.json · player 1 · the first notes of BWV 565, doubled in octaves
onset spitchdur svelocity
0.000069 A41.73070.300
1.830567 G40.13910.594
1.969665 F40.11090.533
2.080564 E40.24090.474
2.321462 D40.10930.576
3,651notes placed on Bach's 8 min 34 s organ recording
143bar lines timed to the same recording, used by the cycle system and the director
0 frameslag between note stream and audio on the sync control
2ONE NOTE

a note becomes a mark

Each player is a colony with a home on a ring. A note lands inside its player's colony. Its pitch, placed within the piece's range, sets both the angle around the home and how far out it lands, so a rising phrase sweeps outward and around. Its velocity sets how large and strong the disturbance is.

Colour is harmonic, not decorative. A note's hue is its distance from the recording's tonic, counted in semitones from −6 to +5, plus a fixed offset for its player. Dense pieces get a narrower spread (46° minus up to 28°), so a busy fugue stays in one family of colour while a sparse nocturne ranges wider.

The hue is carried by the material. It lives in its own field and travels as the chemistry spreads and divides, so a cell started by the cello stays a cello cell through its own division.

Players also differ in wake, how long a note's trace lingers: in the Vivaldi, the viola's lasts 4.0 against the pizzicato's 0.9.

Colonies and hue Left: five Vivaldi players arranged as colonies on a ring, each with its hue offset and wake. Right: a note's position inside a colony, pitch as angle, register as distance, velocity as size. five players, five colonies winter i · hue offset · wake solo +0° · 2.6 pizz L +14° · 0.9 pizz R +26° · 0.9 viola −18° · 4.0 cello −32° · 1.8 homes sit at 52% of the ring radius, so neighbours grow into each other inside one colony player 1 · the bach opening pitch → angle, ±75° around the home pitch → distance 10% to 58% of R A4 · v .30 G4 · v .59 D4 · v .58 seed size = unit × (2 + 4 × velocity)
3THE SYSTEMS

fourteen machines, not fourteen skins

Each system is different physics, not a filter over the same picture. What they share is the input: the notes. What differs is what a note does when it arrives. Some seed a chemistry and let it grow, some drop energy into a wave, and two draw nothing from positions at all, only from what is sounding right now.

memory · keeps what was played present · shows what is sounding

Each image below is one system alone, run by the engine on a real recording: named, with the moment it was stopped.

ridges: dense wandering stripesmemory

ridges

swift–hohenberg · bach, 0:40–1:00

A note pushes the field up in a disc, weighted by velocity. Stripes reorganise around the push at their own fixed spacing, so a phrase leaves a fingerprint of labyrinths.

cells: gray-scott spots and wormsmemory

cells

gray–scott reaction–diffusion · vivaldi, 2:00–2:25

A note seeds a pocket of reagent that divides into spots, worms or coral. Loud strings keep it alive. On a soft nocturne it never takes hold, and it was the cause of the black screens in chapter 5.

bloom: a branching reactionmemory

bloom

branching reaction in a turning medium · mozart, 0:30–0:55

A note raises one reagent and eats the other in a disc. Seeds grow with the camera's travel, so each generation nests inside the next.

slime: vein-like trailspresent

slime

physarum agents · vivaldi, 2:30–2:55

A note releases 30 to 200 agents, more when it's played harder. Each follows the strongest trail it can smell, so notes grow vein networks between each other.

spiral: rotating wavefrontsalone only

spiral

belousov–zhabotinsky · beethoven, 6:40–7:05

A note excites the medium. Wavefronts refuse to cross, so every disturbance winds into a rotating scroll that outlives the note.

flow: ink carried in curlsmemory

flow

ink on a divergence-free curl field · chopin, 2:30–2:55

A note drops ink into a current that never compresses. The ink is carried and folded, so a melody reads as smoke trails. The sparsest system alone.

cymatic: nodal bandspresent

cymatic

a plate driven by the chord · beethoven, 5:00–5:12

No seeds. Each sounding note is a standing wave whose spatial frequency doubles with every octave. Sand gathers where the plate is still, so brightness is the nodal set of the chord being played.

moire: interfering gratingspresent

moire

gratings at the sounding intervals · debussy, 2:40–2:52

No seeds. One grating per sounding note, multiplied, not summed, because a product is what makes gratings beat. Consonance reads as calm fringes.

strata: sediment bands risingmemory

strata

sediment · mozart, 3:10–3:50

Each player lays its own band of sediment in its own colour. Louder music lays down faster and everything rises. Nothing is removed, only buried: the one system that shows a whole piece at once.

scan: hard vertical barspresent

scan

ikeda's register, 128 columns · vivaldi, 1:00–1:10

A note is a hard bar: position from pitch, width from force, held about a beat and gone. No growth, nothing organic; it looks like data being read.

ripple: rings on waterpresent

ripple

damped wave equation · gamelan, 1:00–1:15

A note is a small stone. The drop is kept narrow on purpose: a wide one launches a blob, a narrow one the short wavelengths that read as rings. Built for plucks, metallophones and pizzicato.

contour: arcs around a circlepresent

contour

1200-cent circle · bach, 0:40–1:20

The tonic, Sa, sits at the top. A note's pitch class is its angle and its register its radius, and each note draws the arc from the one before, the short way round, the way a glide moves. A held note pools. Built for the raga, where it is the anchor that never leaves; alone it is a sparse, drawn line.

cycle: a clock face of strokesmemory

cycle

clock face of the gongan · gamelan, 1:00–1:40

One turn is one cycle, taken from the bar lines of the recording. A note is a stroke at the angle where it falls in the cycle, on its player's ring. Cycles overlay and barely fade; a faint hand shows now.

evolve: an unnamed chemistrynot cast yet

evolve

a genome from the track's hash · bach, 2:30–2:55

Diffusion rates, feed, kill and anisotropy are drawn from a hash of the track, then screened before use: 600 steps on a 64 × 64 grid, rejected on variance and coverage, up to 24 rolls. A chemistry nobody wrote.

two systems were cut. Flocking boids and diffusion-limited crystals both failed the same way: the music only seeded them. Boids self-organise into the same swarm whatever you feed them, so two pieces gave two versions of one picture. The pattern has to be a function of the notes, not of its starting points.

4THE DIRECTOR

casting a song

A song is cut into sections where the music turns. Boundaries come from musicians' own notes first (the fugue subject entering, the recapitulation), then a tradition's grammar (alap, gongan), and only then audio novelty to fill long gaps. A song gets as many sections as its arcs ask for: three for a 3½-minute concerto movement, five for an 8½-minute toccata and fugue.

Sections alternate between one system alone and a layered set, and the densest stretch is always layered. A layered set is a memory ground with present layers over it, turned apart in hue.

Nothing repeats inside a song unless the music does. A return copies the section it returns to, folded through a mirror. When no unused system can fill a section, the strongest one already used comes back folded and re-hued, spread across systems so no single one returns twice.

How layers meet depends on the ground. difference subtracts: over a sparse ground it draws, over a bright one it cancels. A bright ground takes screen on both layers above it.

bach, toccata and fugue in d minor · the plan as rendered
startsmomentsystemhow
0:00opening flourishridgesalone
2:22fugue subject, first entrystrata + scan + moirelayered, screen / difference
4:00novelty in the audiocymaticalone
4:52novelty in the audioridges + ripple + slimeridges returns folded, screen over a bright ground
6:33novelty in the audiocymaticreturns folded and re-hued
Bach at 3:20: strata bands with scan bars and moire
bach, 3:20. the fugue: strata ground, scan bars and moire above it.
Bach at 5:30: folded ridges with ripple rings
bach, 5:30. ridges returning, folded and re-hued, with ripple rings dropped by the notes.
5TESTED BEFORE CHOSEN

a system has to light the screen

The first full set of videos had empty screens. Chopin went black from 1:20, the gamelan from 2:00. The director had given those sections to cells from a fallback list, and on a soft nocturne or a 1931 field recording, cells never seeds.

Now, before a system gets a section, the engine runs it on that section's own audio, entering at the section start exactly as the video will, and measures how much of the frame is lit. A system carrying a section alone, or a layered ground, needs 20%. A layer on top needs 6%.

The first version of the test lied. It ran at thumbnail size, where the grid is only 200 cells and cells looked 21% lit; at the 4K grid it was under 1%. The test now runs at the smallest size that uses the same 1000-cell grid as 4K.

share of frame lit, tested on the section's own audio
recording · sectionsystemlit
chopin · 0:00–1:20cells
0.3%
chopin · 0:00–1:20ridges
100%
bach · 0:00–2:22cells
0.4%
bach · 0:00–2:22ridges
96.9%
beethoven · 0:00–1:42cells
0.2%
beethoven · 4:56–6:38cymatic
88.3%
gamelan · 1:59–2:56flow
9.2%
mozart · 0:00–1:40bloom
22.5%
Chopin at 1:22 before the fix: an almost black frame
chopin, 1:22, before. cells on a soft nocturne: nothing took hold.
Chopin at 1:22 after the fix: bright green folded ridges
chopin, 1:22, after. ridges, folded for the return of the theme.

the test isn't the last word. It measures a system raw; the video hue-shifts and folds it. The gamelan's flow passed at 9% and showed 0 to 3% on screen. Debussy's cymatic passed with a median of 44% and strobed to black between swells. Strata alone scored 33% and rendered with a brightest pixel of 31 out of 255. So every finished video is sampled again (chapter 7), and a system that fails there is barred from that section in pieces/avoid.json.

6THE COMPOSITOR

layers, slides and a slow camera

Every layer is its own copy of the engine on its own worker thread, with its own state, stepped against one clock: seconds into the recording. On a ten-second Vivaldi clip, worker layers ran at 25.1 frames per second against 12.55 in the old one-thread path, with pixel-identical frames.

The video opens on the title card, in the style of a Bauhaus poster. Every change slides right to left, the card's exit included; the only fade is to black at the end. Layers for an upcoming section run six seconds early, unseen, so a field is already alive when it slides in.

The camera moves the field, not the image. Warping the simulation lets the chemistry regenerate detail, and a slower view scale runs from 1× to 2× and wraps, invisible because the field is a seamless tile. One cycle takes about 36 seconds; a loud onset only nudges it.

Ridges at 1:1 pixels from a 4K frame, slowly zooming out one camera cycle · 36 s
The Vivaldi title card
vivaldi, 0:02. the title card: composer, work, performers, licence.
The card sliding off to the left as the picture arrives
vivaldi, 0:05. the card leaves to the left as the first system slides in.
Two sections meeting mid-slide
vivaldi, 1:48. a section change mid-slide: flow arriving from the right.
7RENDER AND CHECK

frame-exact, then sampled

Screen recording is a race between simulation, encoder and compositor, and at 4K the encoder wins by dropping frames. drift renders offline: the clock steps by hand, each finished frame goes to a hardware H.264 encoder with an explicit timestamp, and the frame count is checked against the edit before audio is added.

A 4K render holds a lot of memory for a long time on a 16 GB machine. Renders run one at a time, and a guard stops one only when the kernel reports critical memory pressure for 30 seconds running.

Then the finished video is sampled, every 2 seconds for anything doubtful, and each section's lit share is read off real frames. That pass caught what the test missed: Beethoven's coda at 3 to 15% lit (difference cancelling a bright ground, now 61 to 100%), and Debussy twice.

the eight masters · 3840 × 2160 · 60 fps
pieceperformerslengthframes
Bach, Toccata and Fugue BWV 565Ashtar Moïra, organ8:3831,054
Beethoven, Symphony No. 5, iSkidmore College Orchestra8:2430,245
Mozart, Eine kleine Nachtmusik, iAdvent Chamber Orchestra5:5921,565
Debussy, Clair de luneLaurens Goedhart, piano5:0818,485
Chopin, Nocturne Op. 9 No. 2Martha Goldstein, piano4:1715,428
Vivaldi, Winter, iJohn Harrison, Wichita State Univ. Chamber Players3:3312,770
Sitar Ki Gat, Jaunpuri alapImdad Khan, sitar, 19093:3112,634
Lagu Kebiargamelan gong kebyar, Bali, 19313:0010,804
A near-black Debussy frame where cymatic collapsed between swells
debussy, 1:20, rejected. cymatic collapsing between swells: about half the section looked like this.
The gamelan at 2:44 with folded purple cymatic bands filling the frame
gamelan, 2:44, kept. the same system on a louder recording fills the frame.
·FROM THE PROCESS

what the drafts looked like

The first Winter cut a new system for every moment and put each player on a board of its own. The board went: its cells cropped the action away, and a player's cell went dark whenever they rested. Kesava's review rules shaped every edit since: few changes, never an instant cut, a small palette used in combinations; then as many sections as the song needs, nothing repeated, every change sliding right to left, and a camera cycle of at least 30 seconds.

Each draft was judged on contact sheets, many frames of a render on one page, stepped at 60 fps because every system advances per frame: a sheet sampled at 12 fps shows a different chemistry from the video.

A contact sheet of the gamelan draft: cycle strokes, slime loops and ripple rings across twenty frames
gamelan draft, contact sheet. the tradition's anchor, cycle, never leaves; slime and ripple come and go over it.
The first Winter draft with a board of player cells
winter, first draft, 0:56. the board of players that was cut.
Scan bars in the first Winter draft
winter, first draft, opening. scan bars under the old title.
The cycle clock face in a gamelan draft
gamelan draft, 0:50. a sudden stop, angsel: only the cycle's strokes remain.