kosua20 / MIDIVisualizer

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

Midi files get stuck #16

Closed wesleykendall closed 5 years ago

wesleykendall commented 5 years ago

I've tried loading 4 different midi files on a Macbook Air with Mojave. The visualization works great up to a point, but then notes become "stuck" or simply stop appearing.

Screen Shot 2019-04-07 at 5 05 33 PM

I verified this same behavior on the pre-compiled version all the way to 2.1, and I've also compiled it myself to come across the same behavior.

The midi for the above screen shot is at https://drive.google.com/open?id=1Er6lBhaKwV_liCMiDdjTvKAvIxUEAB06

It also doesn't get past the first two notes of this midi https://drive.google.com/open?id=1lAexUmJ2J93oEyaUIvO-FujWqKsS3N9o

I verified that these two midis could be visualized with http://qiao.github.io/euphony/#20 just fine.

Any idea what might be going on? I love this tool!

wesleykendall commented 5 years ago

I had my friend try out the exact same midi file on a 64-bit windows machine today too. He experienced the same result for the second midi posted on my issue, seeing only the first two notes followed by nothing else. I originally thought it might be Mac related, but it seems that my midi files might be causing the issues. If you have any ideas of how I could fix it, I'd really love to use this software. It's so great! I've done OpenGL / C++ stuff quite a bit as well if you can point me in the right direction of where to look

kosua20 commented 5 years ago

Hello! Thank you for reporting this issue, I'll look into it. I think it might be related to the MIDI file parsing rather than the rendering, as MIDIVisualizer currently only support some "types" of MIDI. I'll keep you up to date.

wesleykendall commented 5 years ago

@kosua20 thanks so much! I was thinking it might be the same thing. These midi files are recorded directly from an instrument for reference. I tried converting them to different midi types and other things but didn't have much luck. I've been meaning to take a look at the code

kosua20 commented 5 years ago

I think I have found the issue: the instrument generated a lot of changedPressure and unknown MIDI events (probably some custom events defined by the manufacturer) with extremely long durations, which should probably be ignored when computing the track timings. I've pushed code modifications to prevent this, let me know if the timings are ok now.

wesleykendall commented 5 years ago

That did the trick! Thanks!