Chiel Zwinkels

The building blocks of melody and harmony (version 1)


Music theory can be very confusing, with lots of complicated names and many different, often contradictory terms referring to the same things. However, the basic principles underlying all of music are very elegant and surprisingly simple. In this guide, I will go through the basics of harmonic theory, one step at a time and starting at the very beginning. I will do my best to minimise confusion by keeping things as simple as possible and providing interactive sound examples along the way.

This guide is part of my project for designing a new musical instrument, the Arithmophone and is meant to explain the principles on which that instrument works. However, these principles are very general and apply to all kinds of music, so this guide could be of some use to anyone seeking a better understanding of melody and harmony.

Tones and notes

Tones are patterns of sound that repeat over time. The faster the pattern repeats, the higher the pitch of the tone. The pitch of a tone is also called its frequency, and it is measured in Hertz (Hz), the number of repetitions per second. Human ears are sensitive to frequencies from about 20 to 20000 Hz, but at the extremes of this range it becomes very difficult do identify pitches. In musical terms, most people will be able to recognise tones with a base frequency between about 50 and 5000 Hz.

Adjust the slider to change the frequency, then click to the button to hear the tone. You probably won’t be able to hear the very highest frequencies because of the limits of your hearing. The very lowest frequencies cannot be reproduced by computer speakers, but should be audible on headphones.

Tones of different frequencies can be recognised as different musical notes. The ratios between these notes are called intervals. The simplest musical interval is called the octave, which is the ratio of 1 to 2. If you play a tone with a certain frequency, then a tone with double that frequency will sound an octave higher, while a tone with half that frequency will sound an octave lower. Even though these tones have different frequencies, in musical terms, they are all the same note. Other simple ratios, such as 2 to 3 and 4 to 5, produce different intervals and also different notes. Together, these intervals function as the basic building blocks for melody and harmony. 

The harmonic series

When you pluck a string, it starts vibrating at a certain frequency. For example, if you pluck the open G string on a regular guitar, the frequency is around 200 Hz. This frequency is called the fundamental or the first harmonic. But a vibrating string doesn’t just produce a fundamental tone, it produces overtones as well. These overtones, also called ‘harmonics’, are simply multiples of the fundamental frequency. So when you pluck a string that is tuned to 200 Hz, the sound you hear will also contain the harmonic frequencies of 400 Hz, 600 Hz et cetera. This is a natural consequence of the physical properties of resonating bodies, and with some slight modifications, the same principle applies to other methods of generating sound, like blowing on a wind instrument. 

The fundamental frequency is usually the loudest and in general, the higher the harmonic, the less noticeable it becomes. Our ears experience this combination of frequencies as a single note with a certain sound color or timbre. The proportion of the harmonics determine the timbre. This is one of the reasons that we can easily distinguish a note played on a trumpet from the same note played on a guitar: they have different harmonic characteristics. Some sounds are very low in harmonic content and contain mainly the fundamental: whistling is a good example of this. However, most musical instruments are very rich in harmonics.

So even if we hear just one note, we already hear many different frequencies contained within that note. These frequencies are simple multiples of the fundamental tone. From this, we can begin to see where different musical notes are coming from. If we start with a frequency of 200 Hz, then the frequencies of the first 8 harmonics are:

200 Hz, 400 Hz, 600 Hz, 800 Hz, 1000 Hz, 1200 Hz, 1400 Hz, 1600 Hz

In terms of ratios, taking the fundamental frequency as 1, this can be rewritten as:

1/1, 2/1, 3/1, 4/1, 5/1, 6/1, 7/1, 8/1

Or simply as:

1, 2, 3, 4, 5, 6, 7, 8

Click the blue button to hear a single note containing many harmonics. Click on the red buttons to hear the first 8 harmonics in isolation.

Octave reduction

It is a central fact of music that the simplest and smallest harmonic ratios represent very large jumps in pitch. The third harmonic is 3 times the fundamental frequency, so it sounds about an octave and a half higher than the fundamental. The fifth harmonic of 5 times the fundamental frequency is another octave higher up and so on. These simple ratios form the basic underlying principle of all music, but in melody and harmony they are rarely heard in their ‘naked’ form. 

