# Why can't notes be tuned according to a defined frequency?

Why is it that everyone says a piano can never be in tune?

Why can't we just assign a particular frequency to every note (A, A#, B, C, C#, etc) and then tune each piano string to the frequency of each note?

Similarly for guitar strings: why can't we just put the frets such that the strings will vibrate at the correct frequency?

Is it that difficult? Can't this solve the problem of just intonation sounding different in every key except one and equal temperament being slightly out of tune in every key?

• See music.stackexchange.com/questions/14244/… and music.stackexchange.com/questions/60683/… "Is it that difficult?" …Yes. Jun 16, 2020 at 9:05
• Does this answer your question? Why do we need tempered tuning? Jun 16, 2020 at 9:20
• On guitar, there are fanned-fret guitars which help to compensate, but every fretwire, to accomodate your ideal, would be a zig-zag shape, and it still wouldn't sound good in some keys!
– Tim
Jun 16, 2020 at 11:24
• Nobody says that. People say similar things with explicit constraints such as choice of just vs. well-tempered and so on. Jun 16, 2020 at 15:42
• The problem of trying to tune a keyboard to just intonation isn't just that some keys are unusable; it's not possible to make all the chords of even one key usable. For example, it's not possible to tune the I, ii, IV, and V chords of a major key in just intonation. Jun 17, 2020 at 19:42

Why can't notes be tuned according to a defined frequency?

They can. But what we can't do is tune them to "the correct" frequency, because there are different ways in which the 'correct' frequency could be specified. You've mentioned two of them in your question - just intonation, and equal temperament. As Kilian Foth's answer explains, both of those ways of tuning have advantages and disadvantages. Neither is 'correct'.

Why is it that everyone says a piano can never be in tune...

Pianos (and other stringed instruments) introduce a further complication, which is that the partials of the string don't follow a perfect harmonic series, due to the real world physics of how the string works. This effectively means that a single piano note isn't actually in tune with itself, let alone other notes! This is compensated for to an extent by stretched tuning.

Is it that difficult...

It is, but it's also that wonderful! If we lived in a world where there were really only 12 notes at the 'correct' frequencies, everything might sound very samey. It's the variations in tuning and note intonation that give music a lot of its subjective beauty and variety.

Well why cant we just define one note say A as 440hz and derive every other note's freq as multiples of 12th root of 2 from A and call it the true notes instead of saying they are slightly out of tune. I mean the frequency of a particular note is not predefined. We can decide what it should be right?

Well, we can decide what the frequency of one note is, yes. But when it comes to deciding what the frequency of another note is that we want to sound in tune with that note - no, we can't just decide what it is. The ear human ear's perception of what's 'in tune' doesn't depend on definitions of what 'the true notes' are - it depends on notes having frequency ratios that are equal to, or close to, certain ratios.

• Well why cant we just define one note say A as 440hz and derive every other note's freq as multiples of 12th root of 2 from A and call it the true notes instead of saying they are slightly out of tune. I mean the frequency of a particular note is not predefined. We can decide what it should be right? Jun 16, 2020 at 10:30
• What would you gain with that @LeloucheLamperouge? Nothing would change to the way we perceive music if you do that. Some intervals sound more pleasant to the ear when played according to the Pythagorean definition (for instance, a 5th being 1.5 times the frequency) than to the 12-TET standard. Some accomplished musicians can slightly alter the pitch of a 12-TET 5th to match the other instruments they play with to great effect. Why would you want to take that away? It would be to the detriment of beautiful music. Jun 16, 2020 at 10:54
• Regarding "If we lived in a world where there were really only 12 notes at the 'correct' frequencies, everything might sound very samey. It's the variations in tuning and note intonation that give music a lot of its subjective beauty and variety." - I've listened to so much A440 12TET music that music purposefully written in just intonation sounds strange. IMO, variations in tuning, intonation, and temperament don't contribute much to music beauty and variety - in fact, temperament and tuning can easily make a piece sound worse by giving off an out-of-tune impression. Jun 16, 2020 at 11:18
• @LeloucheLamperouge I've replied in the question. The answer to your question comes down to why certain intervals sound more consonant than others - it's all to do with frequency ratios. Jun 16, 2020 at 13:46
• @LeloucheLamperouge - the reason is pure physics. When frequencies are exact multipliers of one another, the zeroes in the sine waves align, and they create a more pleasant sound in the ear. This is the basis of the octave, and this is how Pythagoras evolved scales initially. You will have heard quite a few musicians in this site mentioning that some 12-TET intervals sound dissonant to them. Apparently the major 3rd is the one that sticks out the most. Jun 16, 2020 at 14:55

