Toussaint Explorer: Euclidean Rhythm Generator & World Music Lab

The Toussaint Rhythm Explorer

In 2005, a computer scientist by the name of Godfried Toussaint made an interesting mathematical discovery. He applied Euclid’s theory to equidistant beats placed in a circle, spun them, and found that the calculated beat generated nearly all of the rhythms of traditional music.

Cuban clave. West African bell patterns. Bulgarian folk dances. Brazilian bossa nova. Indian classical tāla; these rhythms evolved independently, yet they share a common mathematical skeleton.

My Toussaint Explorer tool is made to explore permutations, and I hope it makes you wonder, just like it does me. I have another Euclidean tool which allows you to select the number of tracks, 2 to 6 available; it is good for exploring beats and polyrhythms. This tool on this page looks at rhythm.

Toussaint Explorer

A laboratory for Euclidean rhythms — after Godfried Toussaint
Next convergence
Track 1 (Inner)
Track 2 (Middle)
Track 3 (Outer)
100 BPM
0%
Track 1 — Inner
Steps 8
Hits 3
Rotation 0
Probability 100%
Grouping
x . . x . . x .
Track 2 — Middle
Steps 8
Hits 5
Rotation 0
Probability 100%
Grouping
x . x . x x . x
Track 3 — Outer
Steps 16
Hits 9
Rotation 0
Probability 100%
Grouping
x . x x . x . x x . x x . x . x
Pattern Analysis
Evenness
Syncopation
Density
Complexity
World Rhythm Presets
About Euclidean Rhythms: In 2005, Godfried Toussaint discovered that the Euclidean algorithm — used since antiquity to find greatest common divisors — generates rhythms found in traditional music worldwide. "The Euclidean algorithm generates almost all the most important world music rhythms." This tool explores his research interactively.

What Is a Euclidean Rhythm?

Imagine you need to distribute 3 drum hits as evenly as possible across 8 time slots. You could bunch them together [x x x . . . . .] , but that’s not very interesting. Or you could space them out perfectly, but 3 doesn’t divide evenly into 8; there is always a fraction.

The Euclidean algorithm solves this elegantly. It produces: [x . . x . . x .]

That pattern — three hits maximally spread across eight pulses — is called $E(3,8)$. Musicians know it as the tresillo, the rhythmic foundation of Afro-Cuban music. It’s also the backbone of rock and roll, R&B, and the most popular music of the last century. Danceable.

What Toussaint Discovered

Toussaint analyzed traditional rhythms from around the world and found Euclidean patterns everywhere:

  • E(3,8) — Tresillo appears in Cuban son, American rock, and West African music. It creates the characteristic “3+3+2” feel that underlies countless pop songs.
  • E(5,8) — Cinquillo is the tresillo’s complement. Together they form Cuban music. The cinquillo also appears in the habanera rhythm that traveled from Cuba to Argentina to become the tango.
  • E(7,12)— Gahu is a social dance rhythm of the Ewe people of Ghana. The 12-pulse framework allows for intricate polyrhythms where different instruments play interweaving patterns.
  • E(5,16) — Bossa Nova creates the floating, syncopated feel of Brazilian jazz. João Gilberto’s guitar patterns followed this distribution.
  • E(4,9) — Bendir appears in North African frame drum music.

The list goes on. Toussaint has documented dozens of these corresponding beat links, suggesting something interesting: when humans seek rhythms they enjoy, they pick mathematically predictable forms.

Beyond Simple Patterns: Rotation

He also found that the same Euclidean pattern can feel completely different depending on where you start it within the measure.

$E(5,16)$ generates the bossa nova bass pattern. But rotate it, start on a different beat, and you get their son clave 3-2, Cuban music. Rotate it again and you get the rumba clave: more syncopated, more intense.

Same formula. Same five hits in sixteen slots. Different starting point. Completely different groove.

Cuban musicians have a saying: “Never play against the clave.” It is too strong and it overwhelms any music where the musician plays against the beat; it can’t be erased.

The 3-2 versus 2-3 direction of the clave determines the entire feel of a song. Toussaint’s work explains why: rotation transforms the rhythmic “personality” even when the underlying structure remains identical, you can’t fight the beat.

Aksak: When Equal Beats Aren’t Equal

Western music typically divides time into equal parts: four quarter notes, eight eighth notes. But much of the world’s music doesn’t work this way. Predictable, you know if you have one component, you need the rest.

But, in the Balkans, Turkey, and the Middle East, musicians use aksak rhythms, literally “limping” in Turkish. These divide time into unequal groups: 2+2+3, or 3+2+2, or 2+3+2+3.

The Bulgarian Râčenica dance uses a 7-beat cycle grouped as 2+2+3. It’s still Euclidean, E(4,7)$, and produces a maximally evenly distributed four hits across seven pulses, but the underlying pulse itself is asymmetric. Short-short-long. It creates a driving, off-kilter sound.

Indian classical music takes this further. The Jhaptāl is a 10-beat cycle grouped as 2+3+2+3. Tabla players master the complex beats before even starting to play.

The Melodic Connection

This is generative composition: let the algorithm choose when notes occur, and musical phrases emerge that are mathematically even yet musically surprising. I am still thinking of the ramifications of this and why we find it pleasing. Do we naturally move against chaos, intrinsically speaking, and we know it like the back of our hand, without knowing why we choose and generate? That is a philosophical question, I think, a sound choice we select unknowingly.

Using the Explorer

The Toussaint Explorer lets you experiment with these ideas directly:

  • Three tracks give you enough voices to create polyrhythms without overwhelming complexity. Adjust steps (the cycle length), hits (how many sounds per cycle), and rotation (where the pattern starts). If you want to play around with more beats, my Euclid explorer tool lets you add up the six revolving rings.
  • Probability adds randomness; set it below 100% and some hits will randomly drop out, creating variation within the pattern, because we also anticipate and treasure the novel.
  • Aksak groupings let you divide cycles into unequal beats, forming Bulgarian, Turkish, and Indian metric feels.
  • Melodic mode switches any track from drums to notes, turning patterns into melodies based on your selected scale.
  • The analysis panel shows you the math: how even are your patterns? How syncopated? How dense?
  • Cultural presets let you see world rhythms, settings, and their underlying structure. Each comes with context about its origin and significance.

Further Reading

Godfried Toussaint’s paper is called “The Euclidean Algorithm Generates Traditional Musical Rhythms” (2005). He wrote a later book called The Geometry of Musical Rhythm that further analyzed beats.

For the mathematically inclined, the connection between Euclidean rhythms and Bresenham’s line algorithm (used in computer graphics, coming soon to this blog) opens another fascinating rabbit hole.