The harmonic series produces different notes across many octaves, but we can bring these notes closer together by dividing their frequencies by 2 as many times as we like, because that will just give us the same note in a lower octave. For the first 8 harmonics, that leaves us with:

1/1, 2/2, 3/2, 4/4, 5/4, 6/4, 7/4, 8/8.

After simplifying the fractions, this becomes:

1, 1, 3/2, 1, 5/4, 3/2, 7/4, 1

So even though we have 8 different harmonics, we only have 4 different notes. Of these, the 1 is very strong: it is both the fundamental, which is already the loudest, and it is also present 4 times in the sequence, which further reinforces it. The next strongest note is the 3, because it appears twice and also relatively early in the sequence (remember that the higher the harmonic, the softer it sounds). The 5 is weaker, appearing only once, and the 7 weaker still, appearing later in the sequence. Of course, this pattern continues after the first 8 harmonics. Every odd number produces a new overtone, but every new harmonic is weaker than the ones before. So even though in theory the harmonics go on to infinity, in practice their relevance quickly diminishes. In fact, the whole system of Western music, with 12 notes to the octave, can be constructed just by using the first five harmonics, which is to say, the octave, the third and the fifth. 

Click the buttons to hear the first 8 notes of the harmonic series, brought within close range by octave reduction.

Moving up and down

Because any interval is a relationship between two notes, it functions in two directions. If we start with a tone of 100 Hz and then take the third harmonic of 300 Hz, the second stands to the first in a ratio of 3 to 1, or 3/1. But at the same time, the first stands to the second in a ratio of 1 to 3, or 1/3. If the third harmonic is an overtone of the fundamental, we might just as well call the fundamental an undertone of the third harmonic. In naturally occurring sounds, such as an oscillating string, the fundamental is the lowest frequency produced and only overtones are present as harmonics. But as far as musical intervals are concerned, there is a great symmetry between overtones and undertones. This is because we can experience any pair of notes from the ‘perspective’ of either the lower or the higher note, depending on the musical context.

Click the buttons to hear the symmetry between overtones and undertones. You can switch from simple ratios to octave reduced ratios with the yellow buttons to make the similarities easier to recognise. For example, the interval from 4/5 to 1/1 is the same as the interval from 1/1 to 5/4. The central note 1/1 is contained within the undertone 1/5 in exactly the same way that it itself contains the overtone 5/1.

Moving step by step

When we apply octave reduction, the order of the notes (from lowest to highest) changes. For example, 5/1 is a higher harmonic than 3/1, and therefore it has a higher frequency. But 5/4 is closer to 1/1 than 3/2, so after octave reduction their order is switched. Once we bring our notes within a single octave range and put them in sequence, familiar-sounding melodies will start to emerge when we move through the notes step by step.

Click the buttons from left to right to hear a simple melody that is ‘hidden’ within the simple ratios of the harmonic series, but becomes apparent after octave reduction.

Combining harmonics

Some of the most commonly used notes in music are not direct over- or undertones, but are the result of combined ratios. For example, if you go up from 1/1 to 3/1 and then down by 1/5, you end up with the ratio 3/5.

Click the buttons to hear how combined ratios produce new musical notes. Note that 5/3 relates to 1/3 in exactly the same way that 5/1 relates to 1/1, et cetera. Switching to octave reduced ratios makes these relationships easier to hear.

Full scale harmonics

With the inclusion of the combined ratios introduced above, we now have all the ingredients we need to make chords and melodies. For example, the common major scale is built from these ratios:

Click on the buttons to hear each note, or play them from your computer keyboard, starting on the letter “z” (click on the image first to activate this feature). The 1/1 note is tuned to 261.63 Hz, commonly known as “Middle C”.

From melody to harmony

Chords are made by playing multiple notes at once. The example below presents two of the most basic chords: the major and minor triads (a triad is a three-note chord).

Click the buttons on the left to hear the notes of the major and minor chords one by one, click the buttons on the right to hear all three notes simultaneously.

A note on names and numbers

