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

getCurrentTick should return correct value in edge cases #41

Closed akupiec closed 5 years ago

akupiec commented 5 years ago

Quite self-explanatory. This patch fixes corner cases of getCurrentTick, more details in test cases.

grimmdude commented 5 years ago

Hi @akupiec,

Thanks very much for this PR! Looks good, but I see CI is failing because it can't find that sinon module you're using in the tests. Could you add that dependency to the list of devDependencies in package.json please?

-Garrett

akupiec commented 5 years ago

I found one more unexpected behavior related to ticks, after calling Player.stop()