In the beginning, there was the Gregorian chant,
and it was all the rave!
Which was 7 notes with the eighth being the octave, or twice the frequency of the first note.
Then someone decided to write the music down, and invented music theory!
A B C D E F G
Oh and just for confusion, octaves start on C.
In Octave Notation 1, which maps a note to a pitch (frequency),
the notes of the white keys of a standard 88-key keyboard are:
A0 B0 C1 D1 E1 F1 G1 A1 B1 C2 D2 ... A7 B7 C8
With middle C (C4 on most instruments, can be C3, C4, or C5 on MIDI) being 261.626 Hz in the common A440 pitch standard (naturally there are other tuning 2 standards).
But alas, musicians weren't satisfied with 7 notes, so over time, settled on the natural base 12, i.e. 12 notes per octave. A 12 note scale is called a chromatic scale consisting of 12 semitones (or half steps or half tones) where the octave is divided into approximate equal parts, i.e. equal temperament (can vary depending on tuning used). 2 semitones are a tone or whole step.
Unfortunately the grey beards insisted on keeping the 7 note, or diatonic, scale so ended up inserting the extra 5 notes and calling them flats (half tone lower) or sharps (half tone higher), depending on usage, tradition, phase of the moon,...
To map 7 notes into twelve notes, the spacing is going to have some variance as you need 5 whole tones and 2 half tones. So how you arrange the whole and half tones is called a mode 3 or scale.
The natural scale, is the white keys of an octave starting at C. This gives a W-W-H-W-W-W-H tones for the C major scale (or Ionian mode):
C-D-E-F-G-A-B-C
W-W-H-W-W-W-H
This diatonic spacing of whole and half tones is movable across the chromatic scale. So a D major scale will have the same tonal spacing (W-W-H-W-W-W-H) as the C major scale, just starting on a D note.
D-E-F♯-G-A-B-C♯-D
W-W-H-W-W-W-H
An interval is a much abused term in music theory. In music theory an interval 4 is technically the difference in pitch between two sounds.
On a guitar an interval 5 is typically the distance from the root note of a scale. We can number these distances starting with 1 being the root note, 2 being the second note in scale, etc. So the C major scale, C-D-E-F-G-A-B-C, becomes 1-2-3-4-5-6-7-1 with the root note, 1, on C and has the same tonal spacing W-W-H-W-W-W-H.
C-D-E-F-G-A-B-C
1-2-3-4-5-6-7-1
W-W-H-W-W-W-H
The advantage of numerical intervals is chords, licks, rifs, etc have the same number regardless of key.
Footnotes
-
Octave Identification: https://musictheorytutoring.weebly.com/octave-identification.html#:~:text=The%20range%20of%20all%20possible,its%20name%20plus%20a%20number. ↩
-
Music theory loves to have multiple meanings per word and multiple words per meaning. ↩
-
Guitar intervals: https://bestbluesguitarlessonsonline.com/guitar-intervals ↩