We have seen that we can divide or multiply any frequency by 2 as many times as we like, without changing the note it represents. It simply becomes the same note in a different octave. The harmonics of a note stretch out over many octaves. But when we construct a scale, we ‘reduce’ the octaves so that all the different notes land in the same octave. As we have seen, this influences the order of the notes. 1, 3, 5 becomes 1/1, 3/2, 5/4 and since 5/4 is less than 3/2, the notes appear in the scale in the order 1/1, 5/4, 3/2.

In the common major scale “do, re, mi, fa, sol, la, ti, do”, the third note “mi” is based on the ratio 5/1 and the fifth note “sol” is based on the ratio 3/1. So the third note of the scale is actually the fifth harmonic and the fifth note of the scale is the third harmonic . This switching around of 3 and 5 can be more than a little confusing. To make things as clear as possible, I have included the table below. It is good to keep in mind that ratios always refer to harmonics, whereas intervals described in words or in roman numerals, like “a major third” or “a flat VII” generally refer to scale position.

Note (key of C)CDEFGABC
Note name (solmization)DoReMiFaSolLaTiDo
Harmonic ratio (simple)1/19/15/11/33/15/315/11/1

The 3-5 Tone Grid

As long as we limit ourself to the first five harmonics, we can arrange every possible note in a two-dimensional grid. Multiplying or dividing by 1 does not change a note and multiplying or dividing by 2 and 4 just gives the same note in a different octave. So we only need two axes to produce any note: one for the 3-ratios and one for the 5-ratios. For instance, this can be done in the following way: any step to the right is always a multiplication by 3, any step to the left a division by 3, any step up a multiplication by 5 and any step down a division by 5. In this way, any ratio within the 5-limit system can be produced.

How this works can be seen and heard in the illustration below. To keep things practical, I have limited the grid to a distance of 3 harmonic steps from the center. In principle, it could be extended infinitely in all direction, but even with this restriction we already get 25 different notes, more than twice as many as you’ll find on a regular piano, which has only 12 different notes (a grand piano has 88 keys, but these are just over 7 octaves of the same 12 notes).

Adjust the legend to show ratios, note names or scale degrees and click the buttons to play the notes. The center frequency is 392 Hz, the musical note “G” and the ratio 1/1 in this example. All other ratios are frequency reduced to bring them closer to the center frequency. For example, the ratio 9/1 is divided by 2 three times, so that the sounding frequency is 392 *9/8 = 441 Hz. For clarity, the simple (unreduced) ratios are shown in the illustration.

You may notice that many note names appear more than once on this grid. For example, both the ratio 5/9 and the ratio 9/1 are labeled “A”. After octave reduction, 5/9 becomes 10/9 and 9/1 becomes 9/8. These two ratios are very close together (10/9 is approximately 1.111 and 9/8 is 1.125) and that is the reason they end up on the same letter, but they are not identical. On a piano there is only one “A” but in harmonic tuning there are at least two.

So, which “A” is the right one? The answer is: it depends on the context. If you want to play a D chord, the 9/1 ratio sounds more in tune, because that is the third harmonic of the 3/1 D. But if you want to play an F chord, it makes more sense to use the 5/9 ratio, because that one combines with the 1/9 F and the 1/3 C to form a perfectly tuned major triad. You can play around with the 3-5 tone grid above to get a feeling for these subtle differences.

Infinite possiblities

The 3-5 tone grid above has 25 different notes, more than twice as many as in standard piano tuning. But it is by no means complete. We can create many different melodies and harmonies starting from the central 1/1 ratio, but when we take one of the other notes as a starting point, we run out of options pretty soon. Let’s say we would like to make a major chord starting on the 45/1 C#. To make this a well tuned chord, we would need a third and fifth harmonic above the starting note: a 135/1 G# and a 225/1 E#. Neither of these notes is present in our grid. Of course, we could extend the grid further to add more notes but this will quickly become unpractical, and what is more, we will still never get a complete set of notes, because there are infinitely many of them.

If anyone ever told you that there are only 12 notes in music, they were lying, even if they probably didn’t realise it. In reality, there aren’t 12 different notes, or 25 or any other number: there is an infinite number of notes. Our 3-5 grid can be extended forever in any direction, and even then we wouldn’t have covered any note that isn’t within the five limit system, like the simple 7/1 ratio (the seventh harmonic).

