intervals: Nonlinear Function
Created: October 22, 2021
Modified: July 09, 2022

intervals

This page is from my personal notes, and has not been specifically reviewed for public consumption. It might be incomplete, wrong, outdated, or stupid. Caveat lector.

The theory of musical intervals almost makes mathematical sense (but not quite):

The sensible part: integer ratios

The ancient Greeks, particularly Pythagoras, noticed that pitches tend to sound good (consonant) together if their vibrations line up. This happens when their frequencies are small integer ratios of each other.

For example, the simplest nontrivial integer ratio is 2:1. We call this an octave; two pitches are an octave apart if one is twice the frequency of the other (e.g., 220Hz and 440Hz). The vibration of the lower-frequency note aligns exactly with every other vibration of the higher-frequency note. To most people, the two notes will sound almost the same; one is just a higher version of the other.

The next simplest integer ratio is 3:2. We call this interval a fifth. Notes that are a fifth apart (e.g., 220Hz and 330Hz) sound different, but when played together they 'rub' against each other in a pleasing way. Why would this be the case?

Detour: harmonics

Consider a vibrating object with fixed endpoints, such as a violin string. What kind of standing waves can exist in such an object?

Since the endpoints are fixed, a stable wave must fit into the length of the string a whole number of times: any other wavelengths will be damped when they encounter the far endpoint. These stable wavelengths are called harmonics. Plucking a string produces waves at the fundamental frequency and (to varying degree) at all of its integer multiples.

The first few harmonics are typically the strongest. The first harmonic is twice the frequency of the fundamental, or an octave above. The second harmonic is three times the frequency of the fundamental, or an octave plus a fifth above. So these ratios are not just pleasing to the human brain; they're built in to the physics of musical instruments.

Twelve-note scales

Why are there twelve notes in a Western chromatic scale? It's from the circle of fifths. The simplest integer ratio beyond 2:1 is 3:2, and if you ascend by a 3:2 ratio twelve times, you get back to roughly (seven octaves above) where you started:

(32)12129.7463427=128\begin{align*} \left(\frac{3}{2}\right)^{12} &\approx 129.74634\\ 2^7 &= 128 \end{align*}

The discrepancy between twelve fifths and seven octaves, 129.746341281.01364\frac{129.74634}{128} \approx 1.01364, is known as the 'Pythagorean comma'. Most of music theory is based around wishing really hard that this number were 1.

Going along with this fiction, ascending the circle of fifths thus motivates the twelve-tone scale that is the basis of western music; we just bring down each power of 32\frac{3}{2} by the appropriate number of octaves (dividing by the appropriate power of 2) so that it lies within [1,2][1, 2], i.e., between the original note and its counterpart an octave above. This generates twelve different notes before we get (approximately) back to where we started.

Motivated by the idea of a twelve-tone scale, we could also consider just defining each note to lie at an interval of 21/122^{1/12} above its predecessor, so that the series of twelve notes fits perfectly in the octave with a uniform interval between them (the 'semitone' defined as 21/122^{1/12}). This is called 'equal' temperament.

How do these twelve tones relate to the nice integer ratios that Pythagoras considered? There is no exact connection, but we can observe some approximate correspondences. This table compares the Pythagorean intervals ('just' tuning) with the intervals that arise from equal division of the octave and from our original approach of ascending the circle of fifths.

semitoneintervaljust (ratio)just (decimal)equal (2k122^\frac{k}{12})fifths (3n2n+m\frac{3^n}{2^{n + m}})circle of fifths (nn)harmonics
0tonic11.01.01.001, 2, 4, …
1minor 2nd16:151.0671.0591.0687
2major 2nd9:81.1251.1221.12529
3minor 3rd6:51.21.1891.2019
4major 3rd5:41.251.261.26645, 10, …
5perfect 4th4:31.331.331.35111
6tritone2\sqrt{2}1.4141.4141.4246
7perfect 5th3:21.51.4981.513, 6, …
8minor 6th8:51.61.5871.6028
9major 6th5:31.6671.6811.6873
10minor 7th16:91.7781.7811.802107 (roughly)
11major 7th15:81.8751.8881.899515

As these calculations show, following the circle of fifths gives different notes than you'd arrive at by taking small integer ratios, and from what you get from considering successive powers of 21/122^{1/12}. The results are close enough that you can fudge the differences, but it's not a perfectly clean correspondence.

Most modern pianos are tuned using equal temperament, because this doesn't privilege any particular note as the tonic, so the piano sounds equally good (or bad) in any key. The tradeoff is that it can never produce the perfect harmonies that Pythagoras idolized.

TODO: where does the idea of eight-tone scales come from? why 'octave', 'fifth', etc?