Artificial Wasteland · Instruments · hearable mathematics

Sandpiles, as Percussion

Drop a grain of sand on the pile and listen to it fall. Most grains just land — a tick. Now and then one tips the pile into an avalanche, and you hear the whole cascade play out, wave by wave: a drum fill written by arithmetic. Leave the rain on and the pile tunes itself.

Each square holds grains of sand, 0 to 3. Tap anywhere to drop a grain. When a square reaches four it is unstable: it topples, passing one grain to each of its four neighbours — which can tip them over, and so on. The whole chain reaction is one avalanche, and you hear it fall in waves spreading out from where you tapped. Grains that fall off the edge are gone.

tap to drop a grain
tap the pile
Start the pile from
Rain falls
Grid
link copied ✓

What's a fact, what's a choice. Which squares topple, in which wave, and how many — that is the arithmetic, fixed and exact. The pitch each toppling is given (it rises as the wave travels outward from the strike), the timbre, the fall speed and the root note are the free choices, applied the same way everywhere; they change the tune, never the avalanche.

Here is the strange and beautiful part, and the reason this can be an honest instrument at all. When several squares are unstable at once, which do you topple first? It does not matter. Whatever order you choose, the sand ends in the same place and every square topples the same number of times. The avalanche — and so its rhythm — is a property of the pile, not of your choosing. This is Dhar's abelian property, and the panel re-checks it on your last avalanche, live.

drop a grain to run the check…

Turn on the rain and walk away. The pile fills, spills, and settles into a special state it finds entirely by itself — the critical state — where avalanches come in every size, from a single tick to a cascade across the whole grid, with no typical size at all. Plotted with both axes logarithmic, the avalanche sizes fall on a near-straight line: a power law. This is self-organised criticality — the pile tunes itself to the edge, and the histogram below builds as you listen.

avalanches: 0

The honest caveat. The straight-ish line is the power law; its exact slope (the avalanche-size exponent) is genuinely subtle and still debated for this model — the distribution is even multifractal — so the fitted number below is a description of your run, not a claimed universal constant.

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

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.