One number for a whole meadow.
Coherence, written r, runs from nought to one. It is the length of the average of every firefly's phase, taken as a point spinning on a circle.
When the lights are scattered, their little arrows point everywhere and cancel — r sits near 0.0 and the field twinkles at random. As they entrain, the arrows swing into line, the average lengthens, and r climbs toward 1.0: one pulse, three hundred bodies.
The big numeral on the console is that value, read live from the simulation each frame. It is the meadow taking its own temperature.
Each light watches only its neighbours.
This is the Kuramoto model, 1975 — the cleanest account of how independent oscillators fall into time without anyone in charge.
Every firefly holds a natural rhythm, ω, slightly different from the next. Left alone it keeps its own beat. But each also nudges its phase toward the crowd's average, in proportion to a coupling strength K — the Night air slider on the console.
Below a critical coupling the meadow stays incoherent, forever twinkling. Push K past that threshold and a phase transition tips the whole field into lock-step. Drag the slider down to a restless, gusty night and the chorus falls apart; slide it back to still air and it heals.
In the Elkmont dark each June, Photinus carolinus blink as one — six flashes, then a held breath, then six again. No leader gives the count.Great Smoky Mountains · the synchronous firefly