Intervals and Tuning Systems

:: What are intervals?

Intervals are a group of mathematical objects that we can add and subtract from each other. They have names consisting of an interval quality like (Perfect, Major, Minor, Augmented, Diminished, ...) and an ordinal number, like (First, Second, Third, ...). Intervals can be thought of as the signed distance between pitches (which are not the same as frequencies), but I'll try to define an algebra of intervals here without reference to pitches. Intervals are not names for frequency ratios: an interval can be associated to frequency ratio within a tuning system, and people working in a given tuning system often forget that the associated things are not identical. The perfect unison, P1, is always an identity element of interval addition, so you might be tempted to say that P1 is at least a name for the frequency ratio (1/1), but I'm here to dissuade you of the notion. Different things. Keep them separate or you'll start saying mathematical nonsense like "The 19-EDO tuning systems tempers out 81/80, i.e. equates the frequency ratio to 1/1." Intervals can be tempered out, frequency ratios can not, and if you conflate the two, people will look at you funny on account of your grade school arithmetic mistakes.

One space of intervals is the "rank-2 intervals". In the previous post on Pythagorean tuning, we generated some rank-2 intervals by combining two intervals as basis elements, the perfect fifth and the octave. With three independent basis elements, we could have modelled the space of rank-3 intervals. With four basis elements, rank-4 intervals. And so fourth.

