-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing note-seq changes PrettyMIDI behavior for corrupt MIDI files. #29
Comments
Possibly related to #27 |
I'm guessing it's because of this line: https://github.com/magenta/note-seq/blob/master/note_seq/midi_io.py#L32 If you reset that constant to its default, do you get the desired behavior? This is a little tricky because we need that line to read some of our datasets, so I'm not sure what the best general solution is. |
Thanks, that's the problem. For now I've found a workaround on my end, but yeah I see the issue with this. Forking PrettyMIDI or setting and unsetting the variable each time are probably not the best ways to handle this. Maybe a warning about this behavior would suffice? |
That seems reasonable. Where would be a good place to put the warning? |
I was thinking in the README under the installation section. I can submit a PR in a bit for it. |
That would be great, thanks! |
I recently came across this bug while processing LMD with my own scripts and
note-seq
chord inference.Usually, when processing a corrupt MIDI file, pretty midi throws an exception. However, if
note-seq
is imported, no exception is thrown anymore.Reproducible code:
This was on python 3.8 with a clean virtualenv environment and the latest version of pretty midi and note-seq.
Naturally this kind of behavior causes a lot of problems downstream if you are relying on exceptions to be thrown for skipping corrupt MIDI files.
Let me know if it's reproducible, maybe I'm missing something on my side.
GitHub doesn't let me attach MIDI files, but you can find the corrupt file in the Lakh MIDI dataset in the
d
folder.The text was updated successfully, but these errors were encountered: