# 3 Limit Just Intonation

tuning
music theory

April 26, 2020

After building a foundation of understanding pure intervals in the last post, we will now look at different ways of building tuning systems with them. This post focuses on the most simple interval: fifths.

## Stacking Fifths

In the last post, we were stacking octave reduced fifths on top of each other:

$\frac{3}{2}^{0}*2^0$
$\frac{3}{2}^{2}*2^{-1}$
$\frac{3}{2}^{4}*2^{-2}$
$\frac{3}{2}^{1}*2^0$
$\frac{3}{2}^{3} * 2^{-1}$

Note that the ratios are frequency ratios instead of length ratios (as they were in the last post).

Explanation:

• The intervals are generated by powers of 3/2, which means we are stacking fifths ontop of each other
• The multiplication by powers of 2 moves the ratios between 1 and 2:

$1 \leq \frac{3}{2}^{a} * 2^{b} \geq 2$

### Simplification

To clean up the calculation, we could pull out the /2 and move it to the powers of 2:

$\frac{3}{2}^{a} * 2^{b} = 3^{a} * 2^{b-a}$

To reflect that in our example, we can apply the right side of the equation above:

$3^0*2^{0}$
$3^2*2^{-3}$
$3^4*2^{-6}$
$3^1*2^{-1}$
$3^3 * 2^{-4}$

## N-Limit

The above simplification aimed to pave the way for a more abstract understanding of stacking numbers in a tuning system. This is where N-Limit Tuning comes in. N-Limit Tuning generates ratios by multiplying powers of natural numbers up to N.

For example, 3 Limit ratios can be calculated with $R_{3} = 2^{a} * 3^{b}$

And 5 Limit ratios with $R_{5} = 2^{a} * 3^{b} * 5^{c}$

We can skip the 4 because it is not a prime number, thus factorizable with lower primes.

### Why are we doing this again?

Let's forget all the mathematics and just focus on why this is even a good idea. What does it mean to power 3 (or any other prime number)? To understand it, we can think of the number 3 as the 3rd partial in the harmonic series, which is in musical terms an octave + a fifth. If we multiply this 3 with any fundamental frequency, what we get is the frequency that is an octave and a fifth higher. If we multiply that new frequency again with 3, we get one octave + a fifth more and so on.

So essentially, we are building harmonics of harmonics. This will lead to pitches that have many harmonics in common, which results in a harmonic relationship between them, thats what we want.

Of course those frequencies will quickly get really high, which is why we utilize octave reduction.

## 3 Limit Tuning

Enough of the theoretical blabla, let's make some "music":

$b = 0$

$R_f = 2^{a} * 3^{b} = 2^{0} * 3^{0} = \frac{1}{1}$
$a = \lceil\log_2 3^{-b}\rceil = \lceil\log_2 {3^{0}}\rceil = 0$

$R_l = \frac{1}{R_f} = \frac{1}{1}$
• Here we are generating ratios with a limit of 3, which is why why can call it 3 limit tuning.
• The slider controls the exponent of the 3 (= b), while the exponent of the 2 (= a) is calculated automatically to stay in one octave
• You can ignore the formula for a if you like, but if you are curious, you can see the derivation below (automatic octave reduction)

### Tuning Circle

Now we can generate a whole tuning system, by picking a range of ratios. We can visualize their position in the octave in a circular fashion:

$3^{0} - 3^{4}$

5 pitches

rotate by 0 powers

### Tuning Table

Let's look at the underlying data of the graphic above in a so called Tuning Table:

positionpowersratiocentslisten
0$3^{0} * 2^{0}$$\frac{1}{1}$0
1$3^{2} * 2^{-3}$$\frac{9}{8}$204
2$3^{4} * 2^{-6}$$\frac{81}{64}$408
3$3^{1} * 2^{-1}$$\frac{3}{2}$702
4$3^{3} * 2^{-4}$$\frac{27}{16}$906

The tuning above is mostly known in the west from pythagoras, also called the pythagorean tuning. Although pythagoras was not the first who invented that type of tuning, as we know now, see Shí-èr-lǜ for an earlier variant.

Observations

• At 12 pitches, the fractions seem to reach a point of saturation, where all pitches are more or less equidistant
• The 13th pitch is really close to the first
• The next "point of saturation" is not reached until 53 pitches are generated
• By rotation, we can generate all the greek modes + pentatonics
• Rotating left will darken the scale (more subharmonic partials), while rotating right will brighten the scale (more harmonic partials)

Here we see the main reason for why western music uses a 12 note tuning system!

## The Pythagorean Comma

This 12 note system is only almost perfect. The problem: if we stack another fifth ontop of the 12th one, the resulting pitch is a little bit too high than it should be. The system would be perfect if the 13ths fifth would end up being the fundamental ratio again. But this is mathematically impossible:

$2^{-19} * 3^{12} = \frac{531441}{524288} \approx 1.0136432 \neq 1$

or put differently, using fifths:

${(\frac{3}{2})}^{12} = \frac{531441}{4096} \approx 129.7463 \neq 2^7 = 128$

Explanation: If we stack 12 fifths, we dont land exactly 7 octaves higher, but slightly off. If we divide those 7 octaves to get the difference, we come to the same result as above:

$R_{pc} = {(\frac{3}{2})}^{12} : 2^7 = \frac{531441}{524288} \approx 1.0136432$

This little "error" is called the pythagorean comma.

We could try to correct that comma, by subtracting 1/12 of it from each consecutive fifth. But this will be a topic for another post, as this is a step away from Just Intonation to Equal Temperment.

## Automatic Octave reduction

In the calculations above, the exponent of the factor 2 was used to move the resulting ratio between 1 and 2 (= inside one octave).

#### Recursive Solution

An easy and expressive way to solve this is using a recursive function:

export function clamp(ratio) {
if (ratio > 2) {
return clamp(ratio / 2);
}
if (ratio < 1) {
return clamp(ratio * 2);
}
return ratio;
}


Here, we are just dividing or multiplying by 2 until the number sits between 1 and 2.

### Mathematical Solution

To make your inner mathematician proud, lets now try an algebraic "proof" and find a function that applies octave reduction.

The goal of octave reduction is to multiply a certain ratio R with powers of 2, until it is between 1 and 2. With that in mind, we can come up with a range of numbers that can be used as exponents of 2:

$1 \leq R * 2^{x} \geq 2$
$\frac{1}{R} \leq 2^{x} \geq \frac{2}{R}$
$\log_2 ({\frac{1}{R}}) \leq x \geq \log_2 ({\frac{2}{R}})$

So x is inside:

$[\log_2 ({\frac{1}{R}}), \log_2 ({\frac{2}{R}})]$

Example:

$R = 3^{4}$
$[\log_2 ({\frac{1}{3^{4}}}), \log_2 ({\frac{2}{3^{4}}})] = [-6.34, -5.34]$

As we want a whole number exponent, we have -6 as the single solution.

#### Simplification

As powers of 3 grow faster than powers of 2, there will always be just one solution inside the interval. So for all bases above 2 we can simplify this by rounding up the first / rounding down the second interval bound. As the first bound is more compact, our solution will be:

$\lceil\log_2 ({R^{-1}})\rceil$

(Those brackets mean rounding up)

#### Disclaimer

As I am not a real mathematician, this proof may lack some formal finesse, but the point should be clear.

### More

Now that's it for today. We will look at 5-limit tuning and equal temperament in the next posts. Here are some more or less related links:

Felix Roos 2022