The key describes the note around which a piece of music is built. Remember that when a piece of music consists of notes from a particular scale, it is said to be written in the key which has the same notes as that scale. The key signature is written at the start of each line of music, just after the clef.
The number of sharps or flats in any key signature depends on the number of sharps or flats in the corresponding major scale. The following diagrams show the major scales and key signatures for the keys of F and G. Without sharps and flats, these scales would not contain the correct pattern of tones and semitones which gives the major scale its distinctive sound.
The G major scale contains one sharp, F#, therefore the key signature for the key of G major contains one sharp, F#.
The F major scale contains one flat, Bb, therefore the key signature for the key of F major contains one flat, Bb.
Some scales contain sharps while others contain flats because there has to be a separate letter name for each note in the scale. For example, the G major scale contains F# instead of Gb even though these two notes are identical in sound. If Gb was used, the scale would contain two notes with the letter name G and no note with the letter name F. In the key of F major, the note Bb is chosen instead of A# for the same reason. If A# was used, the scale would contain two notes with the letter name A and no note with the letter name B.
The following charts contain the key signatures of all the major scales used in music, along with the number of sharps or flats contained in each key. Because there are 12 notes used in music, this means there are 12 possible starting notes for major scales (including sharps and flats). Note that some of the keys will have sharps or flats in their name, e.g., F# major, Bb major, Eb major, etc. Keys which contain sharps are called sharp keys and keys which contain flats are called flat keys.
The key signatures for all the major scales that contain sharps are:
The sharp key signatures are summarized in the following table.
The key signatures for all the major scales that contain flats are:
The flat key signatures are summarized in the following table.
The following example demonstrates one octave of the major scale ascending and descending in every key. Learning scales may not seem as interesting as playing tunes, but a little effort at this stage will pay off very well later on. Memorize the fingering for each scale and then try playing it with your eyes closed while imagining how the notation for the scale would look. Once you have learned all the scales, you will be able to play melodies confidently in any key and be able to improvise in any key much more easily.
The scales shown in the previous example are only one octave. However, it is important to practice scales over the entire length of the keyboard and also to break them up into sequences. It is recommended that you obtain a book of scales, arpeggios and exercises such as Hanon (any teacher will know this book) and practice them in all keys if you wish to become a great piano player, as they will give you the technique and knowledge of keys that you need to be fluent when improvising. It also helps to memorize the names of the notes in each scale. The following chart lists the notes in all major scales.