Tonality and Scales
Almost all melodies are in a specific tonality (also called key). Tonality in music is like a gravitational pull of the pitches toward one main note, which is called the tonic. If a piece of music is in the key of G, the tonic note will be G. It is also very likely that the piece will end on the note G. The pitches of a key can be represented with scales. The first note of the scale is the tonic note.
A scale is a series of ascending and descending pitches within the space of an octave. A diatonic scale is an eight note scale (including the octave) which uses successive letter names. It does not skip any letter names or repeat any letter names (except for the octave). Each pitch of the diatonic scale is called a scale degree. Here is an example of a C diatonic scale with the scale degrees marked under each pitch. As we ascend the scale, each scale degree number gets higher. As we descend the scale, the numbers get lower, until we reach the tonic, which is 1. The first scale degree is also called the tonic note of that key.
The following group of pitches is a scale, but not a diatonic scale, because it does not consist of consecutive letter names. It skips the notes F and B.