We can tune each string/pipe to a given frequency as accurately as we need to for musical purposes.

We can't do it so that they collectively satisfy several musically desirable properties, because it turns out our definition of those properties is logically inconsistent. The best technology in the world cannot fulfill a requirement that contradicts itself.

In particular, it's not possible to tune perfect octaves (ratio 2:1) and simultaneously have all diatonic fifths be perfect fifths (ratio 3:2), because the math doesn't add up: twelve perfect fifths almost but not quite correspond to seven perfect octaves. (Mathematically, this is because 3 and 2 are mutually prime numbers.)

• Say you want to play something in C major using just intonation. You can compute all the frequencies you want using the interval, and (for example), you get a particular frequency for E. But with those frequencies, the intervals using E as the root won't quite be in tune: you can only tune your instrument to play in one key. Using equal temperament, all the intervals work out mostly correct regardless of what key you choose, but every interval except the octaves deviate to some degree away from the "idea" interval. Jun 16, 2020 at 18:26
• @LeloucheLamperouge: Biologically, our ears prefer combinations of frequencies with ratios containing small integers. Physically, this is because sound waves are additive and thus have a resultant frequency dependent on that ratio. Mathematically, 12 notes are chosen because different powers of 12th-root(2) give numbers very close to 5/4, 4/3, and 3/2, so we're able to create several nice combinations with just those 12 notes. Why that's true has to do with continued fractions, or something. Jun 16, 2020 at 21:04
• Slight nitpick: the third prong of the trilemma wasn't stated. You can have all perfect octaves and all perfect fifths be just... you just end up needing infinite notes in an octave to do it (Dbb, C, B#, Ax#, who says they're the same? They're not, we just pretend they are). Ergodic theorem says it's even dense. And yes 19/12 is one of the continued fraction convergents to log_2(3/2). As an accident, 2^(4/12) is an acceptable approximation to 5/4 as well. Jun 17, 2020 at 0:08
• @Ashley Yes, that's exactly it. This is why stacking fifths on top of each other results in pitches that slowly become ever higher compared with equidistant ones. Jun 17, 2020 at 12:48
• @BlueRaja-DannyPflughoeft by 'our ears prefer' you mean 'the minds of people brought up with western music'. There is little evidence it really is innate biology, as indigenous tribes do not share such preferences newscientist.com/article/… Jun 17, 2020 at 16:59

One more problem is that piano strings are under far more tension than those in other instruments. On average, each string is under 200-300 pounds of tension. Unlike the violin or guitar or harpsichord and their close relatives, piano strings are anharmonic vibrators. The frequency of the first overtone is more than 2/1 and the second is higher than 3/1. The anharmonicity varies per string. Each piano is a bit different as is each venue. Thus pianos need voicing (each string tuned slightly differently). All this is on top of the need for tempering as discussed in other answers.

• As far as I know, the anharmonicity is not a consequence of the tension; it's a result of the fact that the strings have stiffness, i.e., they resist being bent sideways, so the equations for perfectly flexible strings are not quite correct. The same also applies to guitar strings, but the pitch range of a guitar is not large enough for that to play a role in the tuning. (On the other hand, guitars have a whole zoo of other tuning issues, like the pitch going up when you pluck hard or press too hard on the string.) Jun 17, 2020 at 7:27
• @RichardMetzler correct. However, the stiffness and high tension are both consequence of the thickness, in that sense the statement does make sense. — Guitar and harpsichord do in fact have inharmonicity too, though less than piano. (Bass guitar meanwhile has substantial inharmonicity.) Violin does not, but that's not because of lower tension or even thickness, but because the bow creates a phase-locked loop that forces the overtones to have actual integer frequency ratios. Jun 17, 2020 at 15:42
• Aren't the usual words inharmonic and inharmonicity? Jan 30, 2021 at 17:54

