-
Notifications
You must be signed in to change notification settings - Fork 25
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
Zero-length / Duplicated notes in midi_score files #8
Comments
What library are you using to get the midi messages? |
I'm reading them with mido in python. |
You are right. I'm seeing a lot of these problems. In the meantime, I suggest you filter out any note of duration 0.
Again, keep in mind that some of the musicxml scores, especially for complex pieces like Liszt do contain encoding errors and other problems because they were crowdsourced by non professionals, and because of musescore-to-musicxml conversion problems. Bach pieces should be pretty clean instead. |
All good! I was originally using music21 which did most of the parsing and cleaning itself, but for some reason it didn't like these files and was giving garbage outputs occasionally, so I switched to manually parsing the on/off messages with mido. Ignoring these notes seems to have fixed the issues I was having. Thanks so much for the help! |
Hey, I'm not actually 100% sure whether this is a bug or just me not understanding how exactly these MIDI files are meant to work- but I'm noticing something a little odd where the midi_scores for pieces have MIDI that looks something like this:
---- note_on, 60, time=0 -----
---- note_off, 60, time=0 -----
---- note_on, 60, time=0 -----
< other stuff that takes time >
---- note_off, 60, time=(something >0) ----
This example happens in the midi_score for Bach Fugue bvw_846, 7.0 seconds into the piece.
In other words, there is often a quick succession of on-off-on, then a gap, then the off signal for the actual note. Is this unintentional (meaning my processor should ignore these zero-length hits) or does it mean something different when processing the files?
The other pattern I notice (much less frequently) is what seems to be "duplicated notes" for lack of a better term, which looks like:
---- note_on, 63, time=0 -----
---- note_on, 63, time=0 -----
< other stuff that takes time >
---- note_off, 63, time=(something >0) -----
---- note_off, 63, time=0 ----
In this case, it's like both the on and off signals occur in a place that makes sense, it's just that they are both duplicated. This example happens in the score for Bach Fugue bwv_848, 22.75 seconds into the piece.
I could write my code to ignore both of these types of occurrences (in other words, ignore 0-length and duplicated notes) but I just want to make sure these aren't meant to convey any other special meaning before destroying that information.
Thanks for your help!
The text was updated successfully, but these errors were encountered: