craffel/pretty-midi

MAX_TICK value problem

aggelosgkiokas opened this issue · 1 comments

There are examples like in the MAPS dataset [1] where the tick resolution of the MIDI is very high 32767/beat. This results for an error raise "MIDI file has a largest tick of ..it is likely corrupt" in pretty_midi.py line 87. I think that a check like

max_tick/self.resolution > ANOTHER_THRESHOLD

would make more sense.

[1] Emiya, Valentin, Nancy Bertin, Bertrand David, and Roland Badeau. "MAPS-A piano database for multipitch estimation and automatic transcription of music." (2010).

You can override the MAX_TICK attribute of pretty_midi before loading the file.