Skip To Content
Cambridge University Science Magazine
Beautiful music is an art form. It is appreciated across all cultures and is an important part of social life. Those who can play music are considered gifted.  Those who compose are geniuses. Music stems from a passion, channelled through artistic flare, seemingly beyond the creativity of most people’s conscious thought. Frederick Delius, the English composer, described music as an ‘outburst of the soul’ while Ludwig van Beethoven described it as ‘the mediator between the spiritual and the sensual life’.

So what is it that sounds makes music sound good? Mathematics holds the answer.

There are many ways in which mathematics and music are related. Both have abstract concepts and use their own set of symbols. Both are associated with high intelligence and can be somewhat perplexing to a novice. There are aspects of music that are obviously maths related; the timing of a beat or the length of the notes. But the similarity stretches further and is a hot area of research for physicists and mathematicians alike.

The first link between mathematics and music was made in the 6th Century BC by the Greek mathematician Pythagoras. Legend has it, that when going about his daily business, Pythagoras walked past a busy blacksmiths. As he listened to the repetitive bashing of hammers on anvils, he noticed something interesting. All the anvils sounded harmonious, apart from one, which thudded in between the gentle ringing. Closer inspection revealed that the anvils’ masses were all in simple ratios, one twice the mass of the other, another three times the mass and so on. The mass of the anvil which stood out had no simple relationship to the others.
It is the idea of ratios which holds the key to musical appreciation.

Sound travels as compression waves with oscillating pockets of high and low air pressure. The rate at which these air pockets reach our ear drum determines the note we hear. A higher frequency of air pockets produces a higher sounding pitch while a lower frequency of air pockets produces a lower sounding pitch. The secret to sweet music is to line up these air pockets in orderly or interesting ways.

Take the note ‘middle C’, approximately the centre key on a piano. Middle C has a frequency of 262 Hertz. This means that 262 pockets of air hit your ear drum each second. A note guaranteed to sound great alongside middle C is the note with double its frequency, just as the anvil and one with twice its mass sounded good together. The note with double the frequency is defined as being an ‘octave’ higher and is given the same name, C. Distinguished as ‘High C’, it has a frequency of 523 Hz. Every second air pocket from high C arrives with an air pocket from middle C, the ratio is 1:2 and this sounds great!

This natural phenomenon of octaves has been referred to as the ‘basic miracle of music’ and is the basis of the entire note system for many musical systems, including ours. The Ancient Greeks defined there to be five equidistant notes in-between the octave and played their music accordingly. In western culture the octave is split into 12 equally spaced semi-tones. These are C, C sharp, D, E flat, E, F, F sharp, G, G sharp, A, B flat, B, High C.

Playing two notes that are an octave apart, one after the other, always sounds good. The first two notes in Somewhere Over the Rainbow are one octave apart, as are the first two in I’m Singing in the Rain.

This simple fraction is nice but it can sound hollow and boring. To create interesting music we must explore other relationships. C and G have a ratio of 3:2. Every second pocket of air from the note C is accompanied by the third from G. This frequent meeting of air pockets guarantees that C and G complement rather than clash. These two notes are found together at the opening of the Star Wars theme tune. By contrast, C and F-sharp are not quite so nicely related. The pulses (almost) line up at the seventh and fifth air pockets but this is too long a time period and too infrequent for the combination to sound good.  As a result they are rarely found together.

As well as being important in melodies, these ratios also apply to chords. In a chord combinations of notes are played together simultaneously. To sound harmonious, the frequencies of the notes must be small multiples of each other. ‘C major’ is one of the most popular chords, combining C, E and G. All three frequencies line up, almost perfectly, every 0.0155 seconds, giving a sweet, harmonious and happy sound. The symphonies in C major of Beethoven, Mozart and Schubert all used this combination, as does the popular British nursery rhyme Row, Row, Row Your Boat. The E major chord comprises E, G-sharp and B, which line up every 0.12 seconds. This sounds just as sweet but a little higher but because it is made up of higher frequency notes.

Musical instruments are tuned to play notes exactly. Even a slight error in frequency could ruin a musical piece. Instruments are designed to very accurate specifications, which for many have remained unaltered for centuries. Stringed instruments use string lengths to create notes; to double the frequency the length is halved.  Wind instruments use the positions of holes to the same effect. The material of choice is also important, as each material resonates with its own natural frequency. Materials are chosen for each instrument to reinforce certain harmonics and distinguish it from other instruments. This is why the violin is clearly distinguishable from the piano, even though both may be playing the same note.

Keys also make use of maths, where the key defines which scale the piece is based on. Changing the key of a song involves changing every note by a certain amount. Each note is raised or lowered by some fixed value, usually so it can be played more easily on a given instrument. Changing key does not affect the song. Although the pitch of the notes has changed, the pattern is still the same. The song is just as recognisable and catchy and the careful maths you’re listening to remains the same.

The theory of mathematics in music is of course an incredibly complex topic and one which can only be truly appreciated by those proficient in both. Scientists have long been known for their appreciation of mathematics and it seems now that the same can be said for artists. Whether conscious or not, mathematics sounds good. So if you plan to create a musical masterpiece, you’d better make sure your have your calculator handy!

Amy Chesterton is a PhD student in the Department of Chemical Engineering