This may seem like a big problem for making music, but in practice, it usually isn’t much of an issue. Most kinds of music use only a very modest selection of notes and stick pretty close to a single tonal center (like the 1/1 G in the example above). Even when more notes are required, as long as your instrument is flexible in pitch (like the human voice or the violin), you can simply adjust the tuning for each note as you play it. This is what happens when people sing in close harmony or play in a string quartet: they adjust the pitch to gently slide between one “A” and the other, as circumstances require and often without being consciously aware of it.

There is however one scenario in which this infinity of notes does present an very practical problem and that is when you want to play music that is able to modulate freely from one tonal center to the next, on an instrument with fixed pitch notes. This is what happened in Western Music in the Baroque era when keyboard instruments (organs, harpsichords and later on pianos) became prominent and the musical style demanded a lot of harmonic mobility. It is in this context that the system of 12 tone equal temperament, by now completely ubiquitous in Western music, first evolved.

The circle of fifths

If you’ve ever had any music theory lessons, chances are that you’ve encountered the circle of fifths, a pretty simple diagram that explains the relationship between different notes and keys. These fifths form a perfect circle of exactly twelve notes. But we have already seen in our 3-5 tone grid that repeatedly jumping the same interval keeps generating new notes, an infinite amount of them. So how does this work?

For starters, we should be aware that the word “fifths” in this context refers to the fifth note of a scale, not the the 5/1 ratio. So an example of a fifth is the jump from “C” to “G” (skipping “D”, “E” and “F”). You can also think of it as DO (re mi fa) SOL. This is in fact the ratio 3/1. If you’re still somewhat confused by this reversal of 3 and 5 (and understandably so), please reread the paragraph “A note on names and numbers” above.

If we jump a fifth from “C” (or 1/1), we end up on “G” or (3/1). If we then jump another fifth, we go from “G” to “D” (or 9/1, because that is equal to 3/1 times 3/1). We can keep going in this way, and our sequence of notes will look like this:

C → G → D → A → E → B → F# → C# → G# → D# → A# → E# → B#

Now at this last note, something interesting happens. This “B#” is a new note just like the ones before it, but its frequency is very close to the “C” we started on (after we’ve reduced the octaves to bring it in the same range). It is in fact a bit higher, but so little that to our ears it sounds more like an out of tune version of “C” than like an entirely new note.

So “B#” is almost, but not quite, the same as “C”, or to put it more generally: 12 jumps of a fifth are almost equal to an octave. This simple fact is the key to 12 tone equal temperament. By tuning every fifth to a ratio that is slightly smaller than 3/1, we can make it so that our “C” and “B#” notes do in fact become perfectly identical. Because the tuning difference is spread out equally over all 12 notes, all our fifths still sound almost perfectly in tune.

Click the buttons to hear the circle of fifths in rational and tempered tuning. The green inner circle is tuned to pure ratios. All fifths are perfectly in tune with their neighbouring notes, but 12 fifths add up to slightly more than an octave. The further away a note is from the tonal center (the “C” in this example), the more its frequency differs from the equal tempered tuning. Because F# and Gb are on opposite sides of the tonal center, they do not have the same frequency. The yellow outer circle is tuned to 12 tone equal temperament. In this system, each fifth is tuned slightly flat so that 12 fifths add up to exactly one octave. Because of this tempering, F# and Gb have the same frequency.

Tempered tuning versus just intonation

Nature gave us an infinite spiral of notes, and with some very clever retuning, humans turned it in to a much simpler circle of only 12 notes. The benefits of equal temperament are enormous. It gives us a practical way of constructing mechanical keyboard instruments that are highly flexible and sophisticated. It also gives us a musical framework that allows for enormous harmonic freedom, because all notes are now equally suitable to function as the tonal center. However, 12 tone equal temperament does have its downsides and limitations.

