craffel / pretty-midi

Utility functions for handling MIDI data in a nice/intuitive way.
MIT License
856 stars 151 forks source link

ValueError when trying to read certain .mid files #228

Closed XaverStiensmeier closed 1 year ago

XaverStiensmeier commented 1 year ago

In the dataset YM2413-MDB-v1.0.2 on multiple files pretty_midi.PrettyMIDI(file) are returning ValueError: MIDI file has a largest tick of 11222570, it is likely corrupt. They sound normal when played in VLC.

For example data/YM2413-MDB-v1.0.2/midi/adjust_tempo_remove_delayed_inst/01 Last Attack.mid, Galaxy Force (FM) - 02 - Beyond the Galaxy.mid and Galaxy Force (FM) - 05 - Take Back.mid.

The dataset is available here: https://zenodo.org/record/7520537

I also opened a stackoverflow question on this topic as I am unsure whether this is a bug or not: https://stackoverflow.com/questions/76491005/midi-file-has-a-largest-tick-of-11222570-it-is-likely-corrupt-how-to-solve?noredirect=1#comment134869814_76491005

craffel commented 1 year ago

See https://github.com/craffel/pretty-midi/issues/112