Why 12 notes in the Chromatic Scale?

Why 12 notes in the Chromatic Scale?

If you’ve dabbled in a bit of music, or if you’ve ever seen a piano, you should be familiar with this image:

Figure 2: One octave’s worth of piano keys.

These are the keys on the piano that make up the Chromatic Scale.

As you can see, there are 12 keys in the scale: 7 white, and 5 black. Curious as you are, you may wonder: “Why are there 12 keys on the piano? Is there a reason, or was it arbitrary? Could there be more, or less keys?”

There are probably other reasons for the Chromatic Scale being the way it is, but this is the way I think about it:

The Chromatic Scale is the most practical approximate scale that includes a base frequency, 32 the base, twice the base, is periodic, and whose frequencies increase at a constant ratio.

It’s a bit of a mouthful, but I’ll get to explaining it soon enough.

Frequencies

First of all, why include the base frequency (𝑓), 32𝑓 and 2𝑓 in the scale? We include 2𝑓 because people perceive 𝑓 and 2𝑓 as being essentially the same note, no matter what frequency 𝑓 is.

For example, the pitch 𝐴4 has the frequency 440Hz and 𝐴5 has the frequency 880Hz. We call both of them 𝐴 because 𝐴5 has double the frequency of 𝐴4. Similarly 𝐴3 is 220Hz and 𝐴2 is 110Hz.

We also include 32𝑓 since people also perceive it as sounding “smooth”, “constant”, or even “very nice”. It is such a smooth sound that the 32 frequency ratio is known as a “perfect fifth”, and is the building block of not just the Chromatic Scale, but other scales like the Major, and the Pentatonic Scale (which is maximally saturated with perfect fifths).

Periodicity

Second, why should the scale be periodic? The periodicity of the scale is key to having a limited set of pitch classes, while being able to increase and decrease pitch beyond 𝑓 and 2𝑓. Concretely, by making the scale periodic we can have the pitches 𝐴3, 𝐴4, 𝐴5, …, who all belong to the pitch class 𝐴, by repeating the structure of the scale every doubling of 𝑓. In other words, the pitch classes from 𝑓 to 2𝑓 will be the same as the ones from 2𝑓 to 4𝑓, except that all the pitches (the frequencies) are doubled.

Logarithmic perception

Alright, so good so far. How about the last restriction - the ratio of the pitches between consecutive notes being constant - Why is this a restriction we would want?

Hmm, this one is a bit tougher, and since my knowledge of music theory is somewhat limited, I can only hazard a guess that it’s related to acoustic perception.

You see, our ears don’t perceive sounds in a way that might be intuitive for some. Our ears perceive frequency logarithmically, or in other words, we sense 𝐴3(220Hz), 𝐴4(440Hz) and 𝐴5(880Hz) as being the same distance away from each other, even though the differences between the frequencies is not constant.

The ratio between the frequencies, however, is indeed constant. 880Hz is twice 440Hz, which is twice 220Hz. So, if we want the notes on the scale to sound all the same step apart, we need the frequencies to increase by a multiplicative step.

Deriving the Chromatic Scale

Having explained why we are making all of the assumptions we are making, let’s get started with deriving the Chromatic Scale.

Our goal here is to assign to each frequency a number, or an index, that represents the number of the note to play. A frequency with index 0 is the frequency of the first note. A frequency with index 1 is the frequency of the second note, etc.

So, we want to find a function 𝑓:𝐹, that maps frequencies to numbers, given the previous restrictions. For clarity and simplicity, I’m going to represent the base frequency as 1, and therefore it’s double as 2, and the half way point as 32.

The first restriction gives us the assertions

𝑓(0)=1𝑓(𝑝)=2𝑚:.𝑓(𝑚)=32

where 𝑝 is the period/size of the scale and 𝑚 is the note corresponding to the middle frequency (32).

The second restriction tells us that

𝑓(𝑛+𝑝)=2𝑓(𝑛)

By unraveling this equation, along with Equation 1 we find that

𝑓(0)=1;𝑓(𝑝)=2;𝑓(2𝑝)=4;𝑓(3𝑝)=8;𝑓(4𝑝)=16

and in general, we can show that

𝑓(𝑛𝑝)=2𝑛

The third restriction forces that consecutive notes have a constant ratio of pitches and so

𝑟:,𝑛:.𝑓(𝑛+1)𝑓(𝑛)=𝑟

Expanding this definition a bit, and with (1), we get that

𝑓(0)=1;𝑓(1)=𝑟;𝑓(2)=𝑟2;𝑓(3)=𝑟3

and in general,

𝑓(𝑛)=𝑟𝑛

Putting it all together

Wheeww! Those were a lot of symbols just to express our assumptions. But now, we can get to the meat of the problem: finding the size and frequencies of the scale.

We want to find a closed form for 𝑓(𝑛), so let’s starting by joining together Equation 1 and Equation 7.

𝑓(𝑚)=32=𝑟𝑚(32)1𝑚=𝑟

So we can write the ratio 𝑟 in terms of the index of the “perfect fifth”. Cool, some progress.

Now let’s join that up with Equation 4 and see what we get

𝑓(𝑛𝑝)=2𝑛=𝑟𝑛𝑝2=𝑟𝑝2=(32)𝑝𝑚2𝑚𝑝=32

Taking the logarithm base 2, lg, on both sides we find out that

𝑚𝑝=lg(32)=lg(3)lg(2)=lg(3)1

Alright! All we have to do now is write lg(3)1 as a fraction and we find our 𝑚 and our 𝑝!

But wait… Something’s off. checks notes. Yep, I thought so.

So, it turns out that lg(3) is an irrational number, because if it wasn’t you would have 2𝑝=3𝑞 for some pair 𝑝 and 𝑞, which is impossible since the left side is even and the right side is odd.

It seems it is impossible for our scale to exists, which is sad, given all the work we’ve put in so far in finding it. You know what? Let’s just keep going! You heard me. Let’s forget about the fact that lg(3) is irrational, and let’s just find a “pretty good” rational approximation for lg(3)1.

I’ll spare you the details, but by finding truncated continued fractions of lg(3)1 we get these rational approximations:

12,35,712,2441,3153,179306,389665

If we choose 12 as our approximation, we get a 14% error, 35 gives a 2% error, 712 gives a 0.2% error and 2441 gives a 0.07% error. I won’t keep going, since choosing 2441 as our approximation would imply having 41 notes in our scale, which to me sounds a bit excessive.

So, we choose the next best thing: 712

Close enough!

So with all of that out of the way,

𝑚𝑝=712𝑚=7and𝑝=12

So the period is 12, and we have 12 notes in the scale! Just as we wanted! We also get the added bonus of finding that the perfect fifth is the 8th note in the scale, or the note with index 7.

We can use Equation 8 to find the pitch ratio 𝑟, which would be (32)1𝑚1.059634.

Due to our approximation, this 𝑟 isn’t quite constant. For example,

𝑓(𝑝)=𝑓(12)=2=𝑟12𝑟=2112𝑟1.059463

which is slightly off from the previous 𝑟.

The standard Chromatic Scale uses 2112 as the ratio between notes, which makes the first note and the 12th have exactly twice the frequency. However the perfect fifth is 27121.498307(32), so perfect fifths aren’t exactly perfect.

Wrapping up

This was a fun little exercise into thinking deeply about seemingly mundane and standard things that gives some insight into why they exists in the first place. Octaves are pretty important, and so are perfect fifths. So important in fact, that we base a lot of modern scales on those intervals.

With this little tour we also saw that it is impossible to perfectly tune a piano with a constant ratio of pitches if we want a periodic scale that includes an octave and a perfect fifth.

Maybe by relaxing some of these restrictions, mainly the constant ratio, we can find other scales, such as the Major and the Minor scale.

Hope you enjoyed reading along, see ya!