It was discovered that the algorithm Euclid used to find the greatest common divisor between two numbers can also be used to generate rhythms that are seen in many different types of cultures.
The euclid function has to arguments : the number of hits, and the number of total beats. The goal of the algorithm is to “evenly” space the number of hits among the total beats. Let’s say that we do euclid(3,8), which means 3 hits in a span of 8 beats. Let’s represent this with 1s being hits and 0s being empty beats. So we would start our algorithm with 3 ones and 5 zeros, giving a total of 8 beats overall.
Now we start assigning zeros to each of the ones until we run out of zeros.
10 10 10 00
100 100 10
Now read thru and repeat this sequence and clap when you see a 1.
Click here for an applet that demonstrates this. It requires you have some midi output on your computer.
Working on a version to use your own sound files.
Click here for an example of a game using these ideas. Spawn worms with right mouse. Shoot worms with left. Just a preliminary test.