Chapter 01 of 21 Sound, synth, MIDI ≈ 40 min 5 exercises
String, frequency, octave
A lab notebook with a single string. Seven experiments: place a bet, listen, measure. At the end, the answer to why a low C and a high C sound like one note, and a first hint at why an octave has twelve keys.
In this chapter
- explain what a high and a low sound are physically, and read a frequency in hertz
- hear and find on a string the octave, fifth and fourth as the ratios 2 : 1, 3 : 2 and 4 : 3
- understand why notes an octave apart sound like the same note
- hear beats and tune by them, and tell apart pitches less than one key apart
- work out why twelve fifths do not bring you back to exactly the same note
In the last chapter your ear did a few things that are hard to put into words. It heard "the same note, only higher" where the notes were different. It glued ten sounds into one. This chapter is about the physics behind that. We call a sound "high" as easily as we call a tower high, but a sound is not higher or lower in metres. So what grows when a sound "goes up"?
The chapter is set out as a lab notebook. We have one instrument, a monochord: a single string over a wooden box, and a movable bridge that divides it in two. People studied music on this instrument for more than two thousand years, and nearly everything you will learn below could already be heard on it. Each experiment starts with a bet on what you think you will hear, then comes the sound, then the measurement. Bets cost nothing: a right one feels good, a wrong one sticks in the memory better.
Experiment 1. What vibrates
Every sound is a vibration. A string, a speaker cone or the reed of a harmonica moves back and forth and pushes the air. The air next to it is squeezed and stretched in turn, and these pulses of pressure race outwards at about 343 metres a second until they reach your eardrum. The eardrum starts to move the way the string does, and you hear.
The number of vibrations in one second is the frequency. Its unit is the hertz: 1 Hz is one vibration a second, 440 Hz is four hundred and forty. Below is an oscilloscope, a picture of how air pressure changes over time. The screen shows a hundredth of a second. Switch the sound on and move the slider.
The faster the vibration, the higher the sound. That is the whole answer to "what is a high sound": a fast vibration. What the ear hears as pitch, physics measures as frequency. At 50 Hz half a cycle fits on the screen, and the sound is a low drone. At 2000 Hz there are twenty cycles, and the sound is thin, a squeak. Press any key on your keyboard and the oscilloscope shows its frequency. The A above middle C (A4) is exactly 440 Hz, middle C (C4) is 261.6 Hz.
Look at the "Wavelength in air" line. In the time one vibration takes, the sound travels a certain distance. For A at 440 Hz that is 78 centimetres, for the C an octave below middle C (C3) it is 2.6 metres. That is why bass speakers need big cones, while a tweeter gets by with one the size of a coin.
People hear from roughly 20 to 20,000 Hz. The upper limit drops with age, and in adults it often stops at 15 or 16 thousand. A piano keyboard takes up a modest stretch in the middle: the lowest key, A0, is 27.5 Hz, the highest, C8, is 4186 Hz. What lies above that is not new notes but the "sparkle" and "air" in the sound of the same notes. We will come back to them in experiment 4.
Every synth has a knob that changes the oscillator's frequency. On analogue synths it is often labelled "Tune" or "Pitch", and the pitch-bend wheel moves it while you play. All of these are the same frequency slider as the one above.
The ear tells pitches apart astonishingly finely. Start with neighbouring keys: two notes, one after the other, one or two keys apart.
Neighbouring keys are not the limit. The distance between them is split into a hundred equal parts called cents. The Englishman Alexander Ellis introduced the cent in the 1880s to compare the musical scales of different nations. An octave has 1200 cents. A trained ear in the middle register notices a difference of a few cents. In the exercise below the gap starts at 50 cents, half a key, and then narrows.
If at 15 cents you are right only half the time, that is normal for a start. The "Higher or lower" trainer brings the sounds closer step by step, and with practice your threshold drops noticeably.
Experiment 2. Half a string
Now the monochord. The string is a metre long, pulled tight by a 7-kilogram weight, and the whole string sounds C3 at 130.8 Hz. Before you move the bridge, place your bet below the instrument.
Put the bridge at ½ and press "One, then the other": first the whole string sounds, then half of it. The half vibrates exactly twice as fast, at 261.6 Hz. And it sounds like the same note, only higher: middle C (C4). This distance is called an octave, and it is the most important number in this chapter: 2 : 1.
Keep moving the bridge. Two thirds of the string give the ratio 3 : 2, a sound that gets on with the first one almost as well as the octave does. This is a fifth: from C you get G. Three quarters of the string give 4 : 3, a fourth: from C to F. Watch the "Nearest note" line: the fifth on the string is 2 cents above the G key, the fourth 2 cents below the F key. Where those two cents come from will become clear in experiment 7.
A shorter string gives a higher sound, by the same factor. That is the first law of the string. There are two more, and the "Tension" slider shows the second. Try to guess before you touch it.
The weight on the monochord's string is doubled, from 7 to 14 kilograms. What happens to the sound?
Frequency grows as the square root of the tension: twice the weight gives √2 ≈ 1.41, that is 185 Hz, or F♯3. To get an octave you have to quadruple the weight, to 28 kg. Check it with the slider.
The third law is thickness: the heavier each centimetre of string, the lower the sound. That is why the bass strings of a guitar or a piano are thick, and wound with wire on top. All three laws together:
$$f = \frac{1}{2L}\sqrt{\frac{T}{\mu}}$$Here $L$ is the length of the string, $T$ the tension and $\mu$ the mass of one metre of string. The formula in our instrument is the real one: a metre of steel string weighing about a gram, under the pull of a 7 kg weight, gives exactly 130.8 Hz.
Now train your ear on the monochord. The whole string sounds, then part of it. Which part? A hint: the half sounds like the same note, two thirds is the most "open" and even step, three quarters a smaller step.
Experiment 3. The ear counts "how many times"
A bet with no buttons. The octave from C3 (130.8 Hz) to C4 (261.6 Hz) adds 131 Hz. How many hertz do you have to add to middle C to get another octave? Decide before you read on.
Another 131 Hz gives 392 Hz, which is a G, not a C. The octave above middle C is 523.3 Hz, an increase of 262 Hz. Each octave is twice as wide in hertz as the one below, yet to the ear they are all the same size. The ear does not count "how much more" but "how many times more". Here is what that looks like on a ruler: all 88 keys of a piano placed by their frequencies.
In "Equal hertz" mode the top octave of the keyboard takes up half the ruler, and the bottom three are squeezed into a sliver at the left edge. In "Equal ratios" mode every octave gets the same length, and the keys line up evenly, as on a real keyboard. A scale like this is called logarithmic. The ear is not the only thing that uses one: we judge loudness the same way, and every music program lays out its frequency scales like this.
Pitch is the frequency of a vibration, but the ear measures it in ratios. The same ratio sounds like the same step wherever it is: an octave is always 2 : 1, at the bottom of the keyboard and at the top.
That is why the cutoff knobs on synths and the EQs in a DAW are marked unevenly: 100, 1k and 10k sit the same distance apart. It is the same logarithmic ruler.
Experiment 4. One string, many sounds
So far we have drawn a string that swings in a single arc. A real string does more. While it swings in that arc, it also vibrates in halves, thirds, quarters, and each of these parts gives its own frequency: two, three, four times higher. The lowest frequency is the fundamental, the rest are overtones. They sound together, and the ear hears one note. It is handy to count them along with the fundamental: the fundamental itself is the first harmonic, twice as high is the second, three times as high the third.
Press "One by one, upwards": you will hear, in turn, the first ten frequencies of a string tuned to C2. Listen to the notes they make: C, C, G, C, E, G, almost B♭, C, D, E. The labels on the buttons say the same. The second, fourth and eighth are octaves above the fundamental. The third and sixth are fifths. The fifth and tenth are E, and these are already 14 cents below the key. The seventh is 31 cents below B♭: no key on the keyboard has that pitch.
Now switch the overtones off one at a time and press "Pluck". Without the upper ones the sound goes dull, closer to a whistle. With them it is brighter and more ringing. The pitch does not change. What changes is the colour of the sound. Move the plucking point to the middle: every even harmonic has a still point there, so none of them is excited, and the sound turns hollow, a little like a clarinet. Guitarists know this by ear: near the bridge a string sounds harsh, over the fretboard it sounds soft.
Any periodic vibration breaks down into frequencies like these. Joseph Fourier showed this at the start of the 19th century. You can watch square and sawtooth waves being built from sines in the Fourier series tool on this site. How a synth uses this to make the sound of a flute or a violin is the subject of chapter 2.
Experiment 5. Why C and C are one note
We now have everything we need to answer the first big question. Add two notes with different frequency ratios and look at the picture: the waves on top, the overtones of both notes below. But first, a bet.
Look at the lower picture at 2 : 1. The harmonics of the lower note sit at the top: 1, 2, 3, 4… The harmonics of the upper note sit below them, and every one of them lines up with one of the lower note's. The frequency of the upper C is 2 parts, its overtones are 4, 6, 8, and all of these are already sounding in the lower C. The upper note does not bring a single new frequency into the sound. It only brings out the lower note's even overtones. No wonder the brain takes it for "the same note, only brighter".
At 3 : 2 half of the upper note's harmonics line up, at 4 : 3 a third, at 15 : 8 almost none. The smaller the numbers in the ratio, the more of them match and the calmer the pair sounds. This is the oldest idea in music theory, and there is real physics under it.
There is a second reason, in the hearing itself. In experiment 4 the string's second harmonic was already an octave. Almost every sound we hear from birth, a voice, a string, a trumpet, carries its own octave inside it. It seems the brain has got used to these two frequencies arriving together, and merges them into one. Hence what you noticed in the previous chapter: notes an octave apart sound alike, and most musical cultures give them the same name.
The answer to the first question. Notes an octave apart sound like one because their frequencies are in the ratio 2 : 1: every overtone of the upper note is already in the lower one, and the waves meet again every two cycles of the upper note. The ear hears such a pair almost as a single note.
Move the "Detune" slider by as little as 10 cents. The matches disappear and the waves drift apart. A pure octave is a point, not a region. See whether you can hear it: two notes one after the other, the second higher. Is it the same note or a different one?
Experiment 6. Beats
When two frequencies almost match, something curious happens. The waves add up crest to crest and the sound gets louder, then cancel each other out and it gets quieter. The loudness rocks: wah, wah, wah. These are beats, and their rate $\nu$ is the easiest thing in the world to work out. It is the difference between the two frequencies:
$$\nu = |f_1 - f_2|$$220 and 223 Hz give three beats a second; count them on the light. Move the slider towards zero: the beats slow down, and where the frequencies match they vanish. At 0.5 Hz one rise and fall stretches over two seconds. At 8 Hz they blur into a rough flutter.
Switch to "Octave". Now the sounds are at 220 and 443 Hz. That is not a unison, but you can still hear beats. The lower note's second harmonic (440 Hz) is beating against the upper note's fundamental (443 Hz). In the same way, in "Fifth" the lower note's third harmonic beats against the upper note's second. These beats are what musicians call "out of tune". When they are gone, the pair is in tune.
This is how instruments are tuned by ear: a piano tuner sounds two strings and turns the tuning pin until the beats slow down and disappear. Try it yourself. The slider is the tuning pin of your string.
You don't need to know which way to turn: slower beats mean closer. This skill comes in handy whenever two synths, or a synth and an acoustic instrument, have to play together. Keep at it in the "Tuning to unison" trainer.
Every electronic tuner, every MIDI keyboard and every synth in the browser counts from this number. It is where every key in this course gets its frequency: the note $n$ keys above A sounds at $440 \cdot 2^{n/12}$ Hz. Where the twelve in that formula comes from is the last experiment.
Experiment 7. Twelve fifths
Take C and climb in fifths: each step multiplies the frequency by 3/2. To stay on the keyboard, whenever the note goes past the octave, drop it an octave, that is, divide by 2. The fifths give new notes: G, D, A, E, B… How many steps until you are back at C? And will you get back at all?
Keep pressing "+ a fifth". The dots go round the circle through all twelve keys, black and white, and each lands a little past its key. After the twelfth step you are almost at C. Almost: 23.46 cents too high. Press "Start and end together": the two Cs beat against each other, about three and a half times a second. The arithmetic is simple:
$$\left(\tfrac{3}{2}\right)^{12} = 129.746\ldots, \qquad 2^7 = 128$$This difference is the Pythagorean comma. It cannot be removed: a power of three never becomes a power of two, because one is always odd and the other even. A circle of pure fifths does not close after twelve steps, or after any number of them.
Why, then, did everyone settle on twelve? Look at how close different numbers of fifths come to a whole number of octaves.
Five fifths miss by 90 cents, almost a whole key. Seven miss by 114. Twelve by 23. Twelve is the first number at which the circle of fifths nearly closes, and nothing does better until 41 fifths. Twelve is small enough to build a keyboard for human fingers and accurate enough to leave the fifths almost unspoiled. That leaves the question of where to put the 23 spare cents.
The modern answer is equal temperament. The comma is shared out equally among all twelve fifths: each one is narrowed by 23.46 ÷ 12 ≈ 1.96 cents. Then the octave splits into twelve identical steps, and each key is higher than the one below by the same factor:
$$\sqrt[12]{2} \approx 1.059463$$Switch the circle to "Equal-tempered" and go through the twelve steps again: this time the circle closes exactly. A fifth is now $2^{7/12} \approx 1.4983$ instead of 1.5, and that is where the two cents on the monochord in experiment 2 came from. On middle C such a fifth beats less than once a second, 0.89 times. The ear hardly notices the loss, and in return any tune sounds the same starting from any key.
How many times do you multiply a frequency by ¹²√2, the step between neighbouring keys, to get an octave?
Twelve steps of ¹²√2 double the frequency exactly: (¹²√2)¹² = 2. An octave does have seven white keys, but there are five black ones between them, and all twelve steps are the same size.
Dividing the octave into twelve equal steps and computing the twelfth root of two accurately was first managed almost at the same time at two ends of the world: in China by Prince Zhu Zaiyu (1584), in the Netherlands by the mathematician Simon Stevin (around 1605). Equal temperament did not win at once: for more than two centuries afterwards musicians argued over which fifths and thirds to spoil, and by how much.
You already know half the answer: twelve fifths are almost exactly seven octaves, and twelve is the smallest number at which the circle nearly closes. The other half, what the twelve notes are called, why some are white and some black, and what the step between neighbours is, comes in chapter 11.
Twelve fifths are almost seven octaves, but not quite: the Pythagorean comma of 23.46 cents is left over. Equal temperament shares it out evenly, and each of the twelve keys is $\sqrt[12]{2}$ times higher than its neighbour below.
Next
Now you know that pitch is the frequency of a vibration, and that the ear measures it in ratios. You have heard half a string give an octave and two thirds give a fifth. You have seen that the sound of a single string hides a whole ladder of overtones, and that an octave sounds like the same note because all its overtones are already there in the lower note. You can hear beats and tune by them, and you know why an octave has twelve keys.
But this chapter leaves a puzzle. A 440 Hz A on a violin and on a flute is the same note, with the same fundamental. Yet you could never mistake one for the other. The hint was already in experiment 4: when you switched overtones off, the note stayed the same, but the sound changed. In chapter 2 we build a synth and shape the overtones by hand.