-
Tokenize midi file as described in SEQUENCE-TO-SEQUENCE PIANO TRANSCRIPTION WITH TRANSFORMERS
-
I am not sure wheter decoding step is properly implemented.
-
This repo will be provided as-is. No update is expected.
- Supports
- Tokenize mido object to midi tokens.
def midi_to_token_save(midi_file, tk_config): tokenizer = Tokenizer(tk_config) midofile = mido.MidiFile(midi_file) tokens = tokenizer.mido_to_token(midofile)
- Split the token sequence in the desired time range.
token_split = tokenizer.split( tokens, start_time, end_time, )
- Convert token sequence to a PrettyMidi object
- Binary velocity
- Tokenize mido object to midi tokens.