In musical tuning, a temperament is a tuning system that slightly compromises the pure intervals of just intonation to meet other requirements. Most modern Western musical instruments are tuned in the equal temperament system. Tempering is the process of altering the size of an interval by making it narrower or wider than pure. "Any plan that describes the adjustments to the sizes of some or all of the twelve fifth intervals in the circle of fifths so that they accommodate pure octaves and produce certain sizes of major thirds is called a temperament." Temperament is especially important for keyboard instruments, which typically allow a player to play only the pitches assigned to the various keys, and lack any way to alter pitch of a note in performance. Historically, the use of just intonation, Pythagorean tuning and meantone temperament meant that such instruments could sound "in tune" in one key, or some keys, but would then have more dissonance in other keys.
In the words of William Hubbard's Musical Dictionary (1908), an anomalous chord is a "chord containing an interval" that "has been made very sharp or flat in tempering the scale for instruments of fixed pitches".

The development of well temperament allowed fixed-pitch instruments to play reasonably well in all of the keys. The famous Well-Tempered Clavier by Johann Sebastian Bach takes full advantage of this breakthrough, with pieces written in all 24 major and minor keys. However, while unpleasant intervals (such as the wolf interval) were avoided, the sizes of intervals were still not consistent between keys, and so each key still had its own character. This variation led in the 18th century to an increase in the use of equal temperament, in which the frequency ratio between each pair of adjacent notes on the keyboard was made equal. In other words, the ratio between two notes that were one octave apart was kept pure, and the twelve notes in between the octave were equally spaced from one another. This allowed music to be transposed between keys without changing the relationship between notes.

Definition
"Temperament refers to the various tuning systems for the subdivision of the octave," the four principal tuning systems being Pythagorean tuning, just intonation, mean-tone temperament, and equal temperament. In just intonation, every interval between two pitches corresponds to a whole number ratio between their frequencies, allowing intervals varying from the highest consonance to highly dissonant. For instance, 660 Hz / 440 Hz (a ratio of 3:2) constitutes a fifth, and 880 Hz / 440 Hz (2:1) an octave. Such intervals (termed "just") have a stability, or purity to their sound, when played simultaneously (assuming they are played using timbres with harmonic partials) because pure intervals do not waver or beat regularly.; the proportions of their frequencies can be expressed as whole numbers. If one of those pitches is adjusted slightly to deviate from the just interval, a trained ear can detect this change by the presence of beats, which are periodical oscillations in the note's intensity. If, for example, two sound signals with frequencies that vary just by 0.5 Hz are played simultaneously, both signals are out of phase by a very small margin, creating the periodical oscillations in the intensity of the final sound (caused by the superposition of both signals) with a repetition period of 2 seconds (following the equation Tr=1/Δf, Tr being the period of repetition and Δf being the difference in frequencies between both signals), because the amplitude of the signals is only in phase, and therefore has a maximum superposition value, once every period of repetition.






