Feeds:
Posts

## The Imperfection of the Musical Scale (Part 2)

We saw from one of my previous posts that we can’t choose the notes of the musical scale such that, from every note, an interval of a perfect octave (ratio of 2:1) and a fifth (ratio of 3:2) is available. In this post, I will explain how this problem is fixed in the modern musical scale.

If we’re going to have both the octave and the fifth, then one of them will have to be an approximation. We’ll cheat and alter the fifth – there have been some proposed scales that alter the octave, but these are non-standard. We want a ratio (call it r) that is nearly a fifth, so that, for some whole numbers $m$ and $n$:

m (approximate) fifths = n octaves

$r^m = 2^n$

where r is close to 3/2. Then, since each power of r produces a new note in the scale, we generate a scale with m notes. (For those who know about these things, this means that the set of ratios of the notes in a scale, and the operation of multiplying by r (and dividing by 2 if necessary), form a group with m elements.)

Is there an optimal way of choosing r? Let’s return to the equation that caused all the problems in my last post:

$(3/2)^m = 2^n$

We can rewrite this as:

$n/m = \log_2(3/2) \approx 0.58496250 \ldots$

We have seen that this equation has no solution, but if we could find whole numbers m and n, so that:

$n/m \approx \log_2(3/2)$

then we can write r as:

$r = 2^{n/m}$

and we have found r. (Do it for yourself!)

How do we find a rational approximation $n/m$ to an irrational number $\log_2(3/2)$? Here we turn to the mathematical tool of continued fractions. A continued fraction is an expression such as:

where $a_n$ are all positive whole numbers (for positive $x$). We can write this in the form:

$x = [a_0; a_1, a_2, a_3, \ldots ]$

Every real number $x$ has a unique expression as a continued fraction (unlike decimals, where, for example, 1 = 0.999 …). If $x$ is rational, then the set of $a_n$ is finite; if $x$ is irrational then the set of $a_n$ is infinite. Given $x$, there is an algorithm for generating the $a_n$: you can find it here or work it out for yourself.

We can also define the nth convergent of the continued fraction, which is a rational number:

$h_n = [a_0; a_1, a_2, a_3, \ldots , a_n]$

Now the most important fact about continued fractions can be found here (theorem 5, corollary 1):

“Any convergent $(h_n)$ is nearer to the continued fraction $(x)$ than any other fraction whose denominator is less than that of the convergent”.

In other words, continued fractions provide the best way to approximate an irrational number by a rational one. Further, if $a_{n+1}$ is large, then $h_n$ is a particularly good approximation to $x$. So let’s look at the continued fraction for

$x = log_2(3/2) = [0; 1, 1, 2, 2, 3, 1, \ldots ]$

The convergents of $x$ are:

$h_1 = 1$
$h_2 = 1/2$
$h_3 = 3/5 = 0.6$
$h_4 = 7/12 \approx 0.5833 \ldots$
$h_5 = 24/41 \approx 0.5854 \ldots$

Now, remember that the denominator is m, the number of notes in the scale. Five is too few, and forty-one is too many – an 88 key piano would only cover about 2 octaves, and with frequencies separated by about 1%, it would be difficult for the ear to distinguish adjacent notes, especially if played rapidly. It would be even more difficult for a human to sing these closely spaced notes accurately.

But twelve is just about right, and $2^{7/12}$ approximates 3/2 to within 0.1% – better than the frequency resolution of the human ear. Now that we have r, we can generate the ratios of the notes of the musical scale. We find that, because 7 and 12 have no common factors, the notes of the musical scale can be generated by continual multiplication (or division) by the ratio $2^{1/12}$ – the ratio of a semitone, the smallest interval. The scale, generated in this way, is said to be equally tempered. This is the modern musical scale.

