Skip to content

Instantly share code, notes, and snippets.

@BuriedStPatrick
Last active July 16, 2026 10:44
Show Gist options
  • Select an option

  • Save BuriedStPatrick/92ea1fff2eda4a71f99d9dbf5207fc3d to your computer and use it in GitHub Desktop.

Select an option

Save BuriedStPatrick/92ea1fff2eda4a71f99d9dbf5207fc3d to your computer and use it in GitHub Desktop.
ReaScript: Automate BPM MIDI Clock

Automate BPM MIDI Clock in REAPER

Sending clock in REAPER is super easy, but it's also entirely locked to the project's tempo. This is less ideal in scenarios where you want a time-based timeline but still need to keep BPM in sync with various devices, such as live shows.

This JSFX plugin gives you a little slider you can automate your BPM. Put it on a track that sends MIDI to the device you want to manage the clock with.

Remember to un-check "Send Clock" in the MIDI output config. Otherwise you'll be sending 2 competing signals to the device.

Caveats

There is always going to be a bit of delay or ramping since JSFX operates on a sample base, not device clock base. So the resolution is not going to be as perfect as the native "Send Clock" option. But it's close enough for most scenarios.

If you want zero ramping, keep phase = 0; in the @slider section. This makes it so the phase is reset whenever the slider changes in your automation curve. So you'll get almost hard transitions with little ramp, but they'll have a bit of delay until the phase goes above samples_per_tick.

If you DO want ramping tempo, then remove the phase = 0; line in the @slider section.

desc:MIDI Clock Generator
slider1:120<20,300,1>BPM
@init
ppqn = 24;
phase = 0;
bpm = slider1;
@slider
bpm = slider1;
phase = 0;
samples_per_tick = srate * 60 / (bpm * ppqn);
@block
i = 0;
while (i < samplesblock) (
phase += 1;
phase >= samples_per_tick ? (
midisend(i, $xF8, 0, 0);
phase -= samples_per_tick;
);
i += 1;
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment