I've been working with MIDI files generated from MIDI keyboard playing and finding that some of them are seriously flawed, in that the number of note_on messages and note_off messages does not always match up, and there is no way to reconstruct the input from the MIDI output.
When I count note_offs, I am accounting for both 0 velocity note_ons and explicit note_off messages. Sometimes I find more note_ons than note_offs, sometimes vice versa, and worst of all sometimes even if they match in number there isn't a proper correspondence.
Has anyone else encountered this problem (which might be keyboard specific?) And if so, did you figure out what might be a/the cause of it?