MidiTok: KeyError: 'Chord_ukn4'

I am trying to use a basic code snippet to convert a midi file into tokens, but I keep getting the above-mentioned key error. I have attached the code I am using for reference:

config = TokenizerConfig(nb_velocities=16, use_chords=True, use_programs=True) tokenizer = REMI(config)` midi = MidiFile(‘Optimus-VIRTUOSO-RGA-Edition-Main-Sample.mid’) tokens = tokenizer(midi) # calling the tokenizer will automatically detect MIDIs, paths and tokens converted_back_midi = tokenizer(tokens)

This issue has been persistent with almost all the MIDI files that I have tried to tokenise. I seem to be missing something too trivial.

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Noted! For the Position error, I think this is due to a time signature enforcing a ticks/beat ratio not covered by the tokenizer. Again, I’ll run tests on this, but this should be fixed in #124