A simple MIDI Tokenizer in the style of Score Transformer
from midi_to_tokens import midi_to_tokens
tokens = midi_to_tokens('path/to/midi', steps_per_beat=12).tokens
To tokenize measures 1 through 4 only,
tokens = midi_to_tokens('path/to/midi', steps_per_beat=12).measures(1, 4)
- bar : measure/downbeat
- beat : beat
- pos : position
- note : note pitch
- len : note length/duration