The Pythagorean tuning system associates the basis intervals P5 and P8 to the frequency ratios (3/2) and (2/1) respectively, and from that association (and from the rules of naming and manipulating intervals that we'll talk about in this post), we can generate frequency ratios for every other rank-2 interval. Pythagorean tuning happened to be a just intonation system, meaning that every interval was associated with a ratio of integers for its frequency ratio. This won't always be the case: some tuning systems will associate intervals to irrational values, or to a mix of rational and irrational values.

I won't prove it here, but interval spaces happen to be free Abelian groups, with members representable as tuples of integers. The coordinates that we used in the post on Pythagorean tuning, like (-1, 1) for P4, are just such tuples of integers. You can do arithmetic on those integers just like vectors, so that e.g. P4 + P4 = (-2, 2) in the Pythagorean basis.

:: Interval Algebra

Let's talk about how to name and manipulate intervals and then we'll explore some famous tuning systems that associate intervals to frequency ratios. There's a cool basis made up of the augmented unison and the diminished second, (A1, d2), that the great E. J. Lilley used to teach rank-2 interval algebra, and we shall use it as well.

Lilley's (A1, d2) basis is beautiful in many ways. One nice thing about it is that the A1 component for an interval tells you how many semitones/half-steps the interval will be when tuned to 12-TET. This is a thing many musicians have memorized: for example, a perfect fifth, P5,  in the (A1, d2) basis has coordinates  (7, 4), and a perfect fifth played on a standard 12-TET guitar is a distance 7 frets up from a reference pitch. Likewise, for a standard 12-TET piano and the number of keys. The d2 component of an interval expressed in the (A1, d2) basis is also beautiful: it's just the interval's ordinal, as a numeral, minus one. These two facts let me generate coordinates for many intervals off the top of my head, including all of the standard natural chromatic intervals. Here are a few intervals in the (A1, d2) basis:


P1: (0, 0)

d2: (0, 1)

A1: (1, 0)

m2: (1, 1)

M2: (2, 1)

m3: (3, 2)

M3: (4, 2)

P4: (5, 3)

A4: (6, 3)

d5: (6, 4)

P5: (7, 4)

m6: (8, 5)

M6: (9, 5)

m7: (10, 6)

M7: (11, 6)

P8: (12, 7)

.

I don't know coordinates for half of those intervals in the Pythagorean basis, (P5, P8), without doing some calculation. Lilley's system is tremendously satisfying in how well it fits in my head and I hope you can learn to love it too.

Here are some rules for manipulating rank-2 intervals and figuring out the new interval names:

Now, here's the algorithm for figuring out the name for an arbitrary interval x, represented in (A1, d2) coordinates with some random numbers like (11, 8):

That's it. Now you can figure out the name for the interval with coordinates (60, 38) or any other random noise. Reversing this procedure to find coordinates given a name is a task of comparable complexity and nearly identical steps. I'll post some python code soon in case you don't want to do it by hand.

:: Change Of Interval Basis

Now let's talk a little bit about how to convert coordinates between different bases and then we'll discuss some famous rank-2 tuning systems!

First, suppose you have interval coordinates (a, b) expressed in the Pythagorean (P5, P8) basis. To convert to the (A1, d2) basis, first find the old basis vectors in the new basis:

P5 = (7, 4)

P8 = (12, 7)

Then left multiply the row vector (a, b) by the matrix {{7, 4}, {12, 7}}, producing a new row vector in the new basis. To transform coordinates for an interval in the (A1, d2) basis into the Pythagorean basis, you can just find the inverse of the matrix above and do the same multiplication with it.

If you don't want to invert a matrix, E. J. Lilley has got you covered. Using Cramer's rule, he's given a closed-form solution for changing the basis of an interval with known coordinates into coordinates of another rank-2 tuning systems. First, find the coordinates for the new basis intervals in a basis you know, like (A1, d2). Call the coordinates base1 = (a, b) and base2 = (c, d). Also find (A1, d2) coordinates for the interval you want to re-express in the new basis. We'll call the old coordinates (m, n) and the new coordinates in the (base1, base2) basis will be called (x, y). Then by a manipulation of determinants, Cramer and Lilley give:

x = (dm - cn) / (ad - bc)

y = (an - bm) / (ad - bc)

If you know coordinates for an interval in an unfamiliar basis and what to know what they are in (A1, d2) so you can figure out the name, then the left-multiplication matrix trick will serve you better. For example, in the last post we talked about the Pythagorean comma, with coordinates (12, -7). How could we verify that it is indeed an augmented zeroth interval? Just input

{12, -7} * {{7, 4}, {12, 7}}

into wolfram alpha, and you'll get (0,  -1) back as your (A1, d2) coordinates. From the -1 in the d2 component, we know this is some kind of zeroth interval. Next we have to figure out the quality: add an octave, (12, 7), to put the d2 component in the range [0, 7), and you get (12, 6), which is once augmented from our old friend M7 = (11, 6), so the original interval is an A0. I know that feels like a lot: in practice, you get a program to do it and I'll post programs on here soon enough. But it's helpful to know the steps in case you're away from your computer.

Lots of people in the microtonal community like to use the (P8, P12) basis. The P8 is justly tuned to 2/1, and the P12 is justly tuned to 3/1, so this is a "3-limit prime harmonic basis". Let's figure out how to convert intervals in (P8, P12) to the (A1, d2) basis, so that we can name those intervals.

Let's say you have some crazy interval like (-84, 53) in the (P8, P12) basis. If you know that P8 is (12, 7) in the (A1, d2) basis and P12 is P8 over P5, i.e. (12, 7) + (7, 4) = (19, 11), then you're all set.  Copy paste into WolframAlpha:

(-84, 53) * ((12, 7), (19, 11))

and you'll see that the interval (-84, 53) in th e(P8, P12) basis is (-1, -5) in the (A1, d2) basis. You can also use Cramer's rule and the fact that the Pythagorean A1 (justly tuned to 2187/2048) has coordinates (-11, 7) in the (P8, P12) basis, and the Pythagorean d2 (justly tuned to 524288/531441) has coordinates (19, 12) in the (P8, P12) basis. These coordinates are just the exponents of the primes in the just frequency ratios. Easy to calculate.

Then we just do

m, n = (-84, 53)

a, b = (-11, 7) # Pythagorean A1 (justly tuned to 2187/2048) in the (P8, P12) basis

c, d = (19, -12) # Pythagorean d2 (justly tuned to 524288/531441) in the (P8, P12) basis.

x = (d * m - c * n) / (a * d - b * c)

y = (a * n - b * m) / (a * d - b * c)

With the same result. Easy peasy. You may also note that the ((12, 7), (19, 11)) matrix and the ((-11, 7), (19, -12)) matrix are inverse to one another.

After a little figuring, we see that (-1, -5) is an AAAAAAA-4. This interval was studied by the 17th-century German mathematician Nicholas Mercator and is also called Mercator's comma in his honor. We'll talk about it more in the post on middle eastern maqam music.

:: Tuning Intervals To Frequency Ratios

Ok. We've talked a little bit about what intervals are generally, and we've seen a lot of specifics of what rank-2 intervals are like. Intervals of higher rank are pretty much the same, but you add on some adjectives / qualities for each added dimension. The naming rules will change a little, partly to accommodate the new qualities and partly because we sometimes want to change the relationships between old intervals. We'll talk more about that in the posts on 5-limit just intonation (which is rank-3) and 7-limit just intonation (which is rank-4).

But for now, there's a lot of math and theory to be done for rank-2 intervals, so let's talk about some rank-2 tuning systems. A tuning system is just a set of basis intervals along with frequency ratios for each.

I'll use a lower case "t" as a function symbol to indicate the action of a tuning system on an interval, i.e. to indicate tuning an interval to a frequency ratio.

Pythagorean tuning is defined by t(P5) = 3/2 and t(P8) = 2/1. So far I've been putting the P5 component first in tuples; which order you choose for the components isn't mathematically important,  you just have to stick to some convention. Honestly, there's an aesthetic reason that will show up later why I should have gone the other way, but this is fine for now.

Now for some new tuning systems:

Pythagorean tuning only uses powers of 2 and 3 to make frequency ratios. But it turns out that frequency ratios with 5s in the factors are quite lovely, and arguably the 2nds, 3rd, 6ths, and 7ths sound better with factors of 5 in them. The right way to deal with this is to upgrade to rank-3 intervals, and in particular to a tuning system called 5-limit just intonation. The "5-limit" means the ratios contains primes up to 5, and the "just intonation" means that all the frequency ratios are rational, i.e. ratios of integers. We'll define 5-limit just intonation fully in a future post, but right away let's look at how it simplifies Pythagorean frequency ratios for the major and minor intervals:

m2:  256/243  →  16/15

M2:    9/8    →  10/9

m3:   32/27   →   6/5

M3:   81/64   →   5/4

m6:  128/81   →   8/5

M6:   27/16   →   5/3

m7:   16/9    →   9/5

M7:  243/126  →  15/8

You could argue that the tuned Major Second looks a little worse, but on the whole it's a massive improvement.

Musicians, composers, and teachers are slow to adopt 5-limit just intonation, or even fully disinterested. One work-around is a rank-2 tuning system called Quarter-Comma Meantone which imports a little bit of 5-limit just intonation tuning while still using the rank-2 interval space. Quarter-Comma Meantone can defined over rank-2 intervals as:

t(P8) = 2/1

t(M3) = 5/4

The first of those two specifications is sometimes summarized as saying that the system has "pure" octaves. People love pure octaves and all the famous tuning systems have pure octaves, so I might just say "it's defined by X and pure octaves" in the future for other tuning systems. The next condition says to tune the Major third as though we were in 5-limit just intonation. This slightly flattens the perfect fifth from its' Pythagorean tuned value.

If you keep the octave pure but tune the minor third to its 5-limit version,

t(m3) = 6/5

Then you get something called Third-comma meantone. There are many meantone options. We'll talk about them in the chapter on temperament tuning system.

Generally in a meantone tuning system, the perfect fifths are flattened a little bit so that the major thirds are tuned closer to their 5-limit just intonation values. The name actually comes from the fact that the "whole tone", the major second, is tuned somewhere between the 3-limit and the 5-limit values. The "comma" refers to an interval historically called the "syntonic comma", which today is more properly called an acute unison, Ac1. In 5-limit just intonation, Ac1 is tuned to 81/80. If you're of the position that we can scale intervals, instead of just adding and subtracting them, then there's an argument that one quarter of the interval Ac1 is like the fourth root of the frequency ratio, and it just so happens that the P5 in quarter comma meantone is flattened by this fourth of a comma, i.e. you divide (3/2) by ( 81/ 80 )^(1⁄4). When you simply that expression, you see that in quarter comma meantone, the tuned value of P5 is

t(P5) = 5^(1/4) ~ 1.49535

which is still very close to the the old (3/2) = 1.5.

I just told you the tuned value for P5 in Quarter-Comma Meantone, but you don't have to take my word for it. Let's calculate. We've said that a tuning system induces a tuning over all the intervals of a space by specifying tuning for a set of basis intervals.

Let's start by reminding ourselves of the coordinates for M3, P5, and P8 in the (A1, d2) basis:

M3 = (4, 2)

P5 = (7, 4)

P8 = (12, 7)

Let's assocaite variables with all six of those components:

(m, n) = (7, 4)

(a, b) = (4, 2)

(c, d) = (12, 7)

and now perform a change of basis to get an interval (x, y) in the (P8, M3) basis:

x = (dm - cn) / (ad - bc) = (7 * 7 - 12 * 4) / (4 * 7 - 2 * 12) = 1/4

y = (an - bm) / (ad - bc) = (4 * 4 - 2 * 7) / (4 * 7 - 2 * 12) = 1/2

Now that we have coordinates, we can perform the actual tuning. Analogous to

P5 = x * M3 + y * P8

we have

t(P5) = t(M3)^x * t(P8)^y

when we substitute in the tuned values of M3 and P8 for quarter comma meantone, we get

t(P5) = (5/4)^(1/4) * (2/1)^(1/2) = 5^(1/4)

as promised.

:: EDO Tuning Systems

You might be wondering about the modernity's favorite tuning system, twelve-tone equal-temperament. Is it a rank-2 tuning system like Pythagorean? Or rank-3 like 5-limit just intonation? It's rank 2! Another name for it is 12-EDO, which stands for "12 equal divisions of the octave". There are lots of rank-2 tuning systems that divide the octave into logarithmically equal parts.

Our basic 12-EDO is defined by pure octaves and

t(d2) = 1/1

Tuning an interval to (1/1) is called "tempering" and all of the EDO tuning systems can be defined by a tempered out interval. The rank-2 Lilley basis, (A1, d2), makes it very easy to understand the effect of tempering out d2: the d2 component stops influencing the tuned frequency ratio for an interval, so that intervals with the same A1 component will have the same frequency ratio.

We can also look at 12-EDO through the lens of the tuning formula:

t(z) = t(d2)^x * t(P8)^y

For some interval {z}, which will determine the values of {x} and {y}. Since t(d2) = 1, and 1 raised to any power {x} is still1, then all the frequency ratios will be of the form 

t(z) = 2^y

Let's do a frequency calculation in a little more detail so we can probe the structure of the exponent {y}. For an interval (m, n) in the (A1, d2) basis that we want to tune in 12-EDO, we'll have basis intervals:

d2 = (a, b) = (0, 1)

P8 = (c, d) = (12, 7)

The {x} value can be ignored because of tempering and the {y} value will have the usual form from the Cramer-Lilley formula:

y = (an - bm) / (ad - bc) = (0 * n - 1 * m) / (0 * 7 - 1 *12) = m / 12

Again we see that the A1 component determines the frequency ratio. We also see where the "12" in "12-EDO" comes from: it's the denominator of the fractional power.

There are lots of other EDO tuning systems, and we'll talk about them in the EDO-generators post. For now, here are intervals that can be tempered out to make some of my favorite EDOs:

t(d2) = 1 # 12-EDO

t(dd2) = 1 # 19-EDO

t(dddd3) = 1 # 31-EDO

t(dddddd6) = 1 # 46-EDO

t(ddddddd6) = 1 # 53-EDO

.