Pythagorean Tuning

:: Tuning With Harmonics

There are charming historic myths about Pythagoras discovering principles of music theory from observations of metal anvils and single string zithers, but this isn't a blog of music history.

Pythagorean tuning, regardless of how and when it was discovered, is a simple system for defining music. Our starting observation is that resonant objects which produce clear tones - from flutes to zithers to metal anvils struck with hammers - all of these have have "harmonics": faint higher frequencies on top of the low and clearly identifiable one, which together give the instrument a characteristic sound other than that of a pure sine wave. The low and most obvious frequency is called a "fundamental" or "fundamental frequency" and is usually also called a harmonic for mathematical convenience. People can hear the lower and stronger harmonics with a little bit of training, or you can dampen lower vibratory modes of some instruments to make the upper ones more apparent. This is particularly easy on plucked string instruments, and the internet will teach you how if you ask. The second harmonic we hear, i.e. the one directly above the fundamental frequency, is called the octave (or perfect eighth or P8) and has twice the frequency of the fundamental. The third harmonic has three times the base frequency and so on.

Pythagorean tuning uses only the second and third harmonics to generate an infinite family of related frequencies for mathematically precise music making. Pretty cool. We can also easily tune musical instruments to play these frequencies by, say, adjusting the frequency of one string on a zither until it matches a harmonic on a different string, or by adjusting until one of the harmonics on the adjusted string matches another string already tuned. For example, tune a string so that its second harmonic (2 * x) matches the third harmonic of a reference string (3 * fundamental) and by a little algebra we find that we've produced a new frequency {x} which is 

x = 3/2 * fundamental

three halves that of the reference frequency. Nice. We call it "the perfect fifth" or P5 for reasons we'll get into in a future post. This new frequency sounds great when played against the first frequency, let me tell you. They have lovely consonance together. You can really hear the small integers in your ears.

One way to conceptualize this system of interrelated tunings is that we start with a base frequency that tunes the whole system and then all other frequencies generated are related to the base frequency by a multiplicative factor with integer powers of 2s and 3s. The multiplicative factor is called a frequency ratio. A Pythagorean Octave has a frequency ratio of (2/1) and a Pythagorean Perfect Fifth has a frequency ratio of (3/2). And for completeness, let's note that a Pythagorean unison (or "perfect first" or P1) has a frequency ratio of (1/1). Not all intervals are Perfect: some are major or minor or diminished or augmented or other weirder things. But the simple ones are called perfect and they show up first.

It turns out that we hear frequencies logarithmically. What feels, looks, and sounds like "going up" one linear amount on an instrument, like one key up on a piano or one fret up on a guitar, is more like going a factor of 2^(1/12) up in frequency space. So we say intervals add, while frequencies multiply. I haven't defined intervals yet - those are in the next post - but the unison, the octave, and the perfect fifth are examples of intervals. For now, for this post only, you can think of intervals as  being names for frequency ratios when we're considering them additively rather than multiplicatively. Intervals have long names like "perfect fifth" and also short names like "P5". Let's look at a bunch in order to get familiar with them:

P1: unison (or perfect first)

P8: octave (or perfect eighth)

P5: perfect fifth

P4: perfect fourth

m2: minor second

M2: major second

m3: minor third

M3: major third

m6: minor sixth

M6: major sixth

m7: minor seventh

M9: major ninth

d5: diminished fifth

A4: augmented fourth

d2: diminished second

AA2: augmented augmented second (or twice augmented second)

dd0: diminished diminished zeroth

You may soon consider these to be close friends, if you don't already. The augmenting and diminishing of these intervals is intimately related to sharpening and flattening of pitches in sheet music. We'll talk about it more in a future post.

:: Generating A Chromatic Scale

If we start at the unison and keep on adding perfect fifths on top to get a larger frequency ratio, and then we drop the frequency ratio down an octave when the ratio is greater than (2/1), then we get a family of frequency ratios that lie between the unison and the octave. We can also start at the unison, subtract a perfect fifth, and add an octave if we get a frequency ratio less than (1/1). And this way we get even more frequencies that lie between the unison and the octave! Up and down, new friends to be found.

And now we're ready for the historic Pythagorean myth as I like to tell it. *clears throat* Once upon a time, Pythagoras wrote this table down, exactly as it appears below, on a goat skin parchment after eating some bad spanakopita: 


Coordinates : Frequency Ratio :: Interval Name

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

...

(-6, 4) : 1024/729 :: d5

(-5, 3) : 256/243 :: m2

(-4, 3) : 128/81 :: m6

(-3, 2) : 32/27 :: m3

(-2, 2) : 16/9 :: m7

(-1, 1) : 4/3 :: P4

(0, 0 ) : 1/1 :: P1

(1, 0) : 3/2 :: P5

(2, -1) : 9/8 :: M2

(3, -1) : 27/16 :: M6

(4, -2) : 81/64 :: M3

(5, -2) : 243/128 :: M7

(6, -3) : 729/512 :: A4

...

That's the whole myth. The coordinates in the first column tell us how many perfect fifths and how many octaves, respectively, you need to add up in this game of generating new intervals with frequency ratios between (1/1) and (2/1), starting at the bold line in the middle that represents unison, P1, and working outward. The next column in the table is the frequency ratio for the interval, and the last column has the modern name for the interval.

For example, look at the line above the bold unison line in the table. I'll even reproduce it for you:

(-1, 1) : 4/3 :: P4

If you go a perfect fifth below a unison and then an octave up, such that our coordinates are (-1, 1), then you get a frequency ratio of 4/3 relative to the base frequency. We call this interval the perfect fourth or P4.

We can write this in interval space as

- 1 * P5 + 1 * P8 = P4

We can also write this multiplicatively in frequency space:

(3/2)^(-1) * (2/1)^(1) = (4/3)

Here P5 is replaced with its frequency ratio of (3/2), and the octave is replaced with (2/1)  and what were multiplicative coefficients for added intervals have now become exponents for multiplied frequency ratios. But they're basically the same statement, at least in this post where we're only thinking about one tuning system.

You can keep adding on perfects fifths to extend the list downward from unison, and you can keep subtracting perfect fifth to extend the list upward. In doing so, the frequency ratios keep getting crazier, with larger numerators and denominators. 

Most interval names don't start with "perfect". For example, 

(2, -1) : 9/8 :: M2

you can stack two perfect fifths and then drop it down an octave to get a new interval x in the range 

P1 <  x < P8

Today we call that a major second, M2. 

Another example: Two perfect fifths below unison, raised by two octaves to put us in range again, are called a minor seventh, m7.

(-2, 2) : 16/9 :: m7

This frequency ratio generating procedure with the stacking fifth and the octave adjustments won't get you all possible intervals or frequency ratios: for example, it won't get you an octave, P8. It will get you infinitely many things arbitrarily close to P8 eventually, but not exactly. For that, you need to extend the table in the horizontal directions (i.e. adding and subtracting P8 repeatedly from the list above), for which you need a larger goat, or at least one with more surface area. Goat surface area was the limiting factor in early Greek music theory. 

But even if we only consider the table in the vertical direction, I stopped extending the table where I did for a good reason, besides goat surface area: the notes circled around! Kind of. The diminished fifth interval at the top, d5,  with a frequency ratio of 1024/729 ~= 0.4 is basically the same as the augmented fourth interval at the bottom, with a frequency ratio of 729/512 ~= 0.4. They're definitely not identical to human perception, but they're also definitely decently close.

And with them we have a chromatic scale. Its members are these: (P1, m2, M2, m3, M3, P4, d5, A4~P5, m6, M6, m7, M7).

Chromatic basically means that the members are fairly evenly spaced with small spaces between. I tried making a diagram to show how much they are not-quite evenly spaced and came up with this:

