You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pretty_midi.py write() function does a lot of nice sanity checking and normalization of the data. For example, it sorts note onsets by time, pitch and velocity. It also checks for note-on and note-off ordering. And some other nice stuff (default time signature, etc).
Much of this sanitization should be available without having to write the file and read it back in. It would mean pulling a bunch of code out of write() into a sanitize_instruments() function. It would have to be slightly rewritten to operate over instruments rather than tracks. I guess we'd want it to be non-destructive so that it would be optional to use at the time of reading in.
The text was updated successfully, but these errors were encountered:
I don't think this particular distinction exists in pretty_midi, unless you mean checking that a given Note has start < end; that's covered by Instrument.remove_invalid_notes.
I don't think that part is not relevant for pretty_midi's representation of MIDI data, because all notes are independent. That is, all notes in pretty_midi include an explicit correspondence between note on and note off, which isn't true in MIDI (hence the need for that code).
pretty_midi.py write() function does a lot of nice sanity checking and normalization of the data. For example, it sorts note onsets by time, pitch and velocity. It also checks for note-on and note-off ordering. And some other nice stuff (default time signature, etc).
Much of this sanitization should be available without having to write the file and read it back in. It would mean pulling a bunch of code out of write() into a sanitize_instruments() function. It would have to be slightly rewritten to operate over instruments rather than tracks. I guess we'd want it to be non-destructive so that it would be optional to use at the time of reading in.
The text was updated successfully, but these errors were encountered: