You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been lurking around the web to find how to implement seek operation in my MIDI player implementation (not in JS) and found that MidiPlayerJS offers skipToTick() feature.
It is cool, but it doesn't make sense if you simply ignore any intermediate MIDI events such as program changes, control changes, pitchbend and so on. They should be processed accordingly. It is most likely that only notes can be simply ignored.
(I'm not a user of your library ATM, but wanted to share my findings.)
The text was updated successfully, but these errors were encountered:
Thanks for your message. I agree, that approach might not be the best way to go. I think that was an attempt at seek functionality that I couldn't get to work quite properly. I haven't had time lately to tackle again, but would like to when I'm available.
Best of luck to you on getting something similar working in your implementation. Send a link if you got it.
I have my own MIDI player in C# https://github.com/atsushieno/managed-midi/blob/master/lib/base/MidiPlayer.cs - It is designed in very similar mindset to MidiPlayerJS, leaving any platform-specific backend parts to MIDI player "events". (There is a handful of nasty workarounds and known issues, so I wouldn't recommend it as a reference material so far.)
A hacky way to achieve that is to break current play, send "all sound off" (CC 120) and restart from scratch, and skip wait operation for delta time with any MIDI message except for note on/off ones, until it passes beyond the specified ticks.
A decent way is to do above plus preserve "last changed" messages to each MIDI messages and flush the last ones at the end (so that you can skip a lot of pitchbend, expression, and so on). However it may result in unexpected messaging for MIDI player adapters like MidiPlayerJS (for example what if we have a "event-logging player backend", it wouldn't like skipped events).
I only have hacky implementation so far, but it seems to work without glitch.
I have been lurking around the web to find how to implement seek operation in my MIDI player implementation (not in JS) and found that MidiPlayerJS offers skipToTick() feature.
MidiPlayerJS/src/player.js
Line 277 in 92f3d54
It is cool, but it doesn't make sense if you simply ignore any intermediate MIDI events such as program changes, control changes, pitchbend and so on. They should be processed accordingly. It is most likely that only notes can be simply ignored.
(I'm not a user of your library ATM, but wanted to share my findings.)
The text was updated successfully, but these errors were encountered: