To calculate the octave of a note, you can count the number of white keys from the A0 note to the note you are interested in. For example, the note C4 is located four white keys away from A0, so it is in the fourth octave.
You can also use the following formula to calculate the octave of a note:
`Octave = (Note number - 21) / 12`
Where:
* Octave is the octave number
* Note number is the MIDI note number
For example, the MIDI note number for C4 is 60, so the octave number is:
`(60 - 21) / 12 = 3.25`
Since octaves are whole numbers, we round this value to the nearest integer, which is 4. Therefore, C4 is in the fourth octave.