A key is a reference to music written in one of twenty-four diatonic scales. There are twelve major scales and twelve minor scales. The key signature indicates which of these major or minor scales the music is written. The final cadence determines whether the key is major or minor. Key signatures are marked over again at the beginning of each new staff system.

A key signature may have up to seven sharp symbols, seven flat symbols or nothing at all. The sharp and flat symbols follow a standard order.

The order of sharps are: F C G D A E B.
The order of flats are: B E A D G C F.

Depending on the clef symbol, the sharps and flats are placed on specific lines and spaces of the musical staff as such:

The key signature affects the pitch for the entire piece unless it is canceled and replaced with another key signature. If a key signature is changed, the new signature appear on the right side of the bar line. It is common to use naturals in order to cancel all the sharps or flats from the previous key signature before replacing it with the new key signature.

A sharp sign will have the pitch of a note raised a half step for the entire piece. It may be lowered at anytime with the use of a natural sign. Likewise, the flat sign will have the pitch of a note lowered a half step for the entire piece. It may be raise at anytime with the use of a natural sign. The natural sign lasts only for the duration of the measure.

HISTORY

In the ninth century, music was written in one of two keys; the key of C and the key of F. The key was determined by a clef symbol; the C clef and the F clef. A flat sign is normally placed at the beginning of each staff to indicate that the pitch B is lowered a half step for the entire piece. Accidentals, with the rare exceptions, were not used until the fourteenth century. After the mid fifteenth century, tuning systems have changed to accommodate composers willing to explore other keys. Various diatonic scales have been more accessible and marked with a key signature. After equal temperament had been developed in the sixteenth century, all keys were accessible to composers with greater ease.