In his book Elements, published circa. 300 B.C., philosopher and mathematician Euclid developed an algorithm for finding the greatest common divisor between two integers. The applications of this algorithm, known as the Euclidean algorithm, extend far beyond the field of mathematics. The algorithm is primarily used to distribute numbers as evenly along a number line as possible by finding the greatest common divisor and placing a given number of 1s in a string of 0s a certain distance apart. When the 1s are expressed as accented beats and the 0s as unaccented beats, Euclid’s system surprisingly yields a plethora of different rhythms found in traditional music from cultures all around the world. For example, when Euclid’s algorithm is applied to the numbers 3 and 8, it yields the string [10010010], which, if you clap on the 1s and rest on the 0s, yields the Cuban tresillo, a rhythm that is very prevalent in traditional songs from Caribbean and Latin-American cultures.
So, it turns out that music and math aren’t that far apart. Music can very easily be generated and modeled mathematically, and the patterns that we observe in math can be applied to music. Several computer programs have been engineered that can independently create music without using a single note written by humans. These types of programs develop their own “musical grammar”, or system of organizing notes so that a discernable melody and accompanying harmonies can be developed, all using hard facts and mathematical computations.
Music is usually seen as very creatively and random, something that is unique to humans and can only be developed by our creative minds. Yet, mathematical principles and scientific concepts are right there behind it all, governing the way that creativity works and modeling chaos.
Read more about Euclidean algorithms here and the Music-generating program here.