In music, the adjustment of one sound source, such as a voice or string, to produce a desired pitch in relation to a given pitch, and the modification of that tuning to lessen dissonance.
Tuning assures a good sound for a given pair of tones; temperament compromises the tuning to assure a good sound for any and all pairs of tones. Two vibrating strings sound best together if the ratio between their lengths can be expressed by two small whole numbers. If two strings vibrate in a ratio of 2:1, the vibrations will always coincide and so reinforce each other. But if they vibrate in a ratio of 197:100 (very close to 2:1), they will cancel each other out three times per second, creating audible "beats." These beats are what make something sound "out of tune." Since a tone produced by one ratio will not necessarily agree with the same tone created by repeatedly applying another ratio, either some interval s must be mistuned to allow for the perfect tuning of others or all intervals must be slightly mistuned. Before 1700, several systems were used based on the former compromise, including "just intonation"; since then, the compromise known as "equal temperament," in which the ratios represented by each pair of adjacent notes are identical, has prevailed.