It is possible to assign any frequency to any string (on physical instruments with maybe some, but very low error. Synthesizers, in our days, will have no error at all.) The question of a piano being “in tune” depends on what you mean by this.

The chords in a “Major” key have a special physical relation: From a base note (also known as general bass) the three notes are absolute multiples in frequency. (Duplicating the frequency gives the octave, this is why octaves sound so equal to each other.) So, from C1, frequency ×2 you get C2, frequency ×3 you get G3, frequency ×4 (×2×2) you get C4, frequency ×5 you get E5, frequency ×6 (×3×2) you get G5; here is the “major” chord. For a bass frequency of 110 Hertz, you get 440−550−660 as “A major” chord. This is “clean tune” but you won’t find that on a piano!

On a piano, the difference between each of the 12 half-tones is ×¹²√2, so that twelve keys later, you have ×(¹²√2)¹² = ×2 for the frequency. A mayor chord is then something close to: 440−554⅓−659¼. This is “tempered tune”, and it is still very close to the “clean tune”. This is because, if you would follow the rules of clean tune, going through a whole octave would be something around ×2,003475 and this soon starts sounding odd.

This is because of physics of frequency, and you can’t “fix” it.

• The 'A major' calculations aren't right - 110, 220, 440, 880 Hz work, but not 550 and 660 Hz.
– Tim
Jun 16, 2020 at 10:26
• @LeloucheLamperouge in "just" intonation, yes - the same note in different keys has a different "correct" frequency. Equal temperament is the same in all keys, but the compromise is that equal temperament is slightly out of tune for all keys. Jun 16, 2020 at 15:11
• @LeloucheLamperouge if you define A4 as 440 Hz, then B4 (or any other B) could have various different frequencies depending on the temperament you are using. Defining the pitch of one note does not define the pitches of other notes until you also specify a temperament. Jun 17, 2020 at 6:37
• @LeloucheLamperouge If you want to know how I worked that out, look at the ratios at en.wikipedia.org/wiki/Just_intonation#Diatonic_scale. A is 5/3 of the frequency of C, and D is 9/8 of that frequency. if we do (5/3) / (9/8), we get 1.48148.... - not the pure 1.5 that would represent an "in tune" fifth. So you see, Just intonation is "out of tune" in some ways too! Jun 17, 2020 at 7:48
• @LeloucheLamperouge you'd need to know your concert pitch: en.wikipedia.org/wiki/Concert_pitch. If you know your concert pitch and the temperament you want to use, you should be able to work out the frequencies of all notes. Jun 17, 2020 at 11:57

Is it that difficult...

Yes, it is.

There are three observations about tuning:

1. An octave sounds perfect when it's exactly a factor of 2 in frequency.

2. A perfect fifth sounds perfect when it's exactly a factor 3/2 in frequency.

3. If you stack twelve fifth on top of each other, and walk down seven octaves, you come back to the note where you started.

The problem is, mathematically, this is bullshit. Because it means that `3^12 == 2^19`, which is simply not true. It's close, but it cannot work out. Choose any two of the above points, you cannot have them all.

That's why any tuning must make a compromise between the three points mentioned above. Equal temperament adjusts the perfect fifth to be `2^(7/12) = 1.498` instead of `3/2 = 1.5`. You may not be able to hear the difference, but people with a trained ear do hear it. It's one of the most vexing experiences when you learn to tune a guitar, for instance, that you cannot tune the intervals perfectly, you must consciously add the error to achieve something like equal temperament. If you don't do that, you get a tuning that sounds good in some chords, but some other chords howl like a wolf. Equal temperament sacrifices point 2 from above.

Historically, people didn't use equal temperament. Instead, they would tune their instruments in a way that would fit the music they were intending to play. This sacrificed point 3 from above. (This always generates at least one fifth that cannot be used in the music because it sounds way off, effectively breaking the circle of fifth. You could also say that it's point 2 that's sacrificed because some fifth are nowhere near the `3/2` factor. However you look at it, you are sacrificing something.)