We’ve seen that musical notes have their origin in under- and overtones, and that these can be expressed as simple numerical ratios. We can use these rational intervals to tune our instrument, and this kind of tuning is usually called ‘just intonation’. There are infinitely many musical ratios, so if we only have a limited number of keys / strings / organ pipes at our disposal, we can only use a small selection of these. With just 12 different notes, we can still make a very musically useful selection, but only from one tonal center. As long as we stick to our ‘home’ key, we are perfectly in tune, but as soon as we want to modulate to a different key, our tuning goes sour.

12 tone equal temperament does not have this problem, but instead it sounds slightly out of tune in all keys. The difference is not so noticeable in pure 3-ratios, because these are very closely approximated in this tuning. But for 5-ratios like 5/1 and also for combined ratios like 15/1 or 3/5, the tuning is actually pretty far off. So while the jump from “C” to “G”, for example, is almost perfectly in tune in equal temperament, the jump from “C” to “E” leaves quite a bit to be desired.

A piano tuned to just intonation with the “C” taken as the 1/1 ratio will sound perfectly in tune as long as you play in the key of C, but if you start playing in the key of F# for example, it will sound quite unpleasant. A piano tuned to equal temperament will sound a bit more out of tune in the key of C, but better in any other key. The difference between just intonation and equal tempered tuning is quite subtle, but definitely audible. Try it out in the illustration below:

Click on the buttons to hear each note, or play them from your computer keyboard, starting on the letter “z” for the lower keyboard or “q” for the upper keyboard (click on the image first to activate this feature). The lower keyboard is tuned to rational intervals, starting from the leftmost note. The upper keyboard is tuned to 12 tone equal temperament. The first and last notes of both keyboards are identical, the other notes differ. For some notes, the difference is bigger than for others. For example, the “G” and 3/2 notes sound nearly identical but the “A” and 5/3 notes are quite different. Headphones are recommended for hearing these differences as clearly as possible.

The ‘out-of-tuneness’ of 12 tone equal temperament is most apparent when several notes are played simultaneously. Most melodies by themselves sound quite similar in both 5-limit just intonation and 12 tone equal temperament, but chords really do get a different character depending on the tuning that is used:

Click the buttons to hear some common chords in just intonation (JI) and 12 tone equal temperament (ET) and notice the difference. The ratios of the notes in the just intonation chords are spelled out above their respective buttons. The last chord is a bit of a special case, because it contains the 7th harmonic in just intonation, a note that isn’t really represented in 12 tone equal temperament. This just intonation chord is however the closest equivalent of the dominant 7th chord (C – E – G – Bb in this example) that plays a very important role in equal tempered music. Headphones are recommended again for this example.


Musical notes come in many different flavours. Rational tuning is the purest expression of these flavours, but it is not always the most practical option. 12 tone equal temperament is a fantastic invention and its many advantages have led it to dominate Western music, perhaps so much so that we hardly even notice its out-of-tuneness anymore. But is is definitely not the be-all and end-all of music.

Just intonation still has its place in many forms of traditional music, and can be put to excellent use in electronic music as well. Not only does it offer better tuning and stronger resonances for the familiar notes and chords of standard tuning, but by adding in ratios based on higher overtones like the 7th and 11th harmonics, whole new sonic worlds can be opened up.

As far as temperaments go, 12 tone equal is also not the only option. Many other temperaments have been developed, and some of these have distinct advantages over the familiar 12 tone system. For example, 31 tone equal temperament provides a far better approximation of 5-ratios than 12 tone equal temperament, while the 3-ratios are only slightly less in tune. It even offers decent representations of the 7th, 11th and 13th harmonics.

The Arithmophone project explores some of these options and puts them side by side for easy comparison. So if you’d like to see and hear more, please continue reading the Arithmophone manual or just give it a play.

If you’d like to experiment for yourself with different tunings, I highly recommend this wonderful project: Leimma / Apotome.

For further reading, this excellent article gives a great account of the cultural significance of different tunings, particularly in relation to electronic music.

And finally, I would not have been able to make this guide without this fantastic book: Harmonic Experience by W.A. Mathieu. It is a true fountain of knowledge and if you’d like to develop a more in depth understanding of music theory (and practice!), I can think of no better place to go!

This page is part of my Arithmophone project.
Arithmophone concept and design by Chiel Zwinkels © 2022