cynnic

repetitive structures

euclidean pattern generator

a euclidean rhythm spreads k hits as evenly as possible across n steps. the kick holds the floor at four to the bar so you can hear what the other two are doing against it. there's a note on where any of this came from underneath.


tempo
tone
out

export

len is the number of steps, hits is how many land in them, rot slides the whole thing round. div sets the step size. dials take a vertical drag or a scroll, double-click resets. space plays.
odd lengths against the kick's sixteen give the long cycles — 7, 9, 11, 13 and 15 are all coprime with 16, so a seven-step part takes seven bars to come back round.
the midi lands as one file, three tracks: kick and rim on channel 10, square on channel 1.


where this came from

euclid wrote down a way of finding the greatest common divisor of two numbers, some time around 300 bc, in book seven of the elements. take the smaller number away from the larger one, keep the remainder, do it again, stop when there's nothing left to take. that's the whole thing. it's still the algorithm we use.

in 2003 a physicist called eric bjorklund had a problem that had nothing to do with music. he was working on the timing system for a spallation neutron source, an accelerator, where a gate has to open a set number of times inside a fixed window of intervals, and the openings want to be spread as evenly as they can be. he wrote a technical note for los alamos describing how to generate those patterns. no mention of rhythm anywhere in it.

two years later godfried toussaint, a computer scientist at mcgill, noticed that bjorklund's algorithm and euclid's are the same shape. both work by repeated subtraction, both keep a remainder, both stop when the remainder runs out. so he called what came out of it euclidean rhythms and wrote them E(k, n) ... k hits across n steps. then he did the part that makes the paper worth reading, which was to go and check them against rhythms people actually play.

the ones it lands on

click one and it loads into

E(3,8) is the cuban tresillo. it's the habanera, it's the bass figure in hound dog, it's the first bar of the son clave, and it's what gets played on the atoke bell in the sohu, an ewe dance from ghana. E(5,8) is the cinquillo, the handclap in that same record, and it ran through jazz for most of the last century. E(7,12) is a west african bell pattern, the ashanti mpre. E(4,9) is the turkish aksak, and the meter brubeck used for rondo a la turk. E(2,5) started on its second onset is take five. E(3,7) is a bulgarian ruchenitza and also money by pink floyd. E(5,16) is where bossa nova sits. E(11,24) belongs to the aka of central africa.

none of those people were running an algorithm.

what that does and doesn't mean

it would be tidy to say the maths explains the music, and it doesn't. most euclidean patterns are inert. plenty of rhythms worth playing aren't euclidean at all, and several of the ones above are rotations of a euclidean rhythm rather than the thing itself, which is a smaller claim than it first sounds. toussaint's own conclusion was mostly a question: why do some of these turn up in bulgarian and persian music and not in african music, and the other group only in sub-saharan africa. he left it there.

what the algorithm seems to be is narrower and more useful than an explanation. if you are going to put k things in n slots and you want them spread, there is one obvious way to do it, and people arrived at it separately, everywhere, without being told. whether that says something about rhythm or just something about counting, i don't know. i lean toward counting, on the days i'm being honest about it.

the rot dial is worth more attention than the maths, anyway. toussaint calls a pattern and all its rotations a necklace, because where you start the cycle is a separate decision from which pattern it is. the samba and a ghanaian clapping pattern are the same necklace picked up at two different points, and they don't sound like each other at all. that decision is the one that sounds like taste. the rest is division.

godfried toussaint, the euclidean algorithm generates traditional musical rhythms, bridges, banff, 2005. the rhythm attributions above are all his.