Requisite Knowledge Level for Understanding (* being beginner, ***** being expert): ** - ***
If you have a friend who plays the guitar, you have probably heard him/her mention before he/she begins to play that he/she needs a second to "tune". You have probably heard of someone "tuning" the piano before. As well as maybe a singer talking about singing "in tune", their "intonation", or, more likely, complaining about someone being "out of tune". In these instance, the one speaking is clearly not talking about a "tune" in terms of "that jaunty tune we listened to last week", but rather something more specific having to do with the quality of the music. Let us talk then about what all that actually means.
Intonation is the basic concept, from which we get ideas like being In Tune, Out Of Tune, Tuning, and so forth. Intonation, in its most general form, is the relationship of two sounding notes to each other. Most people who are not musicians think of notes like they are on the piano. There is a C and a D. Also one between them that's smaller and black and it is called a C# or a Db. But that is the smallest interval; there is nothing between a C and a C#. This is wrong. In the general tuning system of classical music, each note is separated by 100 Cents (not money, but a very tiny musical interval), and these minute differences are very much utilized.
Imagine, if you will, that you are cooking and you need some of a stick of butter. The recipe might say "3 tablespoons". So you cut off three tablespoons and use it, and everything is wonderful. But no one forced you to cut there, where the printed lines indicate three tablespoons. You only did that because the recipe requested 3 tablespoons. You might really like butter and so cut it a little past that line, or might be watching your weight and so cut a little less, but you do not want to mess up the recipe completely because you are not a master chef and are worried that you might mess it all up, so you do not go as far as cutting a full four or down to two tablespoons.
This is the basis for intonation. In music, we have (mostly) defined each of the notes to be an exact frequency. The A located above the middle C, often referred to specifically as A440, is defined to occur exactly at a frequency of 440 Hz... in the USA and the UK. Elsewhere, especially in mainland Europe, 442 Hz and 443 Hz are used. And that is only for modern intonation. Classical music (the time/music period) is generally agreed to be tuned to A at 330 Hz, while Baroque music is either generally agreed to be tuned to A at 415 Hz or sometimes A 466 Hz. Clearly then, there is no "universal A"; the A that, when played, is always the in tune, perfect, correct, the be all end all of As to ever be sounded.
So what is important then becomes the concept of Tuning and being In Tune. Orchestras tune to the oboe player at the beginning of the concert, the oboe player having already tuned him/herself to A440. That means that the oboe player has taken his/her instrument played it with some sort of tuning device on hand that has an A 440 preset to match the pitch of the A on his/her instrument with that exactly. The rest of the orchestra then does the same with their instruments, insuring that every time they strike an A where they consider the A to lie on their instrument, it rings at the exact pitch of the oboe player's A, the A440. This is Tuning. Making the minor adjustments on the physical instrument itself, whether that means moving a tuning slide, tightening or loosening a string or readjusting the mouthpiece.
Then we have the concept of being In Tune or Out Of Tune. This can pertain to two different things: multiple musicians playing at the same time and making sure that the distances between each notes in the melody that each musician plays are the correct distance apart. When a musician plays an instrument, with the exception of a piano and other select fixed pitch instruments, the pitch of the "A", for example, on their instrument can vary very easily. Thus when multiple musicians are playing the same note, they must listen to the exact pitch each one is playing to match it as closely as possible. This is important because it makes it all sound prettier and results in a finer performance in the same way that a luxury car works better than a generic sedan because the parts are all manufactured with a higher degree of precision and quality.
In order to properly tune, it must then be understood the proper distance between each note. Harmonically speaking, there are naturally resonating harmonics that sound "good" together. Things like Thirds, Fourths, and Fifths sound pleasant to the ear. These are tuned to the main note in the scale, e.g. the C when in C Major. So the G above the C should be a certain distance away. This method of tuning each note in the chromatic scale in its natural and perfect relation to the base note is called Just Intonation. The problem we arrive at with just intonation, is that when all is said and done, and tuned perfectly to the C, we have unequal distances between each successive note.
If you recall from music theory, the distance between a C and a G is the exact same distance as between a D and an A. However, because of their relationship to the C, while the C and G interval sounds perfect when played together, the D and A interval does not. It is flattened by about 1/5th of a half step, and as such would not sound as well together. This is not as much of an issue for instruments like a violin or voice which can make adjustments for intonation on the fly, but for fixed instruments, like a piano, tuning is an ordeal making adjustments for intonation in the middle of a piece impossible. If the piece is short, and stays in C Major the entire time, it should still sound fine. But pieces can be quite long, and very regularly employ key changes which take them to any manner of different keys, which, when the piano is tuned to C Major, would make the piece sound worse and worse the further you get from C Major, to the point where a nice melody in F# major would sound horrible and you would want to cover your ears.
In order to solve this issue, musicians came up with the idea of Equal Temperament. The one used in Western music (most all Classical and Pop music would fall into this category) is the 12 tone system, or 12ET for short. In this system, each semitone is exactly the same distance from each other. So the distance between the C and the C# is exactly the same as the distance between the Gb and the G, and holds true over larger intervals as well, such as D to A is equivalent to Bb to F. The downside to this is that intervals are not as pure as with just intonation; a fifth tuned justly will sound superior to a fifth tuned in equal temperament. (There was a system using 19 equal tones that was prevalent during the Renaissance period, as well as it has made a very slight resurgence in the last thirty years, which does some things better than the 12 tone system and some things worse. It is fun to investigate if you are interested, but it is not generally practical at this point in time.)
But equal temperament is VERY CLOSE, which is why it is used. Just sounds better than equal, but equal is FAR more freeing than just. In equal temperament, everything is, as it sounds, equal. You can start in C Major, and change keys dozens of times, getting all the way to F# major, and that key will still sound EXACTLY as good as C Major did, whereas that same piece played on a justly tuned piano would sound horrible, as mentioned above. This then leads to a second notion of being In Tune. Tuning not only to the other musicians with whom one is playing, but also making certain that when one plays a G following a C, that that G is of a proper distance above that C and thus each successive note must relate to the ones preceding it.
Given all of that, then, a musician has multiple things to consider when performing music. Because musicians want the music to sound as good as possible, when playing a non fixed pitch instrument, they will endeavour to make the necessary adjustments, playing the Major 3rd a little flat in Major triad because that is closer to the Just Intonation. These relationships change constantly though. Whether a particular note, say an A, is played as part of an A Minor triad in C Major, later in the piece as part of a D Major triad while in the key of A Major, or later still as a suspended 4th tone from the previous triad over an inverted E Major triad before a V - I cadence in the key of E Major, the musician will make the necessary adjustments to make it sound as beautiful as possible, given the circumstances. As a piano is a fixed pitch instrument, if playing the same melodic line as a piano, the musician would want to tune to the piano, while if the same note is not being played, the musician would want to tune as justly as possible, while not creating awkward intervals for him/herself in their own melodic line. Add to that the even further thought that musicians can also choose to play a line just slightly a little out of tune in order to further add to the emotion behind the piece, and one can see that "intonation" and the concept of being "in tune" is a very large one.
This has gone on a little longer than I had intended, so I will end by saying that mean tone temperament, while not as perfect as just intonation, was a great achievement, as it finally allowed performers to play pieces in vastly different keys directly after each other and they would all sound good, something that was impossible with just intonation. For a good example of this, I would suggest listening to Johann Sebastian Bach's "Well-Tempered Klavier" (also spelled Clavier), which, as the name suggests, is written in celebration of this tuning system. There are any number of performances which are fantastic, though my favourite was recorded by Angela Hewitt.