Just Intonation

Background

On the surface, just intonation is perfect tuning. Dig a little deeper and it's no longer that, but rather tuning based off of rational intervals.

I'm going to assume we already know a few terms that deal with music theory, introductory physics, and mathematics. Please take a break if this gets confusing. I know first-hand that there is a lot of jargon in the realm of microtuning, and it's easy to get out of control fast.

A rational interval is a tone that is a perfect ratio of the frequency of a root tone.

The simpler the ratio between two frequencies, the more consonant (or "harmonious," colloquially speaking) the notes sound together. I'm going to assume that simpler numbers are smaller numbers. It will get more convenient later on to also assume that numbers with smaller prime factors are simpler. For example 12 is a simpler number to place in a ratio than 11, because 12 has prime factors 2 and 3, and 11 is itself prime.

Unison, and the Octave

The simplest ratio here is 1:1 - unison. Two tones are in perfect unison when their frequencies are exactly the same.

Next 2:1 - the octave. This is the interval which is almost universally prioritized over different musical cultures. If you have a tone with a frequency of 100 Hz, and you add a 200 Hz tone, you will hear an octave. The consonance of this interval is undeniable, that is to say that the combination of tones is very pleasing to the ear.

Very early in the history of western music, the octave was recognized as the basis for musical notation. If "A"=110 Hz, 220 Hz was also called "A". If "do" (as in "do re mi") is 130 Hz, then 260 Hz is again called "do." Because classical Indian notation is similar ("sa" is an octave above "sa"), I believe this nomenclature possibly predates the split up of Indo-European languages, and thus is older than writing itself, but that's another story.

The Fifth

We could move next to 3:1, but, I will employ the trick from the last paragraph to say that 3:1 is just an octave higher version of 3:2, so, for the sake of keeping things within one octave, I'll often multiply the second number on the ratio by whichever factor of two keeps the ratio between 1:1 and 2:1...

So, next up, 3:2 ratio is the perfect fifth. This is also a very powerful interval which is very pleasing to the ear. And, this is also where tuning troubles started to become an issue, if we start trying to relate different ratios to each other. Take 100 Hz. An octave up is 200 Hz. A fifth up is 150 Hz. A fifth of a fifth is 225 Hz. An octave below that is 112.5 Hz. So, two fifths will not make an octave. In fact, since 3 is not divisible by 2, and no power of three ever becomes a power of two, there is no resolution between these two intervals. In other words, no number of fifths is exactly equal to any other number of octaves. After five fifths, you've nearly made four octaves, so there is the possibility of tempering each note by some error to make a perfect loop. In fact, that's exactly how some Indonesian Gamelans are tuned.

Constructing a Tuning

But, since we like to have a fifth, and we like to have also an octave in our musical scale, we try to construct a tuning that has reasonable approximations to both. The Ancient Greek mathematician Pythagoras (yes, the triangle man) first noted the tuning of piling up fifths until an octave was just about reached. 3:2 multiplied by itself a bunch of times to make new notes. If you make twelve notes, and you start at 100 Hz, your next new note (the thirteenth) would be about 101.6 Hz. That's close enough for some people to say, "Well, whatever; close enough, I guess." So, often there is a stopping point at twelve notes, out of the thought that you'll theoretically never make it back to 100 Hz with fifths, and that an error of 1.6% is "meh" enough to ignore.

From Pythagoras to Ptolemy

Anyway, now that we have gotten that out of the way, there are tons of other just intervals, and each is based on a perfect ratio.

The next simplest ratio (between 1:1 and 2:1) after 3:2 is 4:3, which is an octave up from the inverse of the fifth. That is, 3:2, inverted, is 2:3. To go up an octave, double the first number, so 2:3 goes to 4:3. This is the perfect fourth. It's a pretty nice interval, but it's close mathematical relationship to the fifth and the octave mean that, in isolation, a fourth can be interpreted musically as a fifth with the root note as the higher note. In simple terms, the fourth and fifth sound very similar.

Choosing the next simplest interval is a little bit of a conundrum. 5:3 or 5:4 - 5:3 has 3, which is smaller, but 5:4 has 4, which is 2 times 2, which is a smaller prime number than three. This leads down a rabbit hole that ends up following similar logic to the fourth/fifth relationship mentioned above. Because the next simplest pair of ratios after this is 6:5 and 8:5 (in which 8 is bigger, but is the perfect cube of 2, share some difficulty in assessing which is the simpler of the two) are inverses of 5:3 and 5:4, respectively. 5:3 is called the "major sixth," 5:4 is called the "major third," 6"5 is called the "minor third," and 8:5 is called the "minor sixth." Each of the major intervals here invoke a cheerful pleasant sound, and each of the minor intervals here invoke a more emotional pleasant sound. Nothing wrong with a little emotion, but the textures within the tones are getting more nuanced for sure.

You might want to start throwing these ratios together. Start with 100 Hz. Make 2:1 as 200 Hz. Make 3:2 as 150 Hz. Make 5:4 as 125 Hz. Play them all together, and you have a "major chord," which sounds quite great. Take out 3:2 and replace it with 6:5 as 120 Hz, and you have a minor chord, which also sounds very good. Really, ~90% of the chordal accompaniments in the world are made up of a combination of major and minor chords.

Moving on to ratios with the number 9 as a key number, you have 9:5 and 9:8. The others all reduce to something we've talked about already if you eliminate common factors (for example 9:9 is really 1:1, 9:6 is really 3:2, etc.). These musical intervals are called the [9:5] "minor seventh" (or often the "dominant seventh") and the [9:8] "major second." At this point, you can pretty much make a musical scale out of the notes we have.

The philosopher Ptolemy, did pretty much just that, but he added 15:8 as another interval of the "major seventh," which sounds more cheerful than the minor seventh, but also a little more tense, in a way, as it really wants you to move along to the octave afterward. You might think Ptolemy was an ancient Greek guy, like Pythagoras, so maybe this was a natural progression. Well, yeah, in some ways, but a) Ptolemy came up with this approach of ratios for each note in a scale, whereas Pythagoras used the octave and the fifth to generate a scale that was less deliberately melodic, but simpler, and also b) Ptolemy came more than 650 years after Pythagoras. That's like the difference between us and the author Geoffrey Chaucer.

Anyway, Ptolemy came up with the just intonation system that covers the major scale and did the legwork to put together most of the minor scales in western music.

Ok, if that's all boring to you, continue, otherwise, you might want to take a break before scrolling down, where I jump ahead a couple of chapters in the music theory book. I'm going to assume knowledge of scales, intervals, and tonalities as a given.

-

My approach

The approach I took to generating one just interval per scale index and tonality was a little different from what I had seen done by others, but in the same spirit as the early music theorists took, which is to look not only at minimizing the size of the prime factors in the ratio, but also minimizing the number of step sizes necessary to move between intervals of congruent tonality.

Here's what I finalized:

The idea here is that some tonalities are not congruent with each other, or, in other words, you don't mix diminished and augmented intervals in the same scale. Of course you can, but I'm ignoring the possibility to minimize the different step sizes necessary. I also de-prioritized neutral intervals.

Many of these intervals are under some dispute by scholars. I'm not claiming that this list is authoritative, but it's consistent with the tonality model I've personally worked out.