Of course, with modern technology, you can just measure the frequency, and tune each note accordingly. But you still need to decide which temperament you use to derive the "correct" frequencies, which of the three points above you want to sacrifice. You cannot get all three.

• "They sacrificed point 3": actually, they sacrificed point 2. Jun 17, 2020 at 19:43
• @phoog Depends on how you look at it: You get at least one fifth that you absolutely cannot use in your music, so you may as well consider the circle of fifths broken at that point. Jun 17, 2020 at 19:46
• "This always generates at least one fifth...": But point 3 never works acoustically. The only context in which that statement is true is the context of a 12-tone temperament. The difference between 12-tone temperaments is only in how many of the fifths are compromised and in the degree to which they are compromised. Jun 17, 2020 at 19:58
• because 3/2 SOUNDS perfect. But the power of the twelfth root of 2 doesn't quite (nearly, but not quite) And early music was generally restricted to a single scale, so the idea of having all keys in tune at the same time wasn't necessary -- so the system came into use because it sounded best for the people discovering it. And, personally, as a baroque flutists, I'd like my thirds to be more in tune than any piano will deliver in its "mathematically perfect" equal temperament. Jun 18, 2020 at 9:58
• @LeloucheLamperouge What you hear when tuning a perfect fifth is exactly this `3/2` factor: It's the point where all the odd overtones of the higher note fall exactly on the overtones of the lower note. Any deviation makes the interval sound impure. Just in the same way that all the overtones of an octave fall precisely on the odd overtones of the lower note. That's the physics of intervals, and it's the basis for us preferring to hear pure fifth and octaves. Point 1 and 2 of my list follow directly from physics. Jun 18, 2020 at 9:59

I'm not sure that anyone has spelled this out yet but historically many instruments were tuned the way you want. This however meant that you could only play in one key and be perfectly in tune. The further you strayed from that key, the more out of tune you would sound. Some pre-classical organs allowed tuning for a given key via a sliding sleeve around the end of each pipe. Similarly lutes had gut frets that could be adjusted by sliding them along the fingerboard according to the key you were playing in.

The main force for equal temperament (i.e. slight out of tune-ness equally in every key) was perhaps J.S. Bach when he wrote his 48 Preludes and Fugues.

Correction See informative comment below by @brendan

• This is a misconception which doesn't give Bach enough credit. It's called the "Well-Tempered Clavier", not the "Equal-Tempered Clavier", and if played on an instrument using well temperament, it highlights the differences in intonation of each key. en.wikipedia.org/wiki/Well_temperament Jun 17, 2020 at 13:23
• @brendan - Thanks for that comment - I've learned something new. I'll edit my answer to reference it. I wonder if there are any recordings of a keyboard using the authentic tunings that Bach knew. His 48 would sound very different if played this way. Are today's harpsichords tuned that way? Jun 17, 2020 at 13:43
• I've discovered a video demonstrating Bach's tuning. Search for Tuning a harpsichord in Bach's temperament - Bradley Lehman Jun 17, 2020 at 13:50
• See also A Bach prelude in three different temperaments. Jun 17, 2020 at 13:58
• "Some pre-classical organs allowed tuning for a given key via a sliding sleeve around the end of each pipe": virtually every organ allows retuning pipes, since organs have to be kept in tune and atmospheric conditions change. But you can't retune for each piece unless you have a fairly small organ. Jun 17, 2020 at 20:06

You make the claim (in the form of a question) that arbitrarily assigning frequencies to note names in the chromatic scale would "solve the problem of just intonation sounding different in every key except 1 and equal temperament being slightly out of tune in every key".

Based on this statement is seems that you do not know how these tuning systems arise.

Just tuning is based on the natural harmonics of some typical vibrating systems. Hence intervals are very "harmonious" in this tuning system.

The harmonic sequence is fn = n*f1.

From this we can get the "5th" and the "3rd" from n = 3 and n = 5 harmonics. Obviously this is not the correct ratio but if we bump them down into the first octave [f1, 2*f1] we get f(5th) = 3/2 * f1 and f(3rd) = 5/4 * f1.

