
I’m giving a talk on the math of tuning systems at Claremont McKenna College on January 30th at 11 am. If you’re around, please come! You can read my slides here:
• The mathematics of tuning systems.
But my slides don’t contain all stuff I’ll write here… the stuff I’ll say out loud in my talk.
If you look at a piano keyboard you’ll see groups of 2 black notes alternating with groups of 3. So the pattern repeats after 5 black notes, but if you count you’ll see there are also 7 white notes in this repetitive pattern. So: the pattern repeats each 12 notes.
Some people who never play the piano claim it would be easier if had all white keys, or simply …

I’m giving a talk on the math of tuning systems at Claremont McKenna College on January 30th at 11 am. If you’re around, please come! You can read my slides here:
• The mathematics of tuning systems.
But my slides don’t contain all stuff I’ll write here… the stuff I’ll say out loud in my talk.
If you look at a piano keyboard you’ll see groups of 2 black notes alternating with groups of 3. So the pattern repeats after 5 black notes, but if you count you’ll see there are also 7 white notes in this repetitive pattern. So: the pattern repeats each 12 notes.
Some people who never play the piano claim it would be easier if had all white keys, or simply white alternating with black. But in fact the pattern makes it easier to keep track of where you are – and it’s not arbitrary, it’s musically significant.
For one thing white notes give a 7-note scale all their own. Most very simple songs use only this scale! The black notes also form a useful scale. And the white and black notes together form a 12-tone scale.

Starting at any note and going up 12 notes, we reach a note whose frequency is almost exactly double the one we started with. Other spacings correspond to other frequency ratios.
I don’t want to overwhelm you with numbers. So I’m only showing you a few of the simplest and most important ratios. These are really worth remembering.

We give the notes letter names. This goes back at least to Boethius, the guy famous for writing The Consolations of Philosophy before he was tortured and killed at the order of Theodoric the Great. (Yeah, “Great”.) Boethius was a counselor to Theodoric, but he really would have done better to stay out of politics – he was quite good at math and music theory.
Boethius may be the reason the lowest note on the piano is called A. We now repeat the names of the white notes as shown in the picture: seven white notes A,B,C,D,E,F,G and then it repeats.

So the scale used to start at A, using only white notes. But due to the irregular spacing of white notes, a scale of all white notes sounds different depending on where you start. Starting at A gives you the “minor scale” or “Aeolian mode”, which sounds kinda sad. Now we often start at C, since that gives us the scale most people like best: the “major” scale.
(Good musicians start wherever they want, and get different sounds that way. But “C major” is like the vanilla ice cream of scales – now. It wasn’t always this way.)

From the late 1100s to about 1600 people called describe pitches that lie outside 7-tone system “musica ficta” (“false” or “fictitious”) notes. But gradually these notes – the black keys on the piano if you’re playing in C major – became more accepted.
To keep things simple for mathematicians, I’ll usually denote these with the “flat” symbol, ♭. For example, G♭ is the black note one down from the white note G.
(Musicians really need both flats and sharps, and they’d also call G♭ something else: F♯. I’ll actually need both G♭ and F♯ at some points in this talk!)

Since starting the scale with the letter C takes a little practice, I’ll do it a different way that mathematicians may like better. I’ll start with 1 and count up. Musicians put little hats on these numbers, and I’ll do that.
For example, we’ll call the fifth white note up the scale the “fifth” and write it as

Now for the math of tuning systems!
The big question is: how do we choose the frequency of each note? This is literally how many times per second the air vibrates, when we play that note.
Since 1850, by far the most common method for tuning keyboards has been “12-tone equal temperament”. Here we divide each octave into 12 equal parts.
What do I mean by this, exactly? I mean that each note on the piano produces a sound that vibrates faster than the note directly below it by a factor of the 12th root of 2.
But we can contemplate “N-tone equal temperament” for N = 1, 2, 3, …. – and some people do use these other tuning systems!

Here’s a picture of the most popular modern tuning system: 12-tone equal temperament. As we march around clockwise, each note has a frequency of times the note directly before it.
When we go all the way around the circle, we’ve gone up an octave. That is, we’ve reached a frequency that’s twice the one we started with.
But a note that’s an octave higher sounds “the same, only higher”. So in a funny way we’re back where we started.

But now for a big question: why do we use a scale with 12 notes?
To start answering, notice that we actually use three scales: one with 5 notes (the black keys), one with 7 (the white keys) and one with 12 (all the keys).
As mathematicians we can detect a highly nonobvious pattern here.

What’s so good about scales with 5, 7 or 12 notes?
A crucial clue seems to be the “fifth”. If you go up to the fifth white note here, its frequency is about 3/2 times the first. This is one of the simplest fractions, and it sounds incredibly simple and pure. So it’s important. It’s a dominant force in western music.

We can make a chart to see how close an approximation to the fraction 3/2 we get in a scale with N equally spaced notes.
N = 5 does better than any scale with fewer notes!
N = 7 does better than any scale with fewer notes!
N = 12 does better than any scale with fewer notes! And it does much better. To beat it, we have to go all the way up to N = 29—and even that is only slightly better.

Here’s a chart of how close we can get to a frequency ratio of 3/2 using N-tone equal temperament.
See how great 12-tone equal temperament is?
There are also some neat patterns. See the stripes of even numbers and stripes of odd numbers? That’s not a coincidence. For more charts like this, and much more cool stuff along these lines, go here.

Here’s the “star of fifths” in 12-tone equal temperament!

12-tone equal temperament is most popular tuning system since maybe 1810, or definitely by 1850. But it’s mathematically the most boring of the tuning systems that have dominated Western music since the Middle Ages. Now let’s go back much earlier, to Pythagorean tuning.
When you chop the octave into 12 equal parts, the frequency ratios of all your notes are irrational numbers… except when you go up or down some number of octaves.
The Pythagoreans disliked irrational numbers. People even say they drowned Hippasus at sea after he proved that the square root of 2 is irrational! That’s just a myth, but it illustrates how people connected Pythagoras to a love of rational numbers. In Pythagorean tuning, people wanted a lot of frequency ratios of 3/2.
In equal temperament, where we chop the octave into 12 equal parts, when we start at any note and go up 7 of these parts (a so-called “fifth”), we reach a note that vibrates about 1.4981 times as fast. That’s close enough to 3/2 for most ears. But it’s not the Pythagorean ideal!
As we’ll see, seeking the Pythagorean ideal causes trouble. It will unleash the devil in music.

Start at some note and keep multiplying the frequency by 3/2, like a good Pythagorean. After doing this 12 times, you reach a note that’s close to 7 octaves higher. But not exactly, since the 12th power of 3/2 is
129.746338
which is a bit more than
27 = 128
The ratio of these two is called the “Pythagorean comma”:
p = (3/2)12 / 27 = 312 / 219 ≈ 1.0136
This is like an unavoidable lump in the carpet when you use Pythagorean tuning.
It’s good to stick the lump in your carpet under your couch. And it’s good to stick the Pythagorean comma near the so-called “tritone”—a very dissonant note that you’d tend to avoid in medieval music. This note is halfway around the circle of fifths.
In Pythagorean tuning, going 6 steps clockwise around the circle of fifths doesn’t give you the same note as going 6 steps counterclockwise! We call one of them ♭5 and the other ♯4.
Their frequency ratio is the Pythagorean comma!

In equal temperament, the tritone is exactly halfway up the octave: 6 notes up. Since going up an octave doubles the frequency, going up a tritone multiplies the frequency by √2. It’s no coincidence that this is the irrational number that got Hippasus in trouble.
In Pythagorean tuning, going 6 steps up the scale doesn’t match jumping up an octave and then going 6 steps down. We call one of them ♭5 and the other ♯4. They’re both decent approximations to √2, built from powers of 2 and 3.
Their frequency ratio is the Pythagorean comma!

The tritone is sometimes called ‘diabolus in musica’ – the devil in music. Some say this interval was actually banned by the Catholic church! But that’s another myth.
It could have gotten its name because it sounds so dissonant – but mathematically, the ‘devil’ here is that the square root of 2 is irrational. If we’re trying to use only numbers built from powers of 2 and 3, we have to arbitrarily choose one to approximate √2.
In Pythagorean tuning we can choose either
1024/729 ≈ 1.4047
called the sharped fourth, ♯4, or
729/512 ≈ 1.4238
called the flatted fifth, ♭5, to be our tritone. In this chart I’ve chosen the ♭5.
No matter which you choose, one of the fifths in the circle of fifths will be noticeably smaller than the rest. It’s called the ‘wolf fifth’ because it howls like a wolf.
You can hear a wolf fifth here:

If you’re playing medieval music, you can easily avoid the wolf fifth: just don’t play one of the two fifths that contains the tritone!
A more practical problem concerns the “third”: the third white note in the scale. Ideally this vibrates 5/4 as fast as the first. But in Pythagorean tuning it vibrates 81/64 times as fast. That’s annoyingly high!
Sure, 81/64 is a rational number. But it’s not the really simple rational number our ears are hoping for when we hear a third.
Indeed, Pythagorean tuning punishes the ear with some very complicated fractions. The first, fourth, fifth and octave are great. But the rest of the notes are not. There’s no way that 243/128 sounds better than an irrational number!
In the 1300s, when thirds were becoming more important in music, theorists embraced a beautiful solution to this problem, called “just intonation”. Now let’s talk about that.

It’s an amazing fact that in western composed music, harmony became important only around 1200 AD, when Perotin expanded the brand new use of two-part harmony to four-part harmony.
This put pressure on musicians to use a new tuning system—or rather, to revive an old tuning system. It’s often called ‘just intonation’ (though experts will find that vague). We can get using a cool trick, though I doubt this is how it was originally discovered.
First, draw a hexagonal grid of notes. Put a note with frequency 1 in the middle. Label the other notes by saying that moving one step to the right multiplies the frequency of your note by 3/2, while going up and to the right multiplies it by 5/4.

Next, cut out a portion of the grid to use for our scale. We use this particular parallelogram—you’ll soon see what’s so great about it.

Now, multiply each number in our parallelogram by whatever power of 2 it takes to get a number between 1 and 2.
We do this because we want frequencies that lie within an octave, to be notes in a scale. Remember: if 1 is the note we started with, 2 is the note an octave up.

Now we want to curl up our parallelogram to get a torus. If we do this, gluing together opposite edges, there will be exactly 12 numbers on our torus—just right for a scale! This is a remarkable coincidence.
There’s a problem: the numbers at the corners are not all equal. But they’re pretty close! And they’re close to √2: the frequency of the tritone, the ‘devil in music’.
25/18 = 1.3888… 45/32 = 1.40625 64/45 = 1.4222… 36/25 = 1.44
So we’ll just pick one.

When we curl up our parallelogram to get a torus, there’s also another problem. The numbers along the left edge aren’t equal to the corresponding numbers at the right edge. But they’re close! Each number at right is 81/80 times the corresponding number at left. I’ve drawn red lines connecting them.
So, we just one from each of these 4 pairs. We’ve already picked one number for all the corners, so we just need to do this for the remaining 2 pairs.

So, here are the various choices for notes in our scale!
For the tritone we have 4 choices. That’s okay because this note sucks anyway. That is: in Western music from the 1300s, it was considered very dissonant. So there’s no obviously best choice of how it should sound.
For the 2 we have two choices, and for the ♭7 we also have 2 choices. So there’s a total of 16 possible scales here.
Regardless of how we make our choices, we’ll get really nice simple fractions for the 1, ♭3, 3, 4, 5 ,♭6, 6, and 8. And that makes this approach, called ‘just intonation’, really great!
(If you like math: notice the ‘up-down symmetry’ in this whole setup. For example the minor second is 16/15, but the reciprocal of that is 15/16, which is the seventh… at least after we double it to get a number between 1 and 2, getting 15/8.)

Here’s a chart of all possible just intonation scales: start at the top and take any route you want to the bottom. There are 16 possible routes.
A single step between notes in a 12-tone scale is called a ‘semitone’, since most white notes are two steps apart. In just intonation the semitones come in 4 different sizes, which is kind of annoying.
Notice that if we choose our route cleverly, we can completely avoid the large diatonic semitone. Or, we can avoid the greater chromatic semitone. But we can’t avoid both. So, we can get a scale with just 3 sizes of semitone, but not fewer.
How should we choose???

This is the most commonly used form of just intonation, I think. It’s the only choice that has all of these features:
1) It has up-down symmetry except right next to the tritone in the middle, where this symmetry is impossible.
2) It uses 9/8 for the second rather than 10/9, which is a bit nicer – a simpler fraction.
3) It completely avoids the large diatonic semitone, which is the largest possible semitone.
4) It never has two of the same kind of semitone next to each other.
Features 3) and 4) determine what we do near the tritone. I don’t actually think those are convincingly “good” features of a scale from a musical standpoint. So, we should think about this more. But let’s see what this scale looks like on the keyboard!

Here’s the most common scale in just intonation!
The white notes are perhaps the most important here, since those give the “major scale”. The fractions here are beautifully simple.
Well, okay: the second (9/8) and seventh (15/8) are not so simple. But that’s to be expected, since these notes are the most dissonant! Of these, the seventh was more important in the music of the 1300s, and even today. It’s called the ‘leading-tone’, because we often play it right near the end of a piece of music, or a passage within a piece of music, and its dissonance leads us up to the octave, with a tremendous sense of relief.

Here’s the really great thing about the white notes in just intonation. They form three groups, each with frequencies in the ratios
1 : 5/4 : 3/2
or in other words,
4 : 5 : 6
This pattern is called a “major triad” and it’s absolutely fundamental to music—perhaps not so much in the 1300s, but certainly as music unfolded later. Major triads became the bread and butter of music, and still are.
The fact that every white note—that is, every note in the 7-note “major scale”—lies in a mathematically perfect major triad is a gigantic feature in favor of just intonation.
Listen to the difference between some simple chords in just intonation and in equal temperament. You probably won’t hate equal temperament, but you can hear the difference. Equal temperament vibrates as the notes drift in and out of phase.

But let’s take a final peek at the dark underbelly of just intonation: the tritone. As I mentioned, there are four choices of tritone in just intonation. They come in two pairs that are separated by a ratio of 81/80, and two pairs separated by a ratio of 128/125.
These numbers are fundamental glitches in the fabric of music. They have names! People have been thinking about them at least since Boethius around 500 AD, but probably earlier.
• The ‘syntonic comma’, 81/80, is all about trying to approximate a power of 3 by products of 2’s and 5’s.
• The ‘lesser diesis’, 128/125, is all about trying to approximate powers of 2 by powers of 5.
If these numbers were 1, music would be beautiful in a very simple way. But reality cannot be wished away.
And as we’ll see, these numbers are lurking in the spacing between notes in just intonation—not just near the tritone, but everywhere!

Look! The four kinds of semitone in just intonation are related by the lesser diesis and syntonic comma!
In this chart, adding vectors corresponds to multiplying numbers. For example, the green arrow followed by the red one gives the dark blue one, so
25/24 × 81/80 = 135/138
Or in music terminology: the lesser chromatic semitone times the syntonic comma is the greater chromatic semitone.
And so on.
The parallelogram here is secretly related to the parallelogram we curled up to get the just intonation scale. Think about it! Music holds many mysteries.

Just intonation is great if you’re playing in just one “key”, always ending each passage with the note I’ve been calling 1. But when people started trying to “change keys”, musicians were pressed into other tuning systems.
This is a long story, which I don’t have time to tell right now. If you’re curious, read my blog articles about it!
• For more on Pythagorean tuning, read this.
• For more on just intonation, read this series.
• For more on quarter-comma meantone tuning, read this series.
• For more on well-tempered scales, read this series.
• for more on equal temperament, read this series.
It’s sad in a way that this historical development winds up with equal temperament: the most boring of all the systems, which is equally good, and thus equally bad, in every key. But the history of music is not done, and computers make it vastly easier than ever before to explore tuning systems.
What will come next? It’s up to us. I hope next year you explore more of the wonders of music.
This entry was posted on Friday, December 26th, 2025 at 2:45 pm and is filed under mathematics, music. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.