Drag the slider until eight hundred fireflies agree.
Each firefly blinks at its own pace. The slider sets how strongly it adjusts to the others.
The mathematics called the tipping point before the first firefly was drawn.
Every firefly here is an oscillator with its own natural tempo, drawn from a bell curve around 0.8 blinks per second. Each one nudges its timing toward the rhythm of the whole swarm, and the slider K sets the size of that nudge.
Yoshiki Kuramoto published this model in 1975 and showed that order arrives suddenly. For a swarm with tempo spread σ, the threshold sits at Kc = σ√(8/π), which works out to 1.60 here. The blue curve in the chart comes from solving his self-consistency equation at load time. The amber dots are measurements from the running swarm, and once the swarm settles they land on the curve.
Christiaan Huygens noticed the same effect in 1665, when two pendulum clocks hanging from one beam fell into step. Fireflies along riverbanks in Southeast Asia do it every night. I told the Huygens story in a short film, The Sympathy of Clocks.
Claude wrote this page from one short prompt, covering the physics engine, the solver behind the prediction, the sound and the design. It is a single file with no libraries.