-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
In this block
midi-player/src/midi-player.ts
Lines 77 to 79 in ae91c1c
if (state.endedTracks === this._json.tracks.length) { | |
this._stop(state); | |
} |
_stop()
is called as soon as "End of Track" message is found.
However, some notes may still be scheduled for the future. This means that "All Sound Off" will be sent too early.
My solution is to maintain an additional state latest
that calculates the latest scheduled event and only stops then
https://github.com/infojunkie/midi-player/blob/c351943c1da33bd818e30e67e37174bfd268f71c/src/midi-player.ts#L160-L167
Maybe there would be a way to only use the scheduled time of the "End of Track" message itself as the latest time, but I'm not sure this would be reliable.
Metadata
Metadata
Assignees
Labels
No labels