Composing music with basic math

Composing music with basic mathematical knowledge: on Morrill’s “On the Euclidean Algorithm: rhythm without recursion”

Every mathematician can think of the relations between maths and music. The first thing that may come to your head are patterns. Repeating verses, choruses, repeated arrangements of numbers and sets that create sequences. So we may think there are methods or algorithms to produce cool musical rhythms. And yes! In this blog post we are going to be looking at a very simplified version of Godfried Toussaint’s Euclidian rhythms, Euclidean arrays.

This algorithm was proposed by Thomas Morrill on his recent paper “On the Euclidean Algorithm: rhythm without recursion” published on behalf of Trine University. This method proposes a way of doing music where the most difficult mathematical problem will be computing some number A reduced modulo B and you will be required to know the basics of modular algebra. For the maths enjoyers, it also solves the Diophantine equation:Given 0  ≤ k ≤ N, the Euclidean array E(k, N) is a three row matrix with N+1 columns. Each of the rows in the matrix have a special functionality for converting this matrix into music.

      • The first row of the EA (short for Euclidean array) is the arithmetic progression -1, 0, 1, 2, …, (N-1). The reason to start this progression with -1 is to make the EA start with a note, we will see the maths behind this later on.
      • The second row of the EA are constructed by multiplying the corresponding entry from row 1 by the integer k.
      • The last row, is the residue row. Each entry of this row is equal to each entry of row 2 reduced to modulo N. This is where the Euclidean name comes from, because when we deal with large integers, the Euclidean algorithm to compute the greatest common divisor will come in handy.

The elementary results regarding solving the Diophantine equation mentioned before are expressed in theorem 1:

Lemma 1 helps us understand what are we really doing when we build the EA. Theorem 1 is used to solve the Diophantine equation.

Now we move on to the part where numbers are converted into music, we are going to determine Euclidean Rhythms . In this part we will understand how numbers are turn into a rhythm.

First we will consider the residue row, the third row and we will locate each descent pair of entries. A pair of adjacent entries ( n[i], n[i+1] ) is called descent if and only if n[i] > n[i+1], otherwise, that is n[i] < n[i+1],  is called ascent. The i-th of our Euclidean Rhythm will be considered a quarter is the pair is a descent, otherwise it will be a silence.

Let’s consider the Euclidean array E(3,7) by instance:

We can see that in the residue row, there are three descendent notes, then 3 quarters will be in a pattern of 7 notes. The Euclidean rhythm corresponding to this Euclidean array is, where quarter is “q” and silence is “s”: [q,s,s,q,s,q,s]. More complex rhythms can be done with this method, even polyrhythms can be done. To get more impressive results, we can use another note different from silence and create more complex patterns, for example eights.

We have seen, the implicit relation of music and maths, and surely students taking courses related to discrete mathematics and number theory were entertained.  The construction of this arrays avoids using the Euclidean algorithm, which to do by hand can be pretty tedious.  But, will every pattern sound good? How far can we take this technique to really use it in the production of music with electronic software?

Morrill’s work brings a way of making beats and rhythms were no computers are needed. Every music producer nowadays, depends on software such as Ableton or FL Studio to produce music, so, being able to just use a pen and a paper to come up with ideas may be a cool way to be off the grid.

Rodrigo Morales Martínez

Bibliography: Morrill, T. On The Euclidean Algorithm: Rhythm Without Recursion, Trine University, Angola, Indiana, USA, June 28, 2022. Available at: https://arxiv.org/pdf/2206.12421.pdf

 

 

2 Replies to “Composing music with basic math”

  1. Rodrigo – I love thinking about the ‘math’ (or at least ‘logic’) behind music and what makes a particular song or piece so good. Musicians have been trying to solve that equation for millennia 🙂
    -Edie

  2. Anything, no matter how complex it may be, can somehow be analyzed, formulated or made into a pattern. It’s good to have a way to make music by means of a computer and by mathematics, to later know that what you have composed in an “analogical” way, has a plausible mathematical representation. Good job.

Leave a Reply

Your email address will not be published. Required fields are marked *