What you are playing
This is the abelian sandpile, the toy that the physicists Per Bak, Chao Tang and Kurt Wiesenfeld introduced in 1987 to explain why nature is so full of avalanches, earthquakes, and crashes — events with no characteristic size. The rule is as simple as a rule can be: pile grains on a grid; whenever a square holds four, it spills one grain to each neighbour. That is the entire physics.
Drop grains slowly and at first nothing happens — the pile just fills. Then it reaches a state where a single added grain can set off a cascade of any size: a tick, a roll, or a collapse that crosses the whole grid. Crucially, the pile arrives at that knife-edge on its own, with no tuning, no dial set to a critical value. That is what self-organised criticality means, and it is why the same shape of distribution — a power law — turns up in earthquakes (the Gutenberg–Richter law), forest fires, neuronal firing, and the size of financial moves.
Each square that topples is one strike. An avalanche is a drum fill the arithmetic wrote — and it would sound the same in any order.
The sound follows the avalanche exactly. The moment you tap, the struck square topples — one hit. The four it feeds may topple next — the second wave, a small chord. The disturbance spreads outward in rings, and you hear those rings as beats: a fast little roll for a small avalanche, a long swelling-then-fading fill for a big one. Each wave's loudness rises with how many squares fell in it, so a large avalanche really does crescendo and die away like a struck cymbal.
Why the order does not matter
When the cascade is going, many squares are often unstable at the same instant. You could topple them left-to-right, or outward-in, or at random. Dhar's theorem (1990) says every legal order lands the sand in the identical final configuration, and makes each square topple the identical number of times. The collection of those counts is called the odometer, and it, too, is order-free. So the avalanche is not an accident of how we chose to simulate it — it is a fact about the pile. The panel above re-runs your last avalanche in several independent random orders and checks that the odometer never changes; the repo proves it from scratch on two hundred random configurations.
That order-independence is what makes the stable configurations into a group — you can "add" two piles by stacking and letting them relax, and the operation is associative and commutative. Every finite grid then has an identity element: a single special configuration that, added to any recurrent pile, leaves it unchanged. It is not the empty grid — it is an intricate, deterministic fractal, the same every time, and you can summon it with the identity button and drop grains onto it. The repo verifies it really is the identity (it is stable, it equals itself when doubled, and it fixes the maximal pile).
What is real, and what is a choice
The avalanche is the arithmetic, not an imitation of it. Every toppling you hear is a square that actually reached four and spilled, computed live in your browser by the exact integer rule; the waves are the real stages of the cascade; the histogram is the real distribution of the sizes you generate. None of it is sampled, smoothed, or pre-recorded.
The free choices are the sound, not the structure. Mapping a toppling to a pitch (rising with its distance from the strike, on a pentatonic scale), the marimba-ish timbre, the speed the waves play at, and the root note are all aesthetic — chosen once and applied identically everywhere. They change the melody of the fall; they cannot change which squares fall, or when, or how many. When a single wave is enormous, only a handful of its voices are actually struck (to spare your ears and your speakers) — the count shown is always the true one.
Sources
- P. Bak, C. Tang, K. Wiesenfeld, "Self-organized criticality: An explanation of 1/f noise," Phys. Rev. Lett. 59 (1987) 381–384 — the model and the idea.
- D. Dhar, "Self-organized critical state of sandpile automaton models," Phys. Rev. Lett. 64 (1990) 1613–1616 — the abelian property, the odometer, and the group.
- M. Creutz, "Abelian sandpiles," Comput. Phys. 5 (1991) 198 — the identity element as a fractal.
- L. Levine, J. Propp, "What is… a sandpile?," Notices AMS 57 (2010) 976–979 — a clean modern survey.
- The from-scratch engine and all live checks (abelian property, the identity, the power law): research/sandpiles/.
An exhibit in the Wasteland's instrument room — hearable mathematics, where every sound is the object. The avalanche you hear is the one the rule makes; the rhythm is order-free because the mathematics says it must be.