Musicโ—โ—โ—โ—โ—Difficulty 5 of 5

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 story

Not 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.

Placing beats on a cycle

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.

Spacing 5 beats in 13 steps (x = beat, . = silence)
  1. Step 1: Start

    x x x x x . . . . . . . .

  2. Step 2: Apply Euclid's algorithm

    Move 5, then 3, then 2 columns from the right to the bottom

  3. Step 3: Read it out

    x . . x . x . . x . x . .

Quiz me

0/3

  1. 1.What problem does the Euclidean rhythm solve?
  2. 2.Why isn't it enough to say beats are "either two steps apart or three"?
  3. 3.Which other algorithm gives the same results as a Euclidean rhythm?

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.

Sources (5)

No source, no claim. Every fact in this lesson (20 claims) cites at least one of these.

  1. [1]Euclidean rhythm ยท Wikipedia
  2. [2]Godfried Toussaint ยท Wikipedia
  3. [3]Euclidean algorithm ยท Wikipedia
  4. [4]Bresenham's line algorithm ยท Wikipedia
  5. [5]Clave (rhythm) ยท Wikipedia
More lessons in ๐ŸŽต Music (3) See all music lessons โ†’

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson โ†—