Lampyrid

A meadow of fireflies, each flashing to its own rhythm and each nudging itself toward the flashes it sees. Turn up the coupling and watch the moment the meadow starts to pulse as one.

Click or drag on the meadow to startle a patch of fireflies out of step. Keys: Space pauses and resumes, R scatters every phase, S runs a sweep.

Phases on a circle, turning with the crowd. The arrow is the order parameter: its length r runs from 0 (scattered) to 1 (all together). Filled dots are locked.
Order parameter r over the last 40 seconds. The dashed line, shown for the smooth pull with everyone in sight, is the infinite-meadow prediction.
Scene

Fireflies

A flash jolts every watcher's charge up by the pulse strength shared among what it sees. The charging curve bends the charge so the same jolt moves a firefly further ahead late in its cycle than early, which is what pulls groups into step; at 0 it is straight and a jolt shifts every firefly by the same amount.

Sweep

Steps K from 0 to 4 on a separate copy of the current swarm, lets it settle at each step and averages r. The curve is the prediction for an infinite meadow; below the threshold a finite one still shows r of order 1/√N.

View

Gentle flashes keep each firefly's change in brightness small and drop the halos. They switch on by themselves whenever full flashes would come faster than three a second, and from the start if your system asks for reduced motion.

Keep it