### A Look at the Mathematical Origins of Western Musical Scales

#### Posted by Simon Willerton

I want to explain a little of the background behind Tom Fiore’s musical post last year. In this post the aim is to explain to a numerate audience some of the origins of the Western seven note musical scale. I will try to assume no formal knowledge of music except perhaps a vague notion of what a piano keyboard looks like. I won’t get very far in the historical development, only up to about the middle ages.

There are two aspects of music relevant to this discussion: melody and harmony. Melody involves the consecutive playing of notes, like in any tune you can hum or whistle; harmony involves the simultaneous playing of notes like in a chord or multipart singing. In terms of Western music, it appears that harmony did not make an appearance until the middle ages; in this post I will not get on to harmony and how it had a significant effect on the precise pitch of each note. What I will explain here is the origin of the seven note Western musical scale in terms of the consonance of the octave and the consonance of the fifth, which in turn have their origins in the physics of the vibrating string.

I should add at this point that I learnt much of this stuff from the following great book which is freely available as a pdf.

- Dave Benson, Music: A Mathematical Offering, Cambridge University Press, 2006.

I also learnt a lot from talking to various friends and there is lots and lots of information on the internet one interesting looking document is

- Peter A. Frazer, The Development of Musical Tuning Systems.

### The palette of notes – scales

If you are wanting to compose a piece of music, be you a caveman, a rock star or a member of the Royal College of Music, you must at some point – probably when you start – decide on which notes you will use, what your musical palette will be. By this I do not just mean which keys on the piano will you use: if you have chosen to use a standardly tuned piano then you have already significantly restricted the notes you can play – and we will see a little bit about which notes these are below.

The palette that you chose will be constrained to some extent by the instrument or instruments that you will using. For instance, many instruments, like the xylophone or the piano, will force you to use a discrete set of notes, whereas other instrument, like the violin or the voice, will theoretically allow you to use a near continuum of notes in your piece of music. In between these two extremes there are many instruments which on first sight appear to be based on a discrete set of notes but on which the player has some freedom to move or ‘bend’ notes somewhat, for instance by using the shape of the mouth (or ‘embouchure’) on instruments such as the clarinet or the harmonica.

Another possible constraint on the choice of the palette is whether or not you will be playing with other instruments and whether or not you will be playing more than one different note at a time. For instance, a Baganda xylophone is not played with other tuned instruments and so the exact choice on notes on the instrument is not considered very important – each instrument has a unique set of notes. Similarly the instruments in an Indonesian percussion orchestra known as a gamelan will use notes specific to that orchestra and cannot in general be played with other orchestras such as the ones in nearby villages.

If you are playing with other instruments, then the type of instruments will have an effect on which notes will sound good together. For instance, string instruments have a certain musical spectrum which mean that playing notes together whose frequency differ by a simple fraction will sound sweet together. This will then relate to your choice of notes.

Further constraints include the genre of the music. The notes of the scale in gypsy music can all (essentially) be found in the notes on the piano keyboard but do not occur in that combination in any classical western scale. In blues music, on the other hand, you find notes – blues notes – which can’t be found on the piano. (However, as blues music has been absorbed into the western tradition it has become played on instruments such as the piano and pianists have developed certain tricks to emulate these bent, blues notes.)

We will first have a look at where Western scales come from.

### Greek lyres and the Pythagorean scale

It appears that a harp-like instrument called the lyre was one of the main instruments of ancient Greece and the tuning was based on the notion of a tetrachord – that is a tuning of four strings. There were three main tunings or types of tetrachord which were called the chromatic, the diatonic and the enharmonic. We will concentrate on the diatonic as that is the one that is the ancestor of modern tunings. The two outer strings differed in length by a factor of $4/3$ and so the frequencies differed by a factor of $4/3$ as well. The middle two strings were tuned so that the ratio of the first to second strings (the first interval) was approximately the same as the ratio of the second to the third string – so this ratio or interval is called a ‘whole tone’ and both these interval were about twice as big as the ratio of the third to the fourth string, this interval being called a semi-tone. [For those of you who know these things this is like going down the white notes on a piano from E to D to C to B or from A to G to F to E, but I’m getting ahead of myself.] How exactly then were the middle two strings tuned? Well, there were many, many different prescriptions for exactly how those middle two strings were tuned; however, one of them won out historically and that was the so-called Pythagorean tuning. Here the first and second ratios are both $9/8$ and the third ratio is $256/243$; the actual numbers are not important here, the thing is that both the first two intervals are exactly the same (not just approximately the same) and $(256/243)^2$ is pretty close to $9/8$. While $9/8\times 9/8\times 256/243 = 4/3$. It will turn out to be useful at this point to have a digression on where Pythagoras might have got these numbers from.

### Harmony and harmonics

When you play a note on an instrument, such as by plucking a string or blowing into a tube you will generate a note at a certain pitch, say 100 cycles per second or 100 Hertz. Because of the physics of the string or the column of air, this will give a periodic wave and by Fourier analysis we know that this wave can be decomposed into sinusoidal waves (‘harmonics’) whose frequency is an integer multiple of the fundamental frequency. So in the case of our plucked string at a pitch of $100 Hz$ we will get harmonics at frequencies of

$100 Hz, 200 Hz, 300 Hz, 400 Hz, 500 Hz, 600 Hz,\dots$

These harmonics, or overtones, will occur with different amplitudes depending on the instrument. Some instruments, such as the clarinet which is closed at one end, will only have odd multiples of the fundamental frequency, or at least on some notes.

Now it is a fundamental fact that two notes played simultaneously will sound *sweet* or *consonant* together if they share many harmonics. If we play a note at twice the frequency, which means at $200 Hz$ in our example, then it will have harmonics at

$200 Hz, 400 Hz, 600 Hz, 800 Hz, 1000 Hz, 1200 Hz,\dots$

These are *all* harmonics of the original note at $100 Hz$ so these two notes sound really sweet together, in fact, so much so that we usually consider this to be the same note, but at a higher frequency. The second note is said to be an *octave* higher than the first – the reason for the nomenclature will be more apparent later.

Consonance of the octave:Two notes which differ in frequency by a factor of $2$ soundextremelyconsonant together.

The principle of actually thinking of two notes which differ in frequency by a factor of $2$ as being the same note is called the **principle of octave equivalence**.

Now if we pick a note with a frequency of $150 Hz$ then its harmonics are at the following frequencies.

$150 Hz, 300 Hz, 450 Hz, 600 Hz, 750 Hz, 900 Hz,\dots$

In this case every other harmonic is a harmonic of the original note, and every third harmonic of the original note is a harmonic of this note. These two notes share lots of harmonics and sound very sweet together. Two notes such as these whose frequencies differ by a factor of $3/2$ are said to differ by a perfect fifth. Again, the musical terminology is likely to confuse at this point as there isn’t five of anything yet.

Consonance of the fifth:Two notes which differ in frequency by a factor of $3/2$ soundveryconsonant together.

A similar argument means that if $a$ and $b$ are small integers then notes which differ by a ratio of $a/b$ will share many harmonics – for each integer $n$ the $n a$th harmonic of one will be the $n b$th harmonic of the other – so the notes will sound sweet, or consonant, together.

The legend has it that Pythagorus discovered these ideas when he was walking past a blacksmiths one day and heard that different sized anvils produced different notes when struck. This seems to be generally regarded as being implausible as the above analysis depends on the fact that the harmonics are all integer multiples of the fundamental frequency which is true for waves in one dimension, so this includes vibrating strings and columns of air; however, instruments which are struck in the body – such as xylophones and bells – and instruments which have a membrane which is hit – such as drums – tend to have more complicated harmonics which are not simple multiples of the fundamental frequency. So in general if an anvil is played with an anvil twice the size then you won’t get a harmonious sound.

In a similar vein, I could point out here that the harmonics on the clarinet are dominated by the odd multiples of the fundamental frequency, so I don’t know if in practice whether you get consonant octaves on the clarinet. By this I mean that if you play a note at $100 Hz$ you get, in theory, harmonics at the following frequencies

$100 Hz, 300 Hz, 500 Hz, 700 Hz, 900 Hz, 1100 Hz,\dots$

and if you play a note with twice the frequency you get, in theory, harmonics at the following frequencies

$200 Hz, 600 Hz, 1000 Hz, 1400 Hz, 1800 Hz, 2200 Hz,\dots$

So these notes have *no* harmonics in common, therefore when played together should not sound particularly sweeter than any two random notes played together; however, I’ve never tried performing an experiment to verify this, so I don’t know how true it is.

### Pythagorean tuning

Pythagoras is supposed to have used the fundamental principles of the consonance of the factors of $2$ and $3/2$ (or the octave and the fifth if you prefer) described above to set up his tuning of the tetrachord. You can construct a sequence of notes in the following fashion. Start with a base note, take the note with a ratio $3/2$ to that one (a perfect fifth up if you prefer), then take the note $3/2$ up from that, this is $9/4$ up from the original note, but by the principal of octave equivalence it is to be considered “the same” as the note with half the frequency, i.e. the note $9/8$ up from original note. You can continue like this, raising by a factor of $3/2$ and dropping by a factor of $1/2$ when necessary. Doing this six times we get the following notes, where $\sim$ denotes octave equivalence (which you recall means treating notes whose frequencies are in the ratio of a power of $2$ as being the same):

$\frac1 1, \frac3 2, \frac9 4\sim\frac9 8, \frac {27}{16}, \frac{81}{32}\sim\frac {81}{64}, \frac{243}{128}, \frac{729}{256}\sim\frac{729}{512}.$

Taking these notes in order of size we get the following sequence of ratios to the base note, where we have added the note at the double the frequency.

$\frac1 1, \frac9 8, \frac{81}{64}, \frac{729}{512}, \frac{3}{2}, \frac{27}{16}, \frac{243}{128}, \frac2 1.$

Or, if you prefer your notes in Hertz, then taking the base note at $100 Hz$ you get:

$100 Hz, 113 Hz, 127 Hz, 142 Hz, 150 Hz, 169 Hz, 190 Hz, 200 Hz.$

[For those in the know this would be approximately the same relative frequencies you would get if you started at F on the piano keyboard and played the white notes upward.] Looking at the ratios of consecutive notes we get

$\frac9 8, \frac9 8, \frac9 8, \frac{256}{243}, \frac9 8, \frac9 8, \frac{256}{243}.$

So adjacent notes differ either by a ratio of either $9/8$ – which we call a *Pythagorean tone* – or by a ratio of $256/243$ – which we call a *Pythagorean semi-tone*. Note that $256/243\times 256/243 \simeq 9/8$ so the name is nearly justified. Pythagoras used these two ratios or intervals in his diatonic tetrachord. In relation to his base note he tuned the four strings to the following ratios:

$\frac1 1, \frac{256}{243}, \frac{32}{27}, \frac4 3.$

This is the Pythagorean tuning of the diatonic tetrachord.

### The Western major scale

By placing two tetrachords next to one another you can go from one note to the note at twice its frequency using *eight* notes as done above. This is why we get the term *octave* for a doubling of the frequency. We can repeat this pattern as much as we like, so that the ratio between adjacent notes forms the following sequence:

$\dots, \frac{256}{243}, \frac{9}{8}, \frac{9}{8}, \frac{256}{243}, \frac{9}{8}, \frac{9}{8}, \frac{9}{8}, \frac{256}{243}, \frac{9}{8}, \frac{9}{8}, \frac{256}{243}, \frac{9}{8}, \frac{9}{8}, \frac{9}{8}, \frac{256}{243},\dots$ or, symbolically, writing S for a semi-tone and T for a tone,

$\dots \text{ S T T S T T T S T T S T T T S }\dots$

This is the same as the pattern of intervals between the white notes on a piano – where
a T means there is a black note in between the two white notes and S means that there is no black note.
To get a *scale* we need to specify the root or home note – the note we will be based around. Up to octave equivalence we have seven notes to choose from. So if we pick a white key on the piano and that followed by the seven keys to its right then we will have played an octave and the seven different choices give us the following seven patterns.

$\text{T T S T T T S}$ $\text{T S T T T S T}$ $\text{S T T T S T T}$ $\text{T T T S T T S}$ $\text{T T S T T S T}$ $\text{T S T T S T T}$ $\text{S T T S T T T}$

For instance, the first of these is what you get if you start at a “C” on the piano keyboard. Historically, all of these scales were used, but for some reason in Western classical music the first and the sixth are the ones that dominated. The first is called the major scale and the sixth is called the minor scale. So if you start at an “A” on a piano keyboard and play the white keys to its right you will get a minor scale. Some of the other scales pictured are certainly still prevalent in other Western music such as Irish folk music, for instance there are many tunes written using the second and fifth pattern, which are know as the Dorian and Mixolydian modes.

Note that in all except the last pattern pictured above the interval the first note to the fifth note consists of three tones and a semi-tone. This means that the frequency ratio is $(9/8)^3\times 256/243$ which is precisely $3/2$. So the fifth note is $3/2$ times the frequency of the first note, and we finally have an explanation as to why this ratio is called a *fifth*.

So we have now arrived at a rather rough approximation to the Western major scale. To get many notes in the scale to sound good when played together, some rather interesting compromises need to be applied to the actual ratios. That is the subject of *temperaments* which is a whole tale in itself.

### Summary

To summarize, the physics of the vibrating string or vibrating column of air mean that to our ears notes which differ in frequency by a factor of $2$ or $3/2$ sound particularly sweet or consonant when played together. From this one can be led to a series of notes called the Pythagorean scale, which very roughly correspond to the white notes on a piano.

This takes us up to about the middle ages when polyphonic music and harmony, that is different notes played at the same time, seem to have become more significant in Western music, and because of that certain tweaking of the scale was needed. However, that’s a story for another time.

## Re: A Look at the Mathematical Origins of Western Musical Scales

With regards to your clarinet experiment: You will find that when two clarinets clarinets play the same note (say a Bb), one an octave higher than the other, they sound just as consonant as any other pair of instruments.

Despite the fact that each clarinet will emphasize a different set of harmonics, all the overtones are still all integer multiples of the lower Bb.

P.S. You should follow this up with a post on just intonation.