circle of fifths
In chemistry there's something called the Periodic Table, which is way of laying out all the different elements in rows and columns so that patterns start to emerge. It's a doorway to all kinds of understanding in this science. There's something similar in music and it's called the circle of fifths.
The reason it's called a circle is obvious from the picture. Why fifths? If you think of the scale of C major – C, D, E, F, G, A, B, C – the fifth note of the scale is G, so G is a fifth above C. The fifth is a really important note in the scale – in fact, apart from the root note, the most important.
In the circle of fifths, each clockwise movement represent a jump of a fifth from the previous note. So at the top we have C, which is the root note, or tonic, in the scale of C major. Then we move one step clockwise, taking us up a fifth to G, which is the tonic of G major. Now here's a neat trick. Every clockwise step sharpens one of the notes in the scale. C major has no sharps. G major has one – F♯. The note that gets sharpened is the one immediately before the tonic. You'll see in the picture that this sharp appears in the key signature.
Now we move another step clockwise. A fifth up from the previous tonic brings us to D, which is the tonic of D major. This scale has two sharps – F♯ (retained from the previous scale) and C♯ (the sharpened note of the one immediately before the tonic). And so it goes on. Next up is the scale of A major with three sharps (F♯, C♯, and G♯).
By the time we move round the circle to B the next fifth up takes us to F♯ (because the F in the scale of B major is sharpened). The scale of F sharp major (which appears at the bottom of the circle) has six sharps. If we kept on going clockwise, using the same rule, we'd come to the scale of C sharp major, with seven sharps. But, in fact, we don't do that because we'd end up with too many sharps and double sharps (sharpened sharps) Instead we go back to the top of the circle (C) and start going anticlockwise, counting backward in fifths (or forward in fourths, which amounts to the same thing). This brings us first to F, the tonic of F major. The rule when going in this direction is to add a flat for each step. The one flat in the scale of F major is B♭ (which is the flattened note one before the previous tonic of C). A fifth back in the scale of F brings us to B♭. We add a second flat (E♭). And so we continue all the way to D♭ in the next to bottom position (with five flats). Carrying on brings us to G♭ with six flats. But G♭ is exactly the same as F♯ (they're said to be enharmonic). By convention, this scale is normally called G flat.
So that's all the 12 possible major scales figured out using the circle of fifths. But the usefulness of this musical tool goes far beyond that. The circle of fifths can be used used in other ways, such as harmonizing melodies, building chords, and in composition when changing keys.