The figure on the top is Pythagorean, with both d5 and A4 shown straddling the middle (with A4 being the larger frequency ratio (the more rightward of the two). The figure on the bottom is evenly spaced (12-EDO), in which d5 merges with A4. The far left edge is zero steps in 12-EDO (the unison, P1) and the far right edge is 12 steps of 12-EDO (the octave, P8). There are lots of ways to define 12-EDO, but a common one is by saying that it's a tuning system which makes the interval between d5 and A4 disappear. We'll talk about this more in future posts.

It turns out that even-spacing (on the bottom) and small-integer-consonance (which Pythagorean tuning has) are both quite nice psycho-acoustically, and a lot of music theory is about finding ways to make our brains think we're getting both at once.

Nothing about Pythagorean tuning says that you have to stick to the chromatic intervals I listed above: it's convenient to have a known and fixed chromatic scale, but a composer more comfortable with microtonal music will use more of the interval space. For example, the medieval Iranian music theorist Safi al-Din al-Urmawi analyzed middle eastern microtonal music as being made of up notes from a 17-note scale made by continuing the Pythagorean spiral of fifths past the chromatic scale. And you don't even have to have a fixed scale. You could compose on a two-dimensional lattice where one direction is multiplying/dividing by P5 and the other direction is multiplying/dividng by P8. There are many options.

Unfortunately, Pythagorean tuning is kind of hard to use well as a fixed chromatic scale. It gives us a nice way to define musical intervals (in terms of P5 and P8) for scales that start on one note, but then you don't have the right notes/intervals/keys available for modulating to keys with other tonics. The chromatic scale [P1, m2, M2, m3, M3, P4, d5/A4, P5, m6, M6, m7, M7, P8] , if we start it on C natural, corresponds to these pitch classes [C, Db, D, Eb, E, F, F#/Gb, G, Ab, A, Bb, B, C]. Even if you have a split key to play both F# and Gb, this is still simply missing lots of basic familiar pitch classes. You can't really modulate to the key of D major, because there's no C#. For the key of E major, you'd need a C# and a G# and a D#, and they're all missing. If you try to play an E major chord as [E, Ab, B] using what's available on your fixed Pythagorean keyboard, instead of the correctly spelled E major chord, [E, G#, B], you're going to find that your "major third" is actually a diminished fourth at a frequency ratio of 8192/6561, which is 24 cents of the Pythagorean M3 and 16 cents flat of 12-EDO's M3. This is what we know in the business as "jank" or "scunge" or "hot garbage".

So, the tuned chromatic intervals are evenly spaced enough that we can call the set chromatic, but there are still some really bad sounding intervals between nearby notes that composers naturally reach for. Also, it turns out that humans like listening to fractions with powers of five in them just fine, and introducing powers of five will make lots of the frequency ratios simpler without sacrificing consonance, and perhaps the consonance even improves sometimes. We'll talk about it in the next post.

Let's talk a little bit more about what we can do well with Pythagorean tuning. By selecting elements of the Chromatic scale, we can make some other famous scales. For example,

Major scale: [P1, M2, M3, P4, P5, M6, M7, P8] 

Minor scale: [P1, M2, m3, P4, P5, m6, m7, P8] 

And many hundreds more, but that's a good start.

If you keep extending the table by stacking perfect fifths and adjusting octaves, you start to see lots of intervals are tuned about 23.5 cents away from another one. The interval difference that shows up repeatedly is the augmented zeroth, A0, with coordinates (12, -7) in the (P5, P8) basis, and the Pythagorean tuning systems tunes it to a frequency ratio of 531441/524288. It shows up so much that people gave it an irregular name: "the Pythagorean comma". This will show up in a future post on maqamat in Turkish, Arabic, and Persian music. In the mean time, here are some ways to generate the A0 interval besides stacking P5s:

A0 = M2 - d3

A0 = AA1 - M2

A0 = m3 - dd4

A0 = M3 - d4

A0 = P4 - dd5

A0 = A3 - P4

A0 = d5 - dd6

A0 = A4 - AA3

A0 = AA4 - P5

A0 = m6 - dd7

A0 = M6 - d7

A0 = AA5 - M6

A0 = m7 - dd8

A0 = A6 - m7

It's everywhere!

These should be read in the following way, taking the last line as an example: "The augmented zeroth is an augmented sixth minus a minor seventh".  In the next post, we'll talk a lot about this kind of interval arithmetic. The main principle is that adding and subtracting intervals is analogous to multiplying and dividing their frequency ratios. It's almost as though intervals are the logarithms of frequency ratios in this small way, though that analogy will not hold for long.

:: Audio

I'm generally of the opinion that human aesthetics for melodic intervals (those from one note to the next in time) are much looser than human aesthetics for harmonic intervals (those between notes sounded concurrently). Melodically, monophonic in Pythagorean tuning can sound just fine. It's when we make chords that things get... exotic. But not necessarily bad. Let's just hear the things.

Pythagorean major scale: ...

Pythagorean minor scale: ...

Pythagorean chromatic scale: ...

Comparing the Pythagorean chromatic scale to 12 tone equal temperament, we see that most Pythagorean intervals are nicely spaced (in the sense of being within, oh, 6 cents from the equally spaced marks), with a few somewhat spicy notes:

P1: 0 cents

m2: 90 cents (10 cents flat)

M2: 204 cents

m3: 294 cents

M3: 408 cents  (8 cents sharp)

P4: 498 cents

d5: 588 cents (12 cents flat)

A4: 612 cents (12 cents sharp)

P5: 702 cents

m6: 792 cents (8 cents flat)

M6: 906 cents

m7: 996 cents

M7: 1110 cents (10 cents sharp)

P8: 1200 cents


:: A Fuller Spiral of Fifths

I look up or calculate Pythagorean frequency ratios often enough that I'd like to have a bigger goat-skin table than the mythic one above. It's called a spiral of fifths rather than a circle of fifths because intervallic music theory doesn't collapse enharmonic distinctions like G# with Ab. Here the whole thing:

(-20, 12) 4294967296/3486784401 ddd5 | Gbbb

(-19, 12) 2147483648/1162261467 dd9 | Dbbb

(-18, 11) 536870912/387420489 dd6 | Abbb

(-17, 10) 134217728/129140163 dd3 | Ebbb

(-16, 10) 67108864/43046721 dd7 | Bbbb

(-15, 9) 16777216/14348907 dd4 | Fbb

(-14, 9) 8388608/4782969 dd8 | Cbb

(-13, 8) 2097152/1594323 dd5 | Gbb

(-12, 8) 1048576/531441 d9 | Dbb

(-11, 7) 262144/177147 d6 | Abb

(-10, 6) 65536/59049 d3 | Ebb

(-9, 6) 32768/19683 d7 | Bbb

(-8, 5) 8192/6561 d4 | Fb

(-7, 5) 4096/2187 d8 | Cb

(-6, 4) 1024/729 d5 | Gb

(-5, 3) 256/243 m2 | Db

(-4, 3) 128/81 m6 | Ab

(-3, 2) 32/27 m3 | Eb

(-2, 2) 16/9 m7 | Bb

(-1, 1) 4/3 P4 | F

(0, 0) 1 P1 | C

(1, 0) 3/2 P5 | G

(2, -1) 9/8 M2 | D

(3, -1) 27/16 M6 | A

(4, -2) 81/64 M3 | E

(5, -2) 243/128 M7 | B

(6, -3) 729/512 A4 | F#

(7, -4) 2187/2048 A1 | C#

(8, -4) 6561/4096 A5 | G#

(9, -5) 19683/16384 A2 | D#

(10, -5) 59049/32768 A6 | A#

(11, -6) 177147/131072 A3 | E#

(12, -7) 531441/524288 A0 | B#

(13, -7) 1594323/1048576 AA4 | F##

(14, -8) 4782969/4194304 AA1 | C##

(15, -8) 14348907/8388608 AA5 | G##

(16, -9) 43046721/33554432 AA2 | D##

(17, -9) 129140163/67108864 AA6 | A##

(18, -10) 387420489/268435456 AA3 | E##

(19, -11) 1162261467/1073741824 AA0 | B##

(20, -11) 3486784401/2147483648 AAA4 | F##

Highly useful.

A useful interval that's Pythagorean but not generated by a spiral of fifths is the diminished second, d2. It will show up a lot in future posts. Here are the (P5, P8) coordinates and the frequency ratio in Pythagorean tuning :

(-12, 7) : 524288/531441 :: d2

This doesn't show up in our spiral of fifths because it's out of range: the frequency ratio is slightly smaller than 1/1, at ~ 0.9865. We could have constructed the coordinates and the frequency ratio for the d2 by hand by diminishing the minor second, i.e. subtracting an augmented unison from the minor second.

m2 - A1 = d2

which corresponds to division with the frequency ratios:

(256/243) / (2187/2048) = (531441/524288)

In general, diminishing a minor Nth or perfect Nth interval will produce a diminished Nth interval.

This diminished second, d2, is also the inverse of the augmented zeroth, A0, that showed up all over the place as a difference of intervals. What does it mean for one interval to be the inverse of another? One way to think of it is that the interval coordinates cancel out in summation to P1 = (0, 0), i.e. they have opposite signs from each. Compare:

(-12, 7) : 524288/531441 :: d2

(12, -7) : 531441/524288 :: A0

and you'll see why we can make (equivalent) statements of interval arithmetic like

A0 + d2 = P1

P1 - d2 = A0

P1 - A0 = d2

with total confidence.

Another way to think about inversion is that the frequency ratios are flipped. This has the consequence that multiplying the frequency ratios of d2 and A1 produces 1/1, which is the frequency ratio for P1. Pretty cool.

And that's it - our first foray into microtonal music. Not too scary, right? We' learned a little about the historic foundations of western music and we got a little bit familiar with intervals and frequency ratios that make up normal scales like the chromatic, the major, and the minor. Some of it sounded fine, some of it sounded bad, and maybe some of it sounded kind of middle eastern? We'll work on making it sound better shortly. But all in all, it's not too scary. It's just normal music made from harmonics, because they're an easy way to tune instruments and generate notes.