1.4.6 Euclidean Rhythms
Euclidean Rhythms
Touch to start the sound, then choose a mode bottom left — Auto plays by itself. Drag round the three arcs for the flock; speed and birds bottom right.
How to play. Touch the picture to start the sound. The row at the bottom left chooses how it is played:
- Auto — leave it to play. The three arcs move by themselves, slowly and never the same way twice, and the birds make the rhythm and the melody from them: background music that keeps changing. Move an arc and Auto waits for you; half a minute after your last touch it carries on from where you left it.
- Standard — you shape the flock, the birds make the music. Drag round the three arcs (separation, alignment, cohesion): where the birds gather round a ring, it gains beats.
- Manual — you make the rhythm. The beats the birds have made become yours; the triangles add or take away a beat on their ring, and the birds leave the polygons alone and only play the melody.
Night turns the ground black. The panel at the bottom right sets the speed and the number of birds. A Korg nanoKONTROL2 plays it all, as the Processing program does (the controller button; Chrome, Edge or Firefox — Safari has no MIDI).
Working note. Here I implemented Godfried Toussaint's Euclidean rhythms to study how three layers of timing, each simple on its own, combine into a great variety of rhythmic patterns. Together with the boids, which strike the polygons' edges like strings and lay a melody over the beats, they make one whole piece of music. In the end the polygons are the main instrument here: as they turn, they trigger both the rhythms and the melodies.
Three rings turn together — sky blue, light green and orange, from the outside in — with three arcs round them for the flock. At the start each ring has a single beat; the birds bring in more.

The rhythms. Each ring spreads its beats as evenly as Euclid's algorithm allows over its places, and a place sounds when it passes the red line: the outer ring a low drum, the middle one a knock, the inner one a tick. Three of eight is the tresillo, five of sixteen the bossa nova.
The birds. Every beat shakes the flock apart, the low drum hardest; its own rules, set on the three arcs, pull it back together.
The birds' beats. Each ring has a zone, a faint band round its circle in its colour. On every beat the birds in it are counted, and every three of them add one more beat to that ring; the counted birds take the ring's colour, and a counter under the centre shows what comes at the next beat. When the birds leave, the beats go with them. More beats shake the flock harder, so a crowded ring tends to scatter its own birds again.
The strings. A bird crossing an edge — or an edge sweeping over a bird — bows it on the ring's next beat: a long edge sounds low, a short one high, so a ring with more beats sings higher.
Further reading
- Godfried Toussaint, “The Euclidean Algorithm Generates Traditional Musical Rhythms”, Bridges: Mathematical Connections in Art, Music and Science, 2005.
- Wikipedia: Euclidean rhythm, Maximal evenness, Euclidean algorithm.