When you’re writing in a single key for an extended period of time, it gets tedious to write out the accidentals over and over again.
Here is a simple melody in D major, without a key signature.
To avoid this, composers used key signatures at the beginning of each staff to remind performers of which pitch classes should have flats or sharps.
Here is the same melody, with the key signature at the beginning of the staff to remind the performer that F and C should be sharp.
The circle of fifths
The circle of fifths is an illustration that has been used in music theory pedagogy for hundreds of years. It conveniently summarizes the key signature needed for any key with up to seven flats or sharps.
But which notes are flat or sharp in a key? To properly use the circle of fifths to figure out a key signature, you’ll need to also remember this mnemonic device, which tells you the order of flats and sharps:
Father Charles Goes Down And Ends Battle.
For sharp keys (clockwise on the circle of fifths), read the mnemonic device forward. For example, the circle of fifths tells us that there are 3 sharps in the key of A major. Which three notes are sharp? The first three notes in the mnemonic device: F(ather), C(harles), and G(oes).
For flat keys (counter-clockwise on the circle of fifths), read the mnemonic device backwards. For example, the circle of fifths tells us that the key of A-flat major has four flats. Which flats? Reading backwards: B(attle), E(nds), A(nd), D(own).
Minor key signatures
Of course, minor keys can use key signatures, too. In fact, for each major key signature, there is a corresponding minor key that shares its signature. Major and minor keys that share the same key signature are called relative keys. For example, both C major and A minor have zero sharps or flats. A minor is considered the relative minor of C major; likewise, C major is considered the relative major of A minor. Compare the minor key circle of fifths below with the major key circle of fifths above, and you’ll see the remaining relative key pairs.
Writing key signatures
Below is a reference that shows how all of the key signatures should be written on treble, alto, tenor, and bass clefs.