A musical note represents a specific sound, identified by a note name such as C or A and associated with a frequency that determines its pitch. Octaves organize pitch levels: moving up one octave doubles the frequency, while each Western-music octave contains 12 semitones. For machine learning, a pitch number compactly records both the octave and semitone; for example, C4 is 60 and F3 is 53. section 13.1.1
Digital music uses notes in several related representations:
- A step in a sequencer contains a note; in the JSB Chorales representation, each note is one of 84 possible pitches and becomes an 84-value one-hot vector. section 13.1.2
- A piano-roll-style music object can arrange notes across four tracks, two bars, 16 steps per bar, and 84 pitch values, producing shape (4, 2, 16, 84). section 13.1 section 13.1.2
- A performance representation can convert notes into note-on, note-off, time-shift, and velocity events, then map those events to integer indexes for Transformer training. section 14.2.2 section 14.2
From MIDI note to event
A MIDI performance may begin with note-on events such as pitch 74 and pitch 38, followed by a note-off event for pitch 74. Processing adds time-shift and velocity events, turning the performance into a sequence of tokens rather than a raw continuous-time note stream. section 14.2.2
Figure 13.1 The relationship between musical notes, octaves, and pitches (also known as note numbers). The first column displays the 11 octaves (ranging from –1 to 9), representing different levels of musical sound. Each octave is subdivided into 12 semitones, which are listed in the top row: C, C#, D, D#, ..., B. Within each octave, each note is assigned a specific pitch number, ranging from 0 to 127, as indicated in the figure.
Use the pitch map to relate octave levels, semitones, note names, and pitch numbers from 0 through 127. section 13.1.1


