Most people probably have an innate understanding of what it means to be “in tune”. Generally we define this as the state in which a musical sound seems to match or harmoniously complement another musical sound. In Western musical theory (that is, the music of the western hemisphere, not “western music”) we have a well-established set of fixed musical notes with 12 chromatic notes per octave. The notes on a piano or a fretted instrument such as guitar are (1) fixed quantized values assigned to a key or fret position and (2) compose a set that is consistent within and across these instruments, so if you play middle C on a piano and middle C on a guitar they will be the same pitch and therefore the same note.
So, are the notes on these instruments in tune? The answer is yes. And no.
This post is long, and is a core part of the music theory postings on this site. Read on for details.
Vibrations and Measurement
In the most basic physical sense, all sound results from an object that is in motion. For example, when you pluck the string on guitar, it begins to vibrate. This causes the air in the room to vibrate and our ears detect this vibration, relaying a message to the brain that sound is being heard. The brain perceives physical waveform characteristics of the vibrations such as pitch, loudness, and timbre. The guitar string’s vibration continues, decaying over time until it can no longer be heard.
One commonly used term to describe musical sound is pitch, meaning “how high or how low” a note sounds. The relative highness or lowness is our interpretation of the number of times an object is vibrating during a period of time. We use the physics unit “Hertz” (or Hz) to describe the number of vibratory cycles per second. A higher pitched musical sound has more vibrations per second than a lower one. The human ear detects vibrations from about 15 Hz to 16 KHz, giving us a range of human-detectible pitches to use in music. One of the common tuning standards for pianos, guitars, and symphonies is the pitch 440 Hz. This pitch corresponds to the note “A”, and is commonly referred to as “A440″. It is worth noting that the A440 standard is not universal; this happens to be the most common tuning standard but there are notable variations in the symphonic world, generally varying by less than 5 Hz. For the sake of simplicity, we will confine our discussion to the A440 tuning standard.
The Mathematics of Harmony
Music consists of pitches (notes), played one after the other. In simple early forms of music, only one pitch is used at a time, even though more than one voice or instrument may be sounding that pitch simultaneously (musicologists call this “homophony”). When a second pitch (“harmony”) is used at the same time, our brain interprets the results of the combination of these two pitches. Some two-note harmonies are considered pleasing (consonant) and others are considered less pleasing (dissonant). Most people find certain precise combinations as particularly pleasing, and there is a mathematical principle behind this.
You were probably introduced to Pythagoras (580 BCE – 505 BCE) at some point in your education. He was the Greek scholar most famous for the Pythagorean Theorem which states that the sum of the squares of the two legs of a right triangle is equal to the square of the hypotenuse. Pythagoras believed that the fundamentally simple principles of geometry and musical harmony could explain the fabric of the universe. According to legend, his musical discovery first occurred when he heard the sound of four blacksmith’s hammers striking anvils. Certain pairs of the hammers sounded consonant and other pairs dissonant:
- A + B = consonant
- A + C = consonant
- A + D =Â the same note
- BÂ +Â C = dissonant
To understand further, Pythagoras weighed the hammers. Each weighed a number of “units” (some say that Pythagoras used the standard pound for this, but it is irrelevant which unit of measure is used as long as it is constant).  He determined that their relative weights could be expressed as follows:
- A weighed 12 units
- B weighed 9 unit
- C weighed 8 units
- D weighed 6 units
When two hammers were struck at the same time, their relative weights could be expressed as a ratio:
- A + B = 12:9Â (or 4:3)
- A + C = 12:8 (or 3:2)
- A + D = 12:6 (or 2:1)
- B + C = 9:8
Based on the ratios of the mass of these hammers, he discovered a series of mathematical relationships between musically harmonious note intervals. His subsequent experiments were conducted using a simple instrument called themonochord. The monochord consists of a single string stretched between two stationary supporting endpoints, with a movable bridge in the middle, dividing the string into two segments. If the bridge is in the exact center of the string length, the two segments will be exactly the same length with a ratio of 1:1, and therefore the same pitch will sound. If the bridge is moved, the two segments will have different lengths, and therefore different pitches. Pythagoras discovered that certain ratios of string lengths would result in pitch combinations that were especially consonant.
- 1:1Â Unison
- 2:1Â Octave
- 3:2Â Perfect Fifth
If you hear these Pythagorean harmonies, you will almost certainly agree that they are very much in tune and sound pleasing. The Pythagorean-tuned perfect fifth is richly consonant, so we assume it must be in tune. Using just these three simple harmonic ratios, we can explore the Pythagorean scale, beginning at A440 and ending at the note one octave above it. We’ll use the ratio of the Perfect Fifth (3:2), moving around of the circle of fifths to fill out the notes of our scale until we arrive back at the note A again. There are 12 notes in the chromatic scale, so this will require 12 repetitions of the 3:2 ratio, each continuing from the previous note.
- We identify our starting pitch as A440. By definition, the octave note A’ will have a 2:1 ratio to the starting note A.
- Expressing this octave relationship mathematically, we have (440 Hz *2) = 880 Hz.
- This defines the frequency range of our octave. We know that all our notes will fall in between 440 Hz and 880 Hz.
- Each n step around the circle of fifths results in a frequency f whose formula can be mathematically described as
f = (((3:2)^n) x 440 Hz),  and we can apply the 2:1 octave rule when necessary to keep our resultant frequency f within our 440 Hz < f < 880 Hz spectrum.
With these rules we will begin building a table of pitches for our Pythagorean scale.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A’ |
2:1 |
880 Hz |
So far so good. Let’s go ahead and add our next note, the perfect fifth. The note E is a perfect fifth above A, with a pitch ratio of 3:2 from our starting note A440
Here is the mathematical formula for computing the value: (440 Hz*3)/2 = 660 Hz
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
E |
3:2 |
660 Hz |
A’ |
2:1 |
880 Hz |
We’ll continue by adding our next note. The note B is a Perfect Fifth above E, with a ratio of 3:2 above its frequency.
Math: (660 Hz*3)/2=990 Hz
This is above 880 Hz, our highest frequency in the octave. We want to get a B note in the same octave range as the original A note, so the frequency should fall between 440 Hz and 880 Hz. Remember that all octaves have a 2:1 ratio, so our B note at 990 Hz can be divided by 2 to get 495 Hz, the same pitch, but one octave lower.
Our ratio from the starting A440 note is ((3:2)^2)/2 or 9:8
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
B |
9:8 |
495 Hz |
E |
3:2 |
660 Hz |
A’ |
2:1 |
880 Hz |
The note F# is a Perfect Fifth above B, with a ratio of 3:2 above its frequency.
Math: (495 Hz *3)/2 = 742.5 Hz
The ratio from the starting A440 note is (3:2)^5 or 27:16
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
B |
9:8 |
495 Hz |
E |
3:2 |
660 Hz |
F# |
27:16 |
742.5 Hz |
A’ |
2:1 |
880 Hz |
The note C# is a Perfect Fifth above F#, with a ratio of 3:2 above it.
Math: (742.5 Hz*3)/2 = 1113.75 Hz
To keep this note in the same octave we divide by 2, which gives us 556.875 Hz
The ratio from the starting A440 note is now (3:2) ^4 or 81:64
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
B |
9:8 |
495 Hz |
C# |
81:64 |
556.875 Hz |
E |
3:2 |
660 Hz |
F# |
27:16 |
742.5 Hz |
A’ |
2:1 |
880 Hz |
The note G# is a Perfect Fifth above C#, with a ratio of 3:2 above it.
Math: (556.875 Hz*3)/2 = 835.3125 Hz
The ratio from our starting A440 note is now (3:2)^5 or 243:128
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
B |
9:8 |
495 Hz |
C# |
81:64 |
556.875 Hz |
E |
3:2 |
660 Hz |
F# |
27:16 |
742.5 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
The note D# is a Perfect Fifth above G#, with a ratio of 3:2 above it.
Math: (835.3125 Hz*3)/2 = 1252.96875 Hz
Divide by 2 to get 626.484375 Hz
The ratio from our starting A440 note is now (3:2)^6 or 729:512
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
B |
9:8 |
495 Hz |
C# |
81:64 |
556.875 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
F# |
27:16 |
742.5 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
At this point we have the diatonic notes (those notes considered as members of the normal set) for the A Major scale. It looks like we’re on track here. But let’s continue with our exercise. Remember that there are 12 chromatic pitches in Western music theory. Starting with the last note we added (D#), let’s continue with computing the rest of the chromatic notes.
The note A# is a Perfect Fifth above D#, with a ratio of 3:2 above it.
Math: (626.484375 Hz*3)/2 = 939.7265625 Hz
Divide by 2 to get 469.86328125 Hz
The ratio from our starting A440 note is now (3:2)^7 or 2187:2048
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
C# |
81:64 |
556.875 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
F# |
27:16 |
742.5 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
The note E# is a Perfect Fifth above A#, with a ratio of 3:2 above it.
Math: (469.86328125 Hz*3)/2 = 704.794921875 Hz.
Divide by 2 to get 352.3974609375 Hz
The ratio from our starting A440 note is now (3:2)^8 or 6561:8192.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
C# |
81:64 |
556.875 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
E# |
6561:8192 |
352.3974609375 Hz |
F# |
27:16 |
742.5 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
The note B# is a Perfect Fifth above E#, with a ratio of 3:2 above it.
Math: (352.3974609375 Hz*3)/2 = 528.59619140625 Hz.
The ratio from our starting A440 note is now (3:2)^9 or 19683:16384.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
B# |
19683:16384 |
528.59619140625 Hz |
C# |
81:64 |
556.875 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
E# |
6561:8192 |
352.3974609 Hz |
F# |
27:16 |
742.5 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
The note F## (F double sharp is enharmonic with G) is a Perfect Fifth above B#, with a ratio of 3:2 above it.
Math: (528.59619140625 Hz*3)/2 = 792.894287109375 Hz.
Divide by 2 to get 396.447143554687 Hz
The ratio from our starting A440 note is now (3:2)^10 or 59049:32768.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
B# |
19683:16384 |
528.59619140625 Hz |
C# |
81:64 |
556.875 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
E# |
6561:8192 |
352.3974609 Hz |
F# |
27:16 |
742.5 Hz |
F## |
59049:32768 |
396.447143554687 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
The note C## (C double sharp is enharmonic with D) is a Perfect Fifth above F##, with a ratio of 3:2 above it.
Math: (792.894287109375 Hz*3)/2 = 594.670715332031 Hz.
The ratio from our starting A440 note is now (3:2)^11 or 177147:131072.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
B# |
19683:16384 |
528.59619140625 Hz |
C# |
81:64 |
556.875 Hz |
C## |
177147:131072 |
594.670715332031 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
E# |
6561:8192 |
352.3974609 Hz |
F# |
27:16 |
742.5 Hz |
F## |
59049:65536 |
396.447143554687 Hz |
G# |
243:128 |
835.3125 Hz |
A’ |
2:1 |
880 Hz |
Let’s add the last note to our chromatic scale.
The note G## (G double sharp is enharmonic with A) is a Perfect Fifth above C##, with a ratio of 3:2 above it.
Math: (594.670715332031 Hz*3)/2 = 892.006072998046 Hz.
The ratio from our starting A440 note is now (3:2)^12 or 1062882:524288.
Note Name |
Ratio From A440 |
Frequency |
A |
1:1 |
440 Hz |
A# |
2187:2048 |
469.86328125 Hz |
B |
9:8 |
495 Hz |
B# |
19683:16384 |
528.59619140625 Hz |
C# |
81:64 |
556.875 Hz |
C## |
177147:131072 |
594.670715332031 Hz |
D# |
729:512 |
626.484375 Hz |
E |
3:2 |
660 Hz |
E# |
6561:8192 |
352.3974609 Hz |
F# |
27:16 |
742.5 Hz |
F## |
59049:65536 |
396.447143554687 Hz |
G# |
243:128 |
835.3125 Hz |
G## |
1062882:524288 |
892.006072998046 Hz |
A’ |
2:1 |
880 Hz |
So, here we are at the end of all that math, and there seems to be a bit of a problem. G## is enharmonic with the note A, so we expect G## to be the same frequency as A’. As you can see from the chart, these frequencies are not the same. The math is right… we’ve gone all the way around the chromatic scale using the 3:2 ratio provided by Pythagoras, but the octave note is not what we expected.
Why Are These Frequencies Different?
The ratio of G## to our starting A440 is 1062882:524288. This is slightly larger than 2:1 and our octave note has a discrepancy of over 12 Hz from what we expected. This discrepancy is called “Pythagorean Comma”. The notes in the Pythagorean scale sound very much purely in tune, especially when building diatonic chords in the key upon which the scale is based (in this case, the key of A). This scale yields acoustically perfect fifths that are musically satisfying, but it is important to note that the whole tone interval (for instance from A to B) is not equal to the sum of two semitones (A to A# to B). The problem with this approach is that you need to recompute (and thus retune) the intervals for each key based on the starting note. If you happen to be playing a piano that has been tuned to the Pythagorean scale, it sounds beautifully in tune for only one key.  If you change keys, the entire instrument needs to be retuned in reference to your new key center.
During the early Renaissance, composers began to modulate (change tonal centers) to different keys during a composition. Pythagorean tuning produced unacceptable dissonance in these other keys. To alleviate this problem, some alternate tuning systems were devised. One tuning system, the mean tone tuning, made the fifth slightly flat in order to provide acoustically perfect thirds. However, it still suffered from a discrepancy between adjacent semitones. Four of the chromatic keys were closer to perfect acoustic tuning than the other eight. As one modulated key centers successively, the semitone tuning discrepancy became gratingly dissonant.
Equal Temperament
The eventual solution to the tuning standard was to create a system in which
- Octaves observe the 2:1 ratio and are acoustically in tune
- All other intervals are acoustically slightly out of tune (tempered), by an amount that is small enough to be considered musically acceptable
With twelve even ratios per octave, we can find the ratio of adjacent tones using the formula:
- r^12 = 2
or
- r=twelfth root of two
or
- r=2^(1/12)
Equal temperament divides the octave into 12 equal semitones, using a constant ratio for adjacent semitones. The tuning system was embraced by Bach, most notably in his Well-Tempered Clavier, which comprises 24 preludes and fugues for keyboard (one in each of the 12 chromatic major and minor keys). In order to perform these compositions, the keyboard instrument must be equally tempered to avoid tuning dissonance in most keys. It is interesting to note that equally tempered Spanish guitars were in use before the year 1500, which predates theWell-Tempered Clavier.
So Are We In Tune?
The difficulty in answering this question has a lot to do with our perception of tuning. In the purest acoustic sense, we accept a tolerable magnitude of tuning error in order to allow all musical keys to equally consonant. This is especially true for “fixed” tuning instruments such as piano or fretted guitar.
On some musical instruments it is possible to make small adjustments to notes in order to perfectly tune intervals. These instruments include:
- Fretless bass
- Classical strings (violin etc.)
- Trombone
- Trumpet (using valve slides)
The Impact of Temperament on Getting Guitars in Tune
With frets to help quantize pitches, it should be less problematic to tune guitars or basses. Ironically, many guitarists and bassists learn a seemingly handy means of tuning their instruments using harmonics on adjacent strings. Since these instruments are tuned with (most) pairs adjacent strings having the relationship of a perfect fourth, if one sounds the fifth fret harmonic on the lower string and theseventh fret harmonic on the upper string, these notes appear to be sounding in unison. However, remember that:
- The guitar’s frets are placed in accordance with the equal temperament scale
- Harmonics belong to the Pythagorean scale of perfect ratios
- The fifth fret harmonic is producing a note whose ratio above the fundamental is 4:1 (two octaves). This note belongs to both the equal temperament scale and the Pythagorean scale. By definition this note is in tune with both systems.
- The seventh fret harmonic produces a note whose relationship to the open string is exactly 3:2. This ratio belongs to the Pythagorean scale but not to the equal temperament scale.
Therefore this tuning method will very nearly tune the instrument, but introduces an error whose magnitude is equal to the Pythagorean comma. Granted, this is a very small discrepency that can only be detected by a very sensitive ear. But it’s not in tune, and the tuning error should not be overlooked.
The most reliable means of tuning instruments is to use a “strobe tuner” or other electronic tuner. This ensures that the base intervals are equally tempered, with further “musical tuning” adjustments made during performance at the discretion of the performer.