Part one
The world modelWorld model · Life cycle
Every boid is mortal
A boid fades in over 1.5 s with a birth ring, spends its youth dim and infertile, matures into a full-brightness adult, and ages under a Gompertz hazard whose modal age tracks population pressure. Three other doors lead to the same exit.
World model · Courtship & pair bonds
Marriage by collision
Bonds form by literally bumping into the right stranger. Every touch within two radii counts as a hit; the odds of a hit landing are shaped by colour-family preference and by morphology — females favour long beaks, males favour big eyes. Enough hits and the pair bonds, glows, and starts a family.
World model · Population regulation
Three arms, one thermostat
Every frame the tank takes its own census. Crowding above the target raises pressure; pressure pushes back through three independent arms — all negative feedback, so the population orbits the target instead of exploding or collapsing.
Arm 1 is also what draws the flock together. It pulls each boid toward its local centre with a conservative spring (a position nudge whose pulls cancel across the flock) — so clusters form tightly but never creep into a corner — while a thermal temperature jitters every heading so a cluster's centre wanders. The result: clusters that breathe and roam, loosening as they crowd and drifting as a whole.
A dense, tightly-packed cluster is a different story: the spring only pulls inward and the thermal kicks cancel across many boids, so it can sit almost still. The alignment nudge (the align / roam control — the classic third flocking rule, on by default at a gentle 0.05) fixes that by making neighbours match headings, so a whole cluster locks onto a shared direction and wanders as one. Turned up against the temperature, it's a genuine order/disorder switch: static clump below, marching flock above.
World model · Heredity
Colour is the genome
A boid's genome is its hue and saturation, plus a beak gene and an eye gene. Children blend their parents' colours with mutation on top. A preferred colour family sweeps the tank in an endless cycle — bonding odds, predator diets and biased inheritance all pull the population toward it, and once ≥90% converge for 5 s, the wheel advances.
World model · Development
A cell decides what to become
Turn on differentiate and the genome stops being decoration and starts being fate. Every cell begins grey and undecided; over a few seconds it commits to one of three lineages — a heart cell, a liver cell, a brain cell (red, green, blue) — and once it commits, it locks. The decision is irreversible, the way a real cell that has become muscle never wanders back to being anything else.
What triggers the choice is what triggers it in an embryo, minus the biochemistry — three forces pulling on an undecided cell at once. A morphogen gradient runs top to bottom, so a cell reads its own position and leans toward the fate of its band — Wolpert's French-flag rule, position as destiny. Its neighbours pull too: at positive coupling they reinforce one another (the community effect — cells agree, and clean organ territories crystallise); at negative coupling a committing cell pushes its neighbours the other way (lateral inhibition — the salt-and-pepper scatter of neurons among glia). And noise jitters the whole thing, so symmetry breaks where the gradient is ambiguous. Commitment builds faster once the neighbours have already decided — a wave of determination sweeping outward from the first cells to commit.
Then the tank's own heredity takes over. A committed pair's children inherit their parents' fate colour, so a newborn starts life biased toward the family lineage — but it is born grey and must still commit for itself, the way an embryo's daughter cells inherit a head start yet make their own call.
One caveat the physics forces on us: a boid always swims at full speed, so a flock never holds still — and a pattern you can't hold still, you can't see. Two controls tame it. Motility damps how far the cells drift; turn it down and they pack like tissue, the territories setting like stained glass. Settle ties that damping to the decision itself — undecided cells migrate, then freeze the moment they commit, so a lineage crystallises in place while its still-grey neighbours wander on, the way cells in an embryo roam until they know what they are and then stay put. This is a metaphor, not developmental biology — no genes regulating genes here — but the shapes it makes (positional bands, inhibition patterns, irreversible commitment) are the real ones.
World model · Pathology
An epidemic needs contact
Disease spreads the same way love does: by collision. Repeated exposure infects; the infected wear a white dot and either die — much more often in an inbred tank — or recover immune for life. Bonded partners are the exception: infection trickles across the pair bond without touching.
World model · Predation
The hunger clock
Predators are white boids with an appetite and the same physics. A meal buys ten minutes of peace — well, ten seconds — then hunger returns. Diet is programmable: hunting the wrong-family boids turns predators into an engine that accelerates the colour cycle.
Part two
The render modelRender model · Layer stack
Ten layers, one WebGL frame
PixiJS draws the tank painter-style, bottom to top. Bodies are pooled, tinted sprites of a single teardrop texture; everything else is retessellated PIXI.Graphics. On low-power hardware the sprite batching is what buys the framerate.
Render model · Depth
A third dimension, rented cheaply
Depth is one extra coordinate, not a new engine. Each boid drifts through z on a slow random walk; the legacy 2D plane sits at mid-depth, so boids swim toward you past full size and shrink away behind it. Disease and personal space are the 3D collisions; bonding stays 2D — an on-screen encounter — and steering stays 2D too, so the ecosystem needs no retuning. Boids that overlap on screen gently push apart in z, so the draw order stays honest and the front/back flicker disappears.
Render model · Visual vocabulary
What you're seeing
Six recurring glyphs carry the story. Once you can read them, the tank narrates itself.
Render model · Cloth
Images that behave like cloth
Load your own pictures and they need not stay flat. A boid wearing an uploaded image can be drawn as a deforming mesh rather than a sprite: a slow wave travels through the whole picture, both axes at once, so it reads as cloth in water rather than a flag on a pole. Each boid gets its own phase, so a shoal never pulses in unison. Only upright images ripple — a body that rotates with its heading while the wave axis stays fixed reads wrong, so uprightness is the condition rather than a preference.
A second wave carries no geometry at all: a shadow rolling over the surface, shading the slope of the wave rather than its height, which is the difference between a curved surface and a gradient sliding across a photo. It only ever darkens — cloth in water is shaded on the far side of a swell, not lit above ambient — and on an LED panel that matters twice over, since brightening pixels is what makes a panel flicker. Three sliders: how far the cloth moves, how dark the shadow gets, and how many crests fit across the picture.
This is the one effect in the tank that is genuinely expensive. Every rippling boid needs its own mesh, and meshes cannot be batched the way sprites can — so where the flock costs one draw call for hundreds of bodies, this costs one each. It is built for a handful of image boids, not a crowd, and past a hard ceiling the surplus quietly stop rippling rather than let the tank stall.
Render model · The panel
Upright, whichever way the panel hangs
The tank's real home is a 192×32 LED panel, and a panel can be hung either way up — portrait or landscape, turned in its own plane like a picture frame. Turn it, and everything drawn upright is suddenly upright only with respect to the canvas, not the room. A single angle fixes that: upright images counter-rotate by however far the panel has turned, so a face stays a face however the frame is mounted.
Nothing else moves. The tank keeps its own shape, the boids go on floating exactly as before, and a boid drawn at its heading needs no correction at all — it swims in the tank, and the tank turns with the panel. For now the angle is a slider; the intention is an inclinometer on the panel writing the same number.
Render model · Sonic vocabulary
What you're hearing
The tank can be listened to as well: press 🔊 on the dashboard, then tap the aquarium once (browsers insist on a gesture before sound may start). Nothing is a recording — every sound is synthesized live, and the score is played by the society itself. All pitches sit on a D minor scale, so the tank cannot play a wrong note. Close your eyes and it keeps narrating on many channels at once: the weight of the crowd, its colour and its size, courtships and marriages and divorces, epidemics, the arrival of a predator, generations coming and going — and now a melody sings over the top of it all. Fourteen voices, each a fader in the full-width mixer.
The bed — the state of the society.
The melody — a line that sings over the texture.
The events — moments in a life.
Performance · The mixing desk
Composing with the tank
The two bars at the top of the dashboard turn the aquarium into an instrument you can play and record — a generative piece whose score is the society and whose performance is you moving the controls.
Because a preset press is recorded as the individual control changes it makes — not as a reference to the file — a recorded piece keeps working after the scene files are gone, and travels intact into the exported kiosk page. One caveat: switching universes (the ✦ Astro mode) is not captured, so compose a piece within a single world.
Context · Lineage
Where this sits
Composing this way has a history. You don't write the notes — you build a system whose behaviour is the music, then tend it. There is no single name for this exact instrument — a live artificial-life simulation driving synchronised generative graphics and synthesised sound, performed and recorded as parameter automation — but every layer of it belongs to a named tradition.
In one line: a generative, sonified artificial-life instrument — generative music by way of sonification, in the swarm-music tradition, performed and captured as automation over an indeterminate engine. Terms to pull on if you want to go further: generative music · algorithmic composition · sonification · swarm music · process music · comprovisation · metacreation.