Old 08-29-2019, 10:42 AM   #1
Human being with feelings
Join Date: Aug 2019
Posts: 1
Default MIDI jsfx: BPM estimator from MIDI timing clock

Hi all,

I've been having fun using my Squarp Pyramid as a master clock with Reaper. For the long version of the story see https://llllllll.co/t/clock-sync-without-sync/24663, but the short version is, if I offset Reaper's BPM very slightly I can reduce clock drift between my USB audio device and my Pyramid to ~1ms per 10 minutes of recording, which is small enough to live with. Eg, if I set the Pyramid to 128BPM, setting Reaper to 128.042BPM compensates for 95% of the clock drift (but this will probably change in winter as the room cools down, ahhahahahahaha).

Here's the script I'm using to calculate the BPM:


It works by collecting MIDI timing clock message intervals over a long period (up to and beyond 30s) and then averaging. Add it as in input plugin to a MIDI track for a hardware device sending out MIDI start/clock/stop messages (e.g. a hardware sequencer), enable Reaper's external clock sync via SPP from the device, "Start playback on valid timecode if stopped", arm the MIDI track for recording, and hit play on the MIDI device - the plugin interface will show "sampling..." for a while then show you what it thinks the device's BPM is, which you can then manually set in Reaper.

Hope this is useful for someone else!

Last edited by damian0815; 08-29-2019 at 10:48 AM.
damian0815 is offline   Reply With Quote
Old 08-29-2019, 03:09 PM   #2
Human being with feelings
sinkmusic's Avatar
Join Date: Feb 2006
Location: decepticon mothership in a hidden place inside a mountain
Posts: 3,360

Very interesting ! Thank you for sharing
I really, really wish Reaper could be set up as a Midi slave, and your JsFX could come in very handy : i need to try it !
sinkmusic is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 03:26 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.