A time-shift event advances the represented time between musical events. In performance-based music encoding, it replaces continuous timestamps with discrete timing increments so a MIDI performance can become a token sequence for a music Transformer. section 14.1.1 section 14.2.2
Read each time-shift value as a duration increment:
- Durations longer than 1 second are split across multiple time-shift events. section 14.1.1
- Time-shift events appear alongside note-on, note-off, and velocity events, preserving timing while separating pitch, release, and dynamics. section 14.1.1
Encoding the first note
A note beginning at approximately 1.0326 seconds follows two time-shift tokens with values 99 and 2. Together they represent 1 second plus 0.03 seconds, after which a velocity event and note-on event encode the note.
During conversion, the encoder generates time shifts from the gap between the previous event time and the current note time. The resulting events can then be converted to indexes for model training; the inverse mapping reconstructs event types and values.