As this point I will refer you to this table of intervals in Wikipedia, which lists the ratios along with the nearest whole number ratio (known as a just intonation). The far right column lists the difference between an equally tempered interval and a “just” interval in cents – all that is relevant here is that humans can discern a difference of 5 cents or more. You can see from the table that, apart from the fifth (which we chose ourselves), the perfect fourth (which is the inverse of the fifth – i.e. going up a fourth is the same as going down a fifth) and major second, all of the intervals are noticeably different from their ideal, whole-number-ratio values. Thus, the imperfection of the musical scale is always present in music. Whether the brain hears it, and how the brain perceives sound in general, is a field known as psychoacoustics , but that’s a topic for another day.

### 7 Responses

1. “Every real number x has a unique expression as a continued fraction”

Not so. Consider the continued fraction [0;2] – This equates to decimal 0.5. Now consider the cf [0;1,1]. This also equates to 0.5. In general, the cf [a_0;a_1,a_2,…,a_n] can be written [a_0;a_1,a_2,…,-1+a_n,1] (written that way so as to avoid confusion with a_(n-1)!

2. Please feel free to mentally add a closing parenthesis to my previous comment!

3. on June 9, 2008 at 1:43 am | Reply Tim McKenzie

Interesting post. I have a question, and a few minor quibbles. My question is related to one of my minor quibbles, so I’ll start with that.

You say that the Wikipedia table “lists the ratios along with the nearest whole number ratio (known as a just intonation)”. It doesn’t do that, since there’s no such thing as “the nearest whole number ratio” to an irrational number. Instead, it appears to be listing the ratios that the equal-temperament notes are purporting to approximate. How do we decide which notes they’re purporting to approximate? Counting seven notes at a time (and looping around when necessary), we see that the perfect fifth corresponds to 3/2 and the major second to 9/8, as we expect from your explanation involving powers of 3/2. But then the major sixth corresponds to 5/3, instead of 27/16, as we would expect if we were just looking at powers of 3/2. Why do we say that we’re approximating 5/3 there?

The next quibble is very minor. In your explanation of continued fractions, you say that the “a_n are all positive whole numbers (for positive x)”. But a_0 can be 0 if x < 1 (e.g. when x = log_2 (3/2)).

My other quibble is that rational numbers don’t have unique continued fraction expansions. For example: 3/2 = [1;2] = [1;1,1].

Also related is http://www.math.uwaterloo.ca/~mrubinst/tuning/12.html from Michael Rubinstein’s website. (He taught me half a course in analytic number theory before my health forced me to drop it.)

(By the way, is it possible to enter LaTeX in comments? If so, can we have an option to preview comments before we post them, please?)

“The continued fraction representation of any rational number is unique if it has no trailing 1.”

Irrational numbers have no trailing $a_n$ so it’s not a problem. Also, we need to add that $a_0$ need not be positive.

Regarding the nearest whole number ratio, again you’ve caught out some sloppiness on my part. There is no unique way of associating each equal-tempered note with a whole number ratio. However, just intonation is an alternative to equal-tempering to overcome the problem of Part 1. It uses whole number ratio, and simply tolerates the fact that they don’t match up. In Pythagorean tuning (an example of just intonation), we start at C (ratio of 1:1) and move out in ratios of 3:2 in both directions. The result is that Gb does not equal F# – the difference is 24 cents (known as the Pythagorean comma).

As just intonation is in the business of using whole number ratios for musical intervals, it seems to be the best candidate for comparison with the equal-tempered scale, even if the comparison is not unique.

http://faq.wordpress.com/2007/02/18/can-i-put-math-or-equations-in-my-posts/

It worked in my comment. I don’t know how to preview your comments. I’ll see what I can find out.

6. on June 11, 2008 at 5:13 am | Reply Tim McKenzie

Thanks! I might be brave enough to use simple $\latex$ in comments in the future, but I probably won’t try complicated stuff without a preview.

7. on June 11, 2008 at 5:14 am | Reply Tim McKenzie

“Formula does not parse”? That’s why I’m reluctant to use it without a preview.