Note pitches are represented as in the MIDI specification, using integers from 0 (lowest pitch) to 127 (highest pitch). That’s a total of 128 pitches (i.e., 10 octaves).

The music library defines the following pitch constants for convenience. The highest possible pitch is G9; it is equal to 127. The lowest possible note is C_1 (C negative one); it is equal to 0.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
G9 = 127, GF9 = 126, FS9 = 126, F9 = 125, FF9 = 124, ES9 = 125, E9 = 124, EF9 = 123, DS9 = 123, D9 = 122, DF9 = 121, CS9 = 121, C9 = 120, CF9 = 119, BS8 = 120, B8 = 119, BF8 = 118, AS8 = 118, A8 = 117, AF8 = 116, GS8 = 116, G8 = 115, GF8 = 114, FS8 = 114, F8 = 113, FF8 = 112, ES8 = 113, E8 = 112, EF8 = 111, DS8 = 111, D8 = 110, DF8 = 109, CS8 = 109, C8 = 108, CF8 = 107, BS7 = 108, B7 = 107, BF7 = 106, AS7 = 106, A7 = 105, AF7 = 104, GS7 = 104, G7 = 103, GF7 = 102, FS7 = 102, F7 = 101, FF7 = 100, ES7 = 101, E7 = 100, EF7 = 99, DS7 = 99, D7 = 98, DF7 = 97, CS7 = 97, C7 = 96, CF7 = 95, BS6 = 96, B6 = 95, BF6 = 94, AS6 = 94, A6 = 93, AF6 = 92, GS6 = 92, G6 = 91, GF6 = 90, FS6 = 90, F6 = 89, FF6 = 88, ES6 = 89, E6 = 88, EF6 = 87, DS6 = 87, D6 = 86, DF6 = 85, CS6 = 85, C6 = 84, CF6 = 83, BS5 = 84, B5 = 83, BF5 = 82, AS5 = 82, A5 = 81, AF5 = 80, GS5 = 80, G5 = 79, GF5 = 78, FS5 = 78, F5 = 77, FF5 = 76, ES5 = 77, E5 = 76, EF5 = 75, DS5 = 75, D5 = 74, DF5 = 73, CS5 = 73, C5 = 72, CF5 = 71, BS4 = 72, B4 = 71, BF4 = 70, AS4 = 70, A4 = 69, AF4 = 68, GS4 = 68, G4 = 67, GF4 = 66, FS4 = 66, F4 = 65, FF4 = 64, ES4 = 65, E4 = 64, EF4 = 63, DS4 = 63, D4 = 62, DF4 = 61, CS4 = 61, C4 = 60, CF4 = 59, BS3 = 60, B3 = 59, BF3 = 58, AS3 = 58, A3 = 57, AF3 = 56, GS3 = 56, G3 = 55, GF3 = 54, FS3 = 54, F3 = 53, FF3 = 52, ES3 = 53, E3 = 52, EF3 = 51, DS3 = 51, D3 = 50, DF3 = 49, CS3 = 49, C3 = 48, CF3 = 47, BS2 = 48, B2 = 47, BF2 = 46, AS2 = 46, A2 = 45, AF2 = 44, GS2 = 44, G2 = 43, GF2 = 42, FS2 = 42, F2 = 41, FF2 = 40, ES2 = 41, E2 = 40, EF2 = 39, DS2 = 39, D2 = 38, DF2 = 37, CS2 = 37, C2 = 36, CF2 = 35, BS1 = 36, B1 = 35, BF1 = 34, AS1 = 34, A1 = 33, AF1 = 32, GS1 = 32, G1 = 31, GF1 = 30, FS1 = 30, F1 = 29, FF1 = 28, ES1 = 29, E1 = 28, EF1 = 27, DS1 = 27, D1 = 26, DF1 = 25, CS1 = 25, C1 = 24, CF1 = 23, BS0 = 24, B0 = 23, BF0 = 22, AS0 = 22, A0 = 21, AF0 = 20, GS0 = 20, G0 = 19, GF0 = 18, FS0 = 18, F0 = 17, FF0 = 16, ES0 = 17, E0 = 16, EF0 = 15, DS0 = 15, D0 = 14, DF0 = 13, CS0 = 13, C0 = 12, CF0 = 11, BS_1 = 12, B_1 = 11, BF_1 = 10, AS_1 = 10, A_1 = 9, AF_1 = 8, GS_1 = 8, G_1 = 7, GF_1 = 6, FS_1 = 6, F_1 = 5, FF_1 = 4, ES_1 = 5, E_1 = 4, EF_1 = 3, DS_1 = 3, D_1 = 2, DF_1 = 1, CS_1 = 1, C_1 = 0 |

Additionally, there is a special pitch corresponding to rests:

1 |
REST |

Rests are notes that last as long as you specify (see duration constants), but produce no sound.