On a piano, keys are organized in repeated sections of white and black keys; one has 5 keys in it and the other
has 7 keys. Together, these 12 keys span nearly an octave. C2 to B2 is not an octave apart, but C2 to C3 is. Each time, one
reaches a higher C note, the number associated with the pitch increases. G2 to G3 is also octave apart.

In music, an octave spans 6 whole tones (WT) or 12 half-tones (HT). On a piano, a half-tone (or semitone) is the smallest distance
between two notes. The distance between E & F, as well as B & C is a semitone. As shown below, two semi-tones
is the same distance as 1 whole tone. Count the number of keys that are above or below the note you start from. The concepts
of a half-step and whole-step come from ancient Greece and were adopted in Western music, as discussed at
Wikipedia. An octave can be divided into 2
tetrachords.
A piano has around 7 octaves. The first note is A0 at 27.5 Hz and the last one is C8 at a frequency of 4,186.01 Hz. (As shown at
Wikipedia, if a melody jumps an octave, the
frequency of the 2nd note is double that of the first; Middle C is 261.626 Hz and Low C is 130.813 Hz. The green key is Middle C
(C4) and the red key is A or 440.0 Hz (A4), the tuning frequency used in concert bands and orchestras. This is known as
Concert Pitch.