In traditional Western music, the key is the tonal center of a composition. The choice of key determines which of the other notes in the scale will be considered "natural".
The Western scale divides the octave into twelve notes (plus the octave, at double the frequency of the lowest note). Any given key uses eight of these, or seven plus the octave, from which the composer can construct melodies and harmonies. Since many times the judicious use of the other five notes, also known as chromaticism, will make the music more compelling, we have notation devices to indicate when they are used instead of their natural counterparts. A piece of music will also often change keys at various times, known as modulation. This is usually done by moving to a closely related key, that is, one whose key signature only differs by one sharp or flat in either direction. An easy way to find which keys are related in this way is to follow the circle of fifths.
The notes used in the key of C major (corresponding to the white notes on the piano) are C, D, E, F, G, A, B and C. When sung or played, these are often referred to by their respective names do, re, mi, fa, so, la ti, and do.
In the late nineteenth century, composers such as Richard Wagner, Hugo Wolf, and Richard Strauss began to use extreme chromaticism and modulations to distantly related keys for a heightened expressive affect. In the twentieth century, this trend developed to the point where the listener's impression of a tonal center became weak or even irrelevant, leading to atonal music. Arnold Schönberg eventually attempted to create a new set of rules to replace tonality, resulting in twelve tone music.
Many styles, or genres, of music are quite recognizable by the type of key structure they employ.
In the eighteenth and nineteenth centuries, composers and contemporary writers on music believed that each major or minor key possessed a special character, or "affect," which influenced the content of the work being composed. For example, according to eighteenth-century author Johannes Mattheson, the key of D Major was associated with merriment and warlike music, while F Minor was the key of "deep despair and the heart's fear of death."
- Rita Steblin, A History of Key Characteristics in the 18th and Early 19th Centuries, 1983