It's a simple math game of sharps (flats are counted as negative sharps). This method is from
www.musictheory.netFind the base letter (counting up by even numbers)C: 0 (even numbers, counting up by 2 from 0)
D: 2
E: 4
F: -1 (odd numbers counting up by 2... but starting at -1 =-)
G: 1
A: 3
B: 5
Apply Sharp/Flat (the difference of 7)If the key is natural, +0 (no change)
If the key is sharp, +7
If the key is flat, -7
Apply Minor (the difference of 3)If the key is major, +0 (no change)
If the key is minor, -3
So if you can remember the counting by two step, and the magic numbers 7 and 3 (which are traditionally lucky numbers in many Western cultures), you can always figure out the key sig.
Example: F# minor.
1) F is -1 sharps by the table above
2) F# is sharp, so +7 for a total of 6
3) F# minor is minor, so -3, for a total of 3.
To get the name from the signature, just work the process in a backwards, keeping the number of sharps between -7 and 7. Note, though, one signature is used for many keys.
Reduce Minor to MajorIf the key is major, +0 (no change)
If the key is minor, +3
Reduce Sharp/FlatIf the key is natural, +0 (no change)
If the key is sharp, -7 (negative... the opposite of above, since we're working backwards)
If the key is flat, +7 (again, the opposite of above)
Look up Base LetterUse the table above to find the letter.
Example: 4 flats (-4)
If you add +7 to make it a flat key, you get, 3. Since 3 is A, the key is A flat major.
However, you can start with -4, and add +3 for a minor scale, the total is -1, so the key also acts as F minor.