Keys are the home of a piece of music. It roots our ears somewhere which we can move away from and move back to, giving us harmonies and melodies which sounds 'consonant' (i.e. sounds that work well together) or 'dissonant' (i.e. sounds which clash).
Keys help us shape the harmonies and melodies of musical sound using specific scales as well as using modulation and chromatics to move away from them and create more interesting music.
Each key has a different key signature. This is an area of written music between the clef and the time signature which has a different number of ♯s and ♭s depending at different pitches which represent what key the music is written in. Each key signature can represent a single major key and a single minor key. For example if there are no ♯s or ♭s the key is C major or A minor as neither of those scales have any ♯s or ♭s.
Scales are specific sequences of notes which can be played up or down. They are the basis of all keys and harmony.
Major scales start on any note and follow this sequence of intervals:
TONE → TONE → SEMITONE → TONE → TONE → TONE → SEMITONE
The first, third and 5th note of any scale are called harmony notes as they provide enough resonance with each other to create a consonant (or generally pleasant) sound.
We use scales to create the foundations of harmonies.
EXAMPLE
From any major or minor scale we can create a number of harmonies which belong to the key of that scale. By using the 1st, 3rd and 5th notes in a scale played together in any order we create a major, minor, diminished or augmented harmony.
Diatonic harmonies are harmonies whose 1st, 3rd and 5th scale notes are in the scale of a key. So if the key has a scale with only natural notes (no sharps or flats) then any scale whose 1st, 3rd and 5th notes are all natural will 'fit' into the key. Each key has 7 diatonic harmonies which form a strong sense of that key when incorporated into any music using those harmonies.
Chromatic harmonies are harmonies which have at least one of their 1st, 3rd or 5th notes not fit into the scale of a particular key. These are used to take the ear away from the key in some way and therefore make music more interesting to listen to.
EXAMPLE
If a piece of music is written in a major key it generally sounds bright and happy. This is something which comes from the selection of harmonies created from a major scale. Major scales can start on any note and are made up of the following intervals:
TONE → TONE → SEMITONE → TONE → TONE → TONE → SEMITONE
Using this scale there are 7 diatonic harmonies which can be used and any number of chromatic harmonies to create more interesting music. The diatonic hamronies in a major key are:
MAJOR → MINOR → MINOR → MAJOR → MAJOR → MINOR → DIMINISHED
Diatonic simply means that the harmonies fit entirely in the scale of the key a piece of music is written in. Chromatic means any note which sits outside that scale.
EXAMPLE
Minor keys are based on 3 different types of minor scale: the natural minor, harmonic minor and melodic minor. Each of these have a slightly different sequence of notes which start from the same note. Because of this there are more harmonies which are considered diatonic than in a major key.
If a piece of music is written in a minor key it generally sounds darker and pensive. This is something which comes from the selection of harmonies created from the three minor scales.
Natural minor scales can start on any note and are made up of the following intervals:
TONE → SEMITONE → TONE → TONE → SEMITONE → TONE → TONE
Harmonic minor scales can start on any note and are made up of the following intervals:
TONE → SEMITONE → TONE → TONE → SEMITONE → TONE (+ SEMITONE) → SEMITONE
Melodic minor scales can start on any note and are made up of the following intervals (on the way up):
TONE → SEMITONE → TONE → TONE → TONE → TONE → SEMITONE
Melodic minors revert to the natural minor sequence when they come back down.
Using these scale there are 13 diatonic harmonies which can be used and any number of chromatic harmonies to create more interesting music. The diatonic harmonies in a minor key are:
(NATURAL MINOR)
MINOR → DIMINISHED → MAJOR → MINOR → MINOR → MAJOR → MAJOR
(HARMONIC MINOR)
MINOR → DIMINISHED → AUGMENTED → MINOR → MAJOR → MAJOR → DIMINISHED
(MELODIC MINOR)
MINOR → MINOR → AUGMENTED → MAJOR → MAJOR → DIMINISHED → DIMINISHED
EXAMPLE
NOTE: Minor key signatures are based on the natural minor scale even though the harmonic and melodic minors can be used in minor music. Any additional ♯s or ♭s need to be added in the music itself whenever it is needed.
Music isn't always written absolutely using the scale and harmonies of a particular key - rather a key is a 'best fit' for music which gives our ear a framework. Occasionally music can shift its key (either briefly or more permanently) using a process called modulation.
If there are additional ♯s and ♭s in a piece of music there's a chance it has modulated into a different key. This is because the ♯s and ♭s in a particular key are listed in its key signature, so wouldn't need to be written out again in the piece itself (see the overview above).
Modulation is designed to be a smooth transition between the two keys in question using common harmonies between the keys.
EXAMPLE
Notes which fit into a particular key (and therefor the scale) are called diatonic, but they are by no means the most interesting sounds a composer can make. Using some notes which aren't in the scale of a kay can add a little colour to a piece, and these are called chromatic notes.
Chromatics can be useful for melodies where the use of chromatic notes can add a little more interest to a tune or in harmonies with chromatic notes being used to replace one of the harmony notes. These are called chromatic harmonies or chromatic chords.
Certain styles of music don't venture out of their key too much (such as with earlier Baroque Era music) whereas some are almost entirely comprised of chromatic notes (such as some Romantic Era music or some Jazz).
EXAMPLE