Performance-based representation encodes music as a sequence of performance events rather than as a 4D object. It preserves note timing and playing intensity through control messages and velocity values, making musical behavior suitable for sequence modeling. section 14.1
Reduce each performance to four event types:
- Note-on starts a note and specifies its pitch. section 14.1
- Note-off ends a note. section 14.1
- Time-shift records the elapsed time between musical events. section 14.1
- Velocity records how strongly or loudly a note is played. section 14.1
From performance to Transformer input
Assign every distinct event value an index, then arrange the indexes into a token sequence. Standardize sequences to 2,048 indexes, shift the window one position to create input x and output y, and batch the pairs for training a decoder-only music Transformer. section 14.2 section 14.1
!pip install pretty_midi music21
Install pretty_midi and music21 to process MIDI files before tokenization. section 14.2
