Send Midi Clock Using WAAClock #333
-
Hi. Long ago I read the article "A tale of Two Clocks" by Chris Wilson. For simplicity, I found the WAAClock that seems to implement Chris'es idea: https://github.com/sebpiq/WAAClock
Repeat EVERY 0.02 seconds is equivalent to 125 BPM, as Clock is 24 pulses per quarter note. (you can do the Math ;) ) QUESTION:
Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Timing in Web MIDI is definitely a pain point. This was discussed on the Web MIDI API GitHub repo. While I have not used it, WAAClock claims it uses Chris Wilson's approach. It might not be dead-accurate but it should not drift over longer periods of time.
WEBMIDI.js only provides the current time through Playing notes precisely is possible by scheduling them. For instance, this bit of code If you need to schedule other stuff, Chris Wilson's approach seems to be the way to go (until the Web MIDI API is available in workers). |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot djipco! Update: for the example, I was trying to sync Guitar Rig 5 (in Stand-Alone Mode) to tempo via MIDI Clock. I tried sending MIDI clock from REAPER and ABLETON LIVE to Guitar Rig 5 to see if the sync was better/solid. To my surprise, the BPM meter behaved exactly the same: constant tempo fluctuation. FWIW, I conclude that WAAClock works as expected. The BPM drift is the same as using Live/Repaer which, I assume, are capable of sending SOLID MIDI clock messages. For my test, I didn't use a Web Worker. Something like this is enough to send MIDI Clock. Modify it/create a class as needed;
Regard, |
Beta Was this translation helpful? Give feedback.
-
Awesome! Thanks for reporting your findings. I'm sure it'll help others. Cheers! |
Beta Was this translation helpful? Give feedback.
Thanks a lot djipco!
Update: for the example, I was trying to sync Guitar Rig 5 (in Stand-Alone Mode) to tempo via MIDI Clock. I tried sending MIDI clock from REAPER and ABLETON LIVE to Guitar Rig 5 to see if the sync was better/solid. To my surprise, the BPM meter behaved exactly the same: constant tempo fluctuation.
Notice that the drift is not really too much though.... So I guess that is what is possible via MIDI. Or maybe the Guitar Rig BPM matter is too "sensitive" (not rounding BPM display at all).
FWIW, I conclude that WAAClock works as expected. The BPM drift is the same as using Live/Repaer which, I assume, are capable of sending SOLID MIDI clock messages.
For my test, I didn't …