Skip to content
Science and Culture

Music and maths: Pythagoras, the octave and the ratios that please the ear

When you press a string exactly at its midpoint, why do you hear a higher version of the same note? From Pythagoras's string experiments to frequency ratios and the piano's equal temperament, we explore the maths inside music.

By Kuazara Bilim EkibiPublished: Updated: 7 min read

The body and taut strings of a violin against a dark background

Photo: Providence Doucet / Unsplash

In this article · 8 sections

Pluck a guitar string and you hear a note. Now press the same string down exactly at its midpoint and play it again. The sound you hear is like “the same note, only higher”. In music this is called an octave. So how can two different sounds seem to our ears like “the same note”? People began asking this question about 2,500 years ago in ancient Greece, and the answer takes us to the hidden maths inside music.

Pythagoras and the legend of the blacksmith’s hammers

Pythagoras was a Greek thinker who lived in the 6th century BC. Although he is known for the theorem about right-angled triangles that bears his name, we know very little about him for certain; none of his writings has survived. Most of what is told about him comes from sources written centuries later.

One of these sources is a famous story told by Nicomachus, who lived in the 2nd century AD: walking past a blacksmith’s workshop, Pythagoras notices that some of the hammers striking the anvils sound pleasant together, while others sound bad. He goes inside, weighs the hammers and finds simple ratios such as 2 to 1 and 3 to 2 between the weights of the ones that sound pleasant.

It’s a nice story, but it is not physically true. The sound a hammer makes when it strikes an anvil is not related to the hammer’s weight in such a simple way. Nor does it work if you try to get the same ratios by hanging weights from stretched strings: to raise a string by an octave, you have to make the weight not twice but four times as heavy. This was shown through experiments at the end of the 16th century by the musician Vincenzo Galilei, the father of Galileo Galilei.

The real experiment: a one-string instrument

The true part of the story is that Pythagoras’s followers studied the relationship between the length of a string and its sound. For this they used a simple one-string instrument called a “monochord”. By dividing a string at different points, they found the following:

Vibrating length of the stringInterval heardRatio
Half the stringOctave2 : 1
Two-thirds of the stringFifth (perfect fifth)3 : 2
Three-quarters of the stringFourth (perfect fourth)4 : 3

The Pythagoreans were deeply impressed that the sounds that go together most harmoniously corresponded to ratios written with the smallest whole numbers. For them, this was proof that the universe is ordered by numbers. The idea was so influential that for centuries music was counted, along with arithmetic, geometry and astronomy, as one of the four mathematical sciences.

Frequency: the number behind a sound

Today we explain this with frequency. Sound is vibration in the air. The number of times a string vibrates per second is the frequency of its sound, and it is measured in hertz (Hz). The higher the frequency, the higher the pitch.

For a string whose tension stays the same, the frequency is inversely proportional to the length of the string. Halve the string and the frequency doubles. So the Pythagoreans’ length ratios are really frequency ratios:

foctave=2×fffifth=32×ff_{\text{octave}} = 2 \times f \qquad f_{\text{fifth}} = \frac{3}{2} \times f

Today the international standard note that musicians use for tuning is the A with a frequency of 440 Hz. The A an octave higher is 880 Hz, and the A an octave lower is 220 Hz.

So why do these ratios sound pleasant? Two sounds whose frequencies are in the ratio 2:1 line up exactly once every two vibrations, and their waves form a regular pattern. As the ratios get more complicated, the waves line up less often and the sound feels more “tense”. However, what sounds pleasant also depends partly on culture and habit; this is still being researched today.

A maths puzzle: the Pythagorean comma

To build a scale the Pythagorean way, you can stack fifths one after another. If you go up by 12 fifths, you come back almost to the note you started on, just 7 octaves higher. The word “almost” matters:

(32)12≈129.7527=128\left(\frac{3}{2}\right)^{12} \approx 129.75 \qquad 2^7 = 128

The two values are very close but not equal. The small difference between them is called the Pythagorean comma:

129.75128≈1.0136\frac{129.75}{128} \approx 1.0136

For centuries this small difference was a headache for instrument makers and musicians. If you tune all the intervals to “pure” ratios, an instrument that sounds wonderful in some keys can grate on the ear in others.

The piano’s solution: equal temperament

Today pianos and many other Western instruments use equal temperament. In this system the octave is divided into 12 equal semitones. Each semitone has a frequency about 1.0595 times that of the one before:

r=212≈1.0595r = \sqrt[12]{2} \approx 1.0595

Multiply by this ratio 12 times and you get exactly 2, so the octave is perfect. The price is this: the fifth is no longer exactly 1.5 but about 1.4983. Most of the time our ears don’t notice this small difference, and in return we get an instrument that can be played equally comfortably in every key.

Not every musical tradition has chosen the same solution. For example, in a system widely used in the theory of Turkish makam music (a tradition built on melodic modes), a whole tone is divided into nine small steps called commas. This makes it possible to write in-between notes that don’t exist in the 12-note system of Western music. It shows that the relationship between music and maths has no single right answer; different cultures have chosen different compromises.

Try it at home: the frets of a guitar

If you have a guitar or a bağlama (a Turkish long-necked lute) at home, you can repeat the Pythagoreans’ experiment yourself. The 12th fret on a guitar’s neck sits exactly halfway along the string. Play the string open first, then pressed at the 12th fret: you’ll hear an octave. The 7th fret leaves about two-thirds of the string vibrating; play the open string and then the 7th fret one after the other and you’ll hear the interval of a fifth. Take a ruler, measure the lengths from the bridge to the frets and work out the ratios. You’ll also notice why the frets get closer and closer together towards the end of the neck: each fret shortens the remaining length by the same ratio.

If you don’t have a guitar, you can pour different amounts of water into several glass bottles of the same size and blow across their tops; you’ll hear how the sound changes with the length of the vibrating column of air.

Myth or fact?

  • “Pythagoras discovered the ratios from the sounds of hammers.” Myth. The story doesn’t hold up physically, and it was written down centuries after Pythagoras.
  • “Harmonious intervals correspond to simple number ratios.” Fact. The octave is 2:1, the fifth 3:2 and the fourth 4:3.
  • “The planets make music.” The Pythagoreans’ idea of the “music of the spheres” was a metaphor. Even Johannes Kepler, in his 1619 work Harmonices Mundi, tried to link the motions of the planets to musical intervals. The planets don’t produce music that we could actually hear, but this search led Kepler to an important law of planetary motion.

Summary

  • Halving a string doubles its frequency and gives a sound an octave higher.
  • Harmonious intervals correspond to simple ratios: octave 2:1, fifth 3:2, fourth 4:3.
  • The story of the blacksmith’s hammers is a legend; the real experiments were done with strings.
  • 12 fifths and 7 octaves are not exactly equal; the difference is the Pythagorean comma.
  • The piano’s equal temperament solves this problem with a compromise, spacing every semitone by a ratio of 212\sqrt[12]{2}.

Frequently asked

4 questions

What is an octave?

An octave is the interval between two sounds when one has twice the frequency of the other. For example, an octave above the A at 440 Hz is 880 Hz. Our ears hear these two sounds as 'the same note'.

What did Pythagoras discover about music?

Pythagoras and his followers studied how the length of a string relates to its sound on a one-string instrument. They showed that intervals that sound harmonious correspond to simple ratios such as 2:1, 3:2 and 4:3.

What is the Pythagorean comma?

It is the small difference between 12 fifths in a row and 7 octaves. (3/2) to the power of 12 is about 129.75, while 2 to the power of 7 is 128; their ratio is about 1.0136.

On a piano, how many times higher is the frequency of each semitone?

In equal temperament, each semitone has a frequency about 1.0595 times that of the one before. This number is the 12th root of 2; after 12 semitones, the frequency has exactly doubled.

Sources

3 sources
  1. 1.Stanford Encyclopedia of Philosophy — Pythagoras (opens in a new tab)plato.stanford.edu
  2. 2.MacTutor History of Mathematics — Pythagoras of Samos (opens in a new tab)mathshistory.st-andrews.ac.uk
  3. 3.Benson, D. J. — Music: A Mathematical Offering, Cambridge University Press (2006)
  • #music and mathematics
  • #pythagoras
  • #octave
  • #frequency
  • #sound