grimmdude / MidiPlayerJS

♬ MIDI parser & player engine for browser or Node. As a parser converts MIDI events into JSON. Works well with single or multitrack MIDI files.
https://grimmdude.com/MidiPlayerJS/
MIT License
357 stars 52 forks source link

Some midis go over 100% when playing. #32

Closed ghost closed 5 years ago

ghost commented 6 years ago

This midi will go over 100% https://cdn.discordapp.com/attachments/360985607209484290/469173767126646815/poppippo3.mid

I am using Player.getSongPercentRemaining()

without stopping or pausing the song inbetween, when the song ends, Player.getSongPercentRemaining() returns -22. Not sure why. When i skip to 100 percent using Player.skipToPercent(), it skips to 100%, and acts like the song is done. the endOfFile event is triggered, and the song stops. Not Really sure why it does all of this.

grimmdude commented 5 years ago

Hi There,

The MIDI file you provided is fairly complex so there could be other things going on, but the latest release (2.0.5) on PR #40 may resolve the issue you're seeing.

-Garrett