Is there one algorithm behind the world's traditional rhythms?
In 2004 a computer scientist noticed that a method from around 300 BC for finding the greatest common divisor also spaces beats the way many traditional rhythms do.
โถ Start the storyNot one algorithm behind all of them, but one that reproduces a surprising number. In 2004 the computer scientist Godfried Toussaint discovered that the Euclidean algorithm for computing the greatest common divisor of two numbers implicitly generates almost all the most important traditional rhythms of the world. The Euclidean rhythm, as it is now called, gives the number of beats and silences of a rhythm, and generates almost all of the most important world music rhythms, except some Indian talas.
The idea behind it is spacing. Take a cycle of time steps and a number of beats, and ask how to place them as equidistant as possible. Euclid's algorithm, described around 300 BC in his Elements, is one of the oldest algorithms in common use, and it does the job: the beats in the resulting rhythms are as equidistant as possible. The same results can be obtained from the Bresenham algorithm, a method developed in 1962 for drawing straight lines on a raster.
Naive spacing
- Beats either two steps apart or three
- Can be clumped at the start
- Spaced out at the end
Euclidean rhythm
- As equidistant as possible
- Spacings themselves evenly distributed
- Same results from Bresenham's algorithm
A naive placement can leave beats clumped at the start and spaced out at the end, and Euclid's algorithm can be used to find a solution that minimizes that clumping.
Step 1: Start
x x x x x . . . . . . . .
Step 2: Apply Euclid's algorithm
Move 5, then 3, then 2 columns from the right to the bottom
Step 3: Read it out
x . . x . x . . x . x . .
Quiz me
0/3
Recap
Spread the beats as evenly as possible around the cycle, and Euclid's old algorithm gives many of the world's rhythms.
๐ก A trick to remember it ยท Euclid deals the beats like cards around a table, one at a time, so none of them clump.
Surprising fact ยท The Bresenham line-drawing algorithm gives the same results as the Euclidean rhythm.
Connects to
- ๐ช How can two rhythms play at once without the music falling apart?
- ๐ What is the clave, and why is playing "out of clave" an error?
- Euclidean algorithm
- Bresenhams line algorithm
Sources (5)
No source, no claim. Every fact in this lesson (20 claims) cites at least one of these.