Get the note's MIDI code
Algorithm: A note, such as C#3 is decomposed into:
Each note name receives an index in the range 0..11 . The index is used as the lowest part of the note number and the octave is used as the most significant part of the number. An offset (12) is added so that A0=21. A constraint is added so that the note is between 21 (A0) and 108 (C8), resulting in valid MIDI codes.
| note |
The note in musical notation (with octave, e.g.: C#3) |
|
The associated MIDI code |