Music and Math
Music is very strongly tied to physics and math. Sound is fundamentally a wave, which makes music highly tied to the physics of waves. In this post I’ll look at the mathematical and physics origins and development of the major scales we use in Western music.
Wave examples
Waves have a couple of related properties: speed, frequency, and wavelength. All waves, whether light or sound or ripples over the surface of a liquid have these properties. Speed is how fast the wave propagates through a medium (like air). For sound, that’s the ‘speed of sound’. You may be familiar with watching some distant event that generates the sound and seeing the event before you heard the sound. That is because light (also a wave) travels much faster than sound in the air… so you see a firework explode before you hear it, or you see the lightning bolt before you hear the thunder.
Wave properties
Waves are repeating events where (for sound), air pressure increases (peak), then decreases (trough), then increases again. Each repetition is a cycle, and frequency (f) is the number of cycles that pass by a fixed point in a second. If you take a snapshot of a wave in time, wave length (λ) is the distance between (two peaks). If the wave travels through a medium at a fixed speed (s), then you can see that f x λ = s. From this formula we will be able to relate wavelength and frequency.
Making music with waves
So that’s a fair amount of background, what does that have to do with music? Well each musical note is a different frequency. To produce this frequency we typically need some sort of device that has the same length as the wavelength. So tight string, or a tube with an open or a closed end.The string will want to vibrate when plucked or struck so that the trough will stay at ends, creating what we call a standing wave (because it just stays in place). This in turn causes the air around it to vibrate at the desired frequency. We can tighten or loosen the string to change the speed of sound in the string itself to change the actual frequency emitted. This is how a guitar or piano is tuned. For brass instruments, a similar thing happens within a tube. Brass instruments are tuned by adjusting the length of the tube. When we have a vibration that produces a standing wave, this is called resonance.
Now more than one type of standing wave can be produced with a single length. Not just the standing wave (where the troughs of peaks occur at the ends), but also where one trough of peak also occurs in the middle. In this case the wavelength is ½ the original wave. Additionally if the wave is ⅓ the original length it will produce another standing wave. This series of waves is called ‘harmonics’, with the original wave we described called the fundamental, or the 1st harmonic. The second wave is the second harmonic and so forth.
When we cut the wavelength by 1/N we increase the frequency by N. So the if the fundamental, is a note, C, then the 2nd harmonic is the note 2 x C, the third is 3 x C and the fourth 4 x C. In western music, whenever you double a note, the resulting note is labelled with the same name or letter. So the center ‘C’ is called ‘middle-C’ and the note twice as high is called ‘high-C’. The span between C’s are called an octave (for reasons that will become clear below).
Now if I have a bugle, tuned so the fundamental is the ‘C’ 3 octaves below middle-C. Bugles change notes by creating more air pressure and switching to a different harmonic. So the lowest note it can play is that fundamental ‘C’ 3 octaves below middle-C. Increasing the pressure creates a note at the second harmonic, which would be the ‘C’ 2 octaves below middle-C. The third harmonic is not a ‘C’ but a note between the ‘C’ two octaves below middle-C and one active below middle ‘C’. The fourth harmonic is ‘C’ again. From 4th through the 8th harmonic there are 3 notes, and from the 8th to 16th harmonic there are 7 notes. If we list these in a table:
Note | Harmonic | Relative Frequency to previous ‘C’ |
C (-3 Octaves) | 1st | 1.0 |
C (-2 Octaves) | 2nd | 1.0 (2/2) |
G | 3rd | 1.5 (3/2) |
C (-1 Octave) | 4th | 1.0 (4/4) |
E | 5th | 1.25 (5/4) |
G | 6th | 1.5 (6/4 = 3/2) |
B♭ | 7th | 1.75 (7/4) |
C (middle-C) | 8th | 1.0 (8/8) |
D | 9th | 1.125 (9/8) |
E | 10th | 1.24 (10/8= 5/4) |
F | 11th | 1.375 (11/8) |
G | 12th | 1.5 (12/8=3/2) |
A | 13th | 1.625 (13/8) |
B♭ | 14th | 1.75 (14/8=7/4) |
B | 15th | 1.825 (15/8) |
C (+1 Octave) | 16th | 1.0 (16/16) |
The 8th through 16th harmonics (minus the 14th) form our major scale. There are eight notes from C to C in the scale (including the two C’s), and so we call that stretch an ‘octave’ for eight.
Scales and tuning
Below is how we represent the C major scale in written music.
A song which uses just these 7 notes (C, D, E, F, G, A, B) plus any of these notes shifted by 1 or more octaves is said to be written in the key of C major. If we are skilled enough, we should be able to play any such song on our bugle. Now let’s take our bugle and tune it so the 1st harmonic is ‘D’. If we then try to do the same thing with our D bugle and play a scale (going from D to D), we find that our notes won’t match all the notes in our original ‘C’ bugle:
Note | Bugle D | Bugle C |
D | 1.125 | 1.125 |
E | 1.26562 | 1.25 |
F | 1.40625 | 1.375 |
G | 1.54688 | 1.5 |
A | 1.6875 | 1.625 |
B | 1.82812 | 1.875 |
C | 1.05469 | 1 |
D | 1.125 | 1.125 |
What we would like is to be able to have bugles tuned to different notes, but to have the bugles be compatible. This was fixed by the ancient Greeks, notably Pythagoras (the same Greek philosopher/mathematician that gave you the Pythagorean Theorem in geometry). He added 5 more notes and then set the frequency of each note so that the 5th note in every scale was always exactly 3/2 (1.5). You may notice that the 5th note corresponds to the 3rd harmonic, and is the second most common note that our bugle can play. The calculation is based on what is called the circle of fifths. We start with the key of ‘C’ and then go to the fifth note in the ‘C’ scale, which is the key of ‘G’. We then select the fifth note of the key of ‘G’ and use that scale. The additional 5 notes are added between two existing notes and are named either note-sharp (written note-#) or note-flat (written note-♭). Sharp means the note is slightly higher in frequency and flat means the notes are slightly lower in frequencies. These notes are added between C and D (called C# or D♭), between D and E (D#/E♭), between F and G (F#/G♭), between G and A (G#/A♭), and between A and B (A#/B♭). Notice that our bugle already has a note between A and B which we called B-flat (B♭).
To calculate the frequency of a note relative to another note, count the number of notes between your starting note and your ending note clockwise and then for each position multiply by 1.5 (3/2). If the result is greater than equal to 2, divide by 2. With twelve notes. If you calculate the relative frequency of the note to itself, you get (1.5)12 = 129.746, which is very close to 27 = 128 making the relative distance pretty close to 1. With this method our D bugle would still start at 1.25 times C, but our scale is now D, E, F#, G, A, B, C#, D. These will match the same notes on our C Bugle. If I create an instrument that can play all 12 notes, that instrument can play in any key, and thus any song. If we lay the notes out in order of frequency to (C ,C#/D♭, D, D#/E♭, E, F, F#/G♭, G, G#/A♭, A, A#/B♭, B). We say the distance between each note in our 12 note system is a half-step. So our scale is full-step, full-step, half-step, full-step, full-step, full-step, half-step. In Pythagorean tuning (the system we just looked at), the ratios of each of these different sets are not fixed, but vary slightly between different notes. In the 19th century both Europeans and Chinese developed a system where each half-step had a constant ratio – the 12th root of 2 which is approximately 1.059463. This is called Equal Temperament and is the system that is normally used in tuning a piano, while Pythagorean tuning is usually used in orchestras. Below is the comparison between the three systems we talked about, with the %difference of each note. For sharp and flat notes in harmonic tuning, I simply give the average of the two adjacent notes:
Note | Harmonic | Pythagorean | 12TET | HvP | PvE | HvE |
C | 1 | 1 | 1 | %0.0 | %0.0 | %0.0 |
C#/D♭ | 1.0625 | 1.06787 | 1.05946 | %0.5 | %0.8 | %0.3 |
D | 1.125 | 1.125 | 1.12246 | %0.0 | %0.2 | %0.2 |
D#/E♭ | 1.1875 | 1.20135 | 1.18921 | %1.2 | %1.0 | %0.1 |
E | 1.25 | 1.26562 | 1.25992 | %1.2 | %0.5 | %0.8 |
F | 1.375 | 1.35152 | 1.33484 | %1.7 | %1.2 | %2.9 |
F#/G♭ | 1.4375 | 1.42383 | 1.41421 | %1.0 | %0.7 | %1.6 |
G | 1.5 | 1.5 | 1.49831 | %0.0 | %0.1 | %0.1 |
G#/A♭ | 1.5625 | 1.60181 | 1.5874 | %2.5 | %0.9 | %1.6 |
A | 1.625 | 1.6875 | 1.68179 | %3.7 | %0.3 | %3.4 |
A#/B♭ | 1.75 | 1.80203 | 1.7818 | %2.9 | %1.1 | %1.8 |
B | 1.875 | 1.89844 | 1.88775 | %1.2 | %0.6 | %0.7 |
We can see that Harmonic and Pythagorean (HvP) notes vary above 2% only in the G#/A♭-A-A#/B♭ range, since these are usually very high harmonics, that doesn’t seem to cause a problem. Pythagorean and Equal Temperament (PvE) are extremely close only off by more than 1% in F and A#, and Equal Temperament and Harmonic (HvE) are off by more than 2% in F and A. These tunings are all relative so a specific note (in this case ‘C’). Orchestras usually tune to whatever the 1st chair violin declares ‘C’ to be. It’s useful to have a standard, however, so the A above middle-C is usually set to 440 cycles/second. Every other note is based on the tuning you are using, so for 12TET middle-C is 440/1.68179=261.6 cycles/second, and for Pythagorean middle-C is 440/1.6875=260.7 cycles/second[1].
Other scales
While a large number of western pieces are written in a major scale, that is not the only scale you can use to write music. Minor scales, like A minor, have 8 notes running from A to A with no sharps or flats (whole-step, half-step, whole-step, whole-step, whole-step, half-step, whole-step, whole-step). Other combinations are also possible, including combinations with different numbers of notes. Instruments that can play the 12-tone system, either with Equal Temperament or with Pythagorean tuning, are able to play in most of these scales.
Future
In Future blog posts I’ll examine why instruments playing the same note still sound different from each other, and how these instruments work.
[1] If middle-C is calculated going from A to C using Pythagorean tuning, it will be 1.01 off our calculated value (264 cycles/second). This shows the downside of Pythagorean tuning, The direction affects the eventual results because (1.5)12/128 != 1. No such inconsistency exists for Equal Temperament tuning.
No comments:
Post a Comment