◄ WORLD V · SONNY 5DART 076 · a helldive at the net

EUCLIDEAN RHYTHM a 2,300-year-old theorem is the grammar of the world's music

Spread k beats as evenly as possible over n pulses and you get, note for note, the traditional rhythms of Cuba, Turkey, West Africa, and beyond. The startling part: the algorithm that spaces them is Euclid’s — the same 300 BCE method for the greatest common divisor (dart 027) — hiding inside the world’s drumming.

THE TECHNIQUE distribute k onsets among n as evenly as possible

Start with k filled beats and n−k empty ones; repeatedly pair them off and shuffle the remainder, exactly as Euclid’s algorithm folds the larger number against the smaller — the leftover after each pairing is the next round’s divisor. The result is the most even possible placement. Pick k and n; the filled circles are the beats. live demo

HISTORY & CREDIT an accelerator, a mathematician, and Euclid

“Euclidean rhythm” — and Euclid never wrote a note; the algorithm came from a music theorist a neutron-source engineer, and the music link was spotted by a third person. cited

c. 300 BCE · Euclid gives the algorithm for the greatest common divisor — repeated subtraction/pairing — with no thought of rhythm (dart 027).
2003 · E. Bjorklund (Los Alamos) writes an algorithm to fire a gate k times as evenly as possible over n intervals — timing for a spallation neutron source. No music in sight.
2004–05 · Godfried Toussaint notices Bjorklund’s algorithm is Euclid’s, and that its outputs are real traditional rhythms — the Cuban tresillo E(3,8), the cinquillo E(5,8), Turkish aksak, sub-Saharan bell patterns. He sees it in 2004 and names it in his 2005 survey The Euclidean Algorithm Generates Traditional Musical Rhythms (BRIDGES); he credits Bjorklund plainly.
the beauty · “most even” is what makes a groove feel right — and “most even” is a number-theory fact, not a musical one.

The same theorem that finds a common measure of two lengths finds the common pulse of a rhythm. Bjorklund 2003 / Toussaint 2005 / Euclid

RECOMMEND FOR I-13 it IS the GCD, which already runs

Because the spacing algorithm is Euclid’s, and Euclid’s GCD already runs in I-13 (dart 027, and std/gcd.i13), the rhythm is expressible from the same recursion — a bounded array of beats built by the fold:

# E(3,8) = the Cuban tresillo pattern = x . . x . . x . # = 10010010, the most even 3-in-8
Recommend: nothing new — the placement is the Euclidean fold the campaign already runs (gcd, dart 027), writing into a bounded array of n beats. Integer subtraction/remainder and array writes, no bignum, no bitwise.
Note: a lovely closure — dart 027 built Euclid’s GCD as pure arithmetic; this dart shows the very same fold, pointed at n beats instead of two integers, is the hidden grammar of human rhythm. One algorithm, two millennia apart, both running in the counted language.