kosua20 / MIDIVisualizer

A small MIDI visualizer tool, using OpenGL
MIT License
1.06k stars 140 forks source link

Note off events stop notes even if they are on a different channel #90

Closed 4321ba closed 3 years ago

4321ba commented 3 years ago

Just a small bug, it isn't a problem if it isn't fixed. Describe the issue MIDI Note off events stop notes even if they are on a different channel.

Hardware info:

Screenshot_20210107_171230 All the notes here should be the same length if they are not cut by another note. If they are, I made the MIDI so that the note off events happen before the next note on event (on the same channel). However, you can see that the 2 channels interfere (F# in the middle), my midi uses the same track, but different channels. First the green note off stops the blue note from being long. Then the next blue's note off stops the green, and that green's note off stops the next blue before it's supposed to end.

I think it is alright if the note on a given channel stops before it should, when a new note on happens on a different channel (meaning I don't think the program needs to draw notes on eachother). I don't actually know the midi specification that well but I don't think note off events from different channels should interfere this way (like a harp note shouldn't stop because a bass note off was called), I might be wrong though.

Also, MIDI file, it's like 20 seconds after the beginning: 145_Everpresence_Eldritch_Outlook.zip

kosua20 commented 3 years ago

Hello, thank you for this detailed report and for providing a test file! I've been able to pinpoint the bug and fix it. As you mentioned, when two notes from different channels overlap, one is going to hide the other, but at least now the durations should be correct. This is available in the latest 6.3 release

4321ba commented 3 years ago

Thanks! And I see you solved that too e.g. when a long note plays on B and after that a short one plays too which turns quickly off, the old long one will remain on. Screenshot_20210316_140256 Everything seems to work fine, so I'll close this.