Merry Xmas Eve!

I'm not Christian, I'm Mathematician, but I love Xmas, Ymas and Zmas. I'm giving a talk on the math of tuning systems and I thought I'd share it here as a kind of present to y'all.

I'll start with the basics today and do the more advanced part tomorrow. But I hope even the basics contain a few twists that not everyone knows.

You can read my slides here:

http://math.ucr.edu/home/baez/tuning_talk/tuning_talk.pdf

but they don't contain all the stuff I'm saying here... the stuff I'll say out loud in my talk.

(1/n)

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.

(2/n)

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.

(3/ n)

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.

[Whoop, Lisa is making me get up, make breakfast and go to the gym. I'll continue this later.]

(4/n)

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.)

(5/n)

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!)

(6/n)

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 a 5 with a little hat.

(7/n)

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!

(8/n)

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 2^{1/12} 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.

(9/n)

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 notice a pattern here.

(10/n)

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.

(11/n)

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 *way* better. To beat it, we have to go all the way up to N = 29 - and even that is only slightly better.

(12/n)

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:

https://johncarlosbaez.wordpress.com/2023/10/19/perfect-fifths-in-equal-tempered-scales-part-2/

(13/n)

Here's the "star of fifths" in 12-tone equal temperament!

I'll quit here for now, and continue on Xmas.

(14/n)

Merry Xmas! My dream of the internet includes a lot of people giving each other gifts. Mastodon comes close to that. I'd like to thank everyone on Mastodon for all the you've gifts you've given each other over the year. Here are some presents in return....

Yesterday I talked about 12-tone equal temperament: the tuning system where we chop the octave into 12 equal parts.

This has been the 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.

(15/n)

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

2⁷ = 128

The ratio of these two is called the 'Pythagorean comma':

p = (3/2)^12 / 2⁷ = 3¹² / 2¹⁹ ≈ 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!

(16/n)

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!

(17/n)

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:

https://www.youtube.com/watch?v=7lWINJ9Dxxg

🐺

(18/n)

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 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'.

I'll explain this in some later installments. Maybe tomorrow. The British call it 'Boxing Day', because after Christmas with your relatives you sometimes feel like punching someone. But since I'm having a quiet day with Lisa, tomorrow I'll probably just explain just intonation.

(19/n)

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.

(20/n)

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.

(21/n)

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.

(22/n)

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!

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.

(23/n)

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.

(24/n)

@johncarlosbaez A discrete manifold equipped with an approximate scalar field? That sounds like it could be useful for some other stuff too