If you apply the same reasoning starting from the 5th you get the ratios for the 7th and 9th (or 2nd bumped down). The "4th" is really a 5th below the tonic so we require the ratio of 4th (octave lower) to the 1st to also be 3/2, which becomes 2/3 upon inversion, and 4/3 when moved up and octave. The point being is that these ratios are based on the physics of vibration. This produces a set of notes that have THREE distinct consecutive ratios, the half step = 16/15, and two types of whole tone with ratio 9/8 and 10/9. For example the ratio Re/Do = 9/8 but that of Mi/Re = 10/9.

In terms of letter names perhaps we had chosen too few in the early days of music, or perhaps we had some other notation not currently in use that helped us distinguish these. If one wanted to build a D scale using, as the starting point the second note of the C scale then the second note, Re, could not possibly be the E of the C scale because it would not have the correct ratio. This is sometimes "corrected" by lowering the second note, and likewise for the others that do not follow a strict pattern. This "correction" helps standardize things and allows us to use a very simple alphabet for describing the notes available to us.

So, when you say that the Just scale is "different in every key" it is not clear what you mean! If the ratios are kept true then it should sound THE SAME in every key. I think you need to be clear about what quality you think is different.

The 12TET system defines the half step as the 12th root of 2, ~1.05946309436... . This is an irrational number and hence impossible to calculate exactly, though we try our best. In this tuning system ALL consecutive 1/2 steps have identical ratio. Hence ALL whole steps have identical ratio regardless of where you start, r ~ 1.0594631^2 ~ 1.122462. By the way 9/8 = 1.125, and 10/9 ~ 1.111. All one needs to do is get 1/2 steps to register the same value to within the precision of some spectral analyzer. Then everything is "in tune". In theory one could tune in 12TET with enough precision that a human could not detect the drift all the way through the spectrum of human hearing, to within the pitch discrimination ability of the human ear and brain. This is not possible, imo, out to infinity but it is possible for a finite bandwidth. So again, what exactly is "out of tune" for the equal tempered scale? Is "out of tune" your way of saying that the tones are not based on harmonics of the fundamental, dominant and sub-dominant?

I think that you need to enhance the question to be more clear. However, based on the two mathematical definitions of tones it is simply NOT possible to (1) make the steps equal ratio in all places while maintaining the harmoniousness that naturally occurs when harmonics are used. I am not sure if this helps answer your question but I've tried to interpret it faithfully.

• I assume that the base freq of all notes in equal temperament is obtained from A440. Correct me if im wrong. By base freq i mean the freq used to create a major/minor scale of that note in whichever temperament people want. ........... . But before the equal temperament came to existence, how did people assign different base frequencies for different notes to create a scale. Assuming there was one fixed freq for a note, like A440 ,in this situation as well. Jun 19, 2020 at 8:29

Several issues that haven't been mentioned.

First, the fundamental vibration frequency of a piano string isn't the pitch frequency people hear. Experimental evidence shows that the pitch (especially of the low notes of a piano) that people hear is more based on a combination of the higher harmonics of the note being played (some combination of absolute frequency, frequency differences, and frequency ratios of some set of higher harmonics). And, for piano strings, the higher harmonics are not exact integer multiples in frequency of the note's fundamental mode, due to finite diameter and stiffness of the piano strings. Therefore, if you tune certain notes mathematically "in tune" in they will sound out of tune to most humans. Especially in combination with the (slightly inharmonic) harmonics of other notes in any chord.

Next, a key on a piano often hits not one string, but multiple strings. The strings actually exchange energy between themselves during the duration of a note which slightly bends the pitch as the note evolves. So there is not a single pitch to tune to.

Third, as a note decays, the amplitude changes, and again due to finite diameter and tension, the fundamental frequency changes. So, when do you want a note to be in tune? It will then not match that tuning at other times or with different dynamics.

Etc. (Basically the physics of real materials, plus non-deterministic neuron firings in cochleas and human brains, does not produce a single simple math equation regarding "correct" frequencies.)