Blog Clock 8 min read

MIDI Clock Sync from a Gamepad — Tap, Rate, Transport

Drive MIDI clock from a DualSense. Tap-tempo on R3, half-time / double-time on the left stick, transport on L1/R1. The gamepad becomes the master clock.

By Aidxn Design

MIDI clock is the unsexy, indispensable part of every multi-device studio. It's how a Volca knows what tempo the drum machine is running, how Resolume's effects sync to Ableton's bar, how a Eurorack clock divider gets in time with a DAW. Normally you set it on a panel or in a preferences pane. Here's the twist: a gamepad button makes a great tap-tempo, an analog stick makes a great rate-modulator, and the shoulder buttons make a great transport surface. Spoiler: this is one of the most fun uses of the bridge.

TL;DR
  • What MIDI clock is: 24 ticks per quarter note, sent as 0xF8 status bytes at the current tempo.
  • Tap-tempo button: hit R3 four times, bridge averages the intervals and outputs steady clock.
  • Rate-mod stick: L-stick Y scales clock 0.5×–2×. Half-time breakdowns and double-time builds at your thumb.
  • Transport: L1 = Start (0xFA), R1 = Stop (0xFC), L1+R1 = Continue (0xFB), Position Pointer optional.

What MIDI clock actually is

MIDI clock is a single-byte System Real-Time message: 0xF8. It's sent 24 times per quarter note. At 120 BPM that's 48 messages per second, or one every ~20.8 ms. Receivers count 0xF8 bytes between transport events and derive the tempo from the interval. Companion messages: 0xFA Start, 0xFB Continue, 0xFC Stop, 0xF2 Song Position Pointer.

The bridge generates clock from a high-resolution scheduler thread. On macOS that's a mach_wait_until loop on a real-time thread. On Linux it's clock_nanosleep with TIMER_ABSTIME. On Windows it's a multimedia timer with timeBeginPeriod(1). Jitter is <200 microseconds across all platforms.

Tap-tempo from a button

Bind a button to Tap Tempo and the bridge starts capturing timestamps on every press. After two presses it computes a tempo from the interval. After three, it averages. The default window is the last 8 taps, with outliers (more than 2× the median interval) rejected. The output is rounded to one decimal of BPM to avoid wobble.

{`class TapTempo {
  private taps: number[] = [];
  private maxTaps = 8;

  tap(now: number): number | null {
    this.taps.push(now);
    if (this.taps.length > this.maxTaps) this.taps.shift();
    if (this.taps.length < 2) return null;

    const intervals = [];
    for (let i = 1; i < this.taps.length; i++) {
      intervals.push(this.taps[i] - this.taps[i-1]);
    }
    const median = intervals.sort()[Math.floor(intervals.length/2)];
    const filtered = intervals.filter(x => x < median * 2 && x > median * 0.5);
    const avg = filtered.reduce((a,b) => a+b, 0) / filtered.length;
    return 60000 / avg;  // BPM
  }
}`}

Rate-modulation from a stick

Here's where the gamepad becomes genuinely musical. Map the left-stick Y axis to a clock-rate multiplier on a curve. At rest the multiplier is 1.0 — clock runs at the base tempo. Push the stick up and the multiplier rises smoothly to 2.0; the receiving devices speed up. Pull down for half-time. Snap back to centre for nominal. Use a small deadzone around 1.0 so you don't accidentally detune the entire kit.

{`{
  "input": "stick.left.y",
  "type": "clock-rate",
  "range": [0.5, 2.0],
  "deadzone": 0.05,
  "centre": 1.0,
  "curve": "exponential",
  "smoothingMs": 30
}`}

Smoothing matters. Without it, jitter on the stick translates to audible clock wobble. 30 ms of EMA smoothing kills the wobble without making the response feel laggy.

Get Universal Controller MIDI Pro — $89 →

Transport — start, stop, continue, position

MIDI transport is three messages: 0xFA Start (begin from bar 1), 0xFB Continue (resume from current position), 0xFC Stop. Plus 0xF2 lsb msb Song Position Pointer to jump to a specific 16th-note offset.

{`{
  "lanes": [
    { "input": "button.l1", "type": "transport", "action": "start" },
    { "input": "button.r1", "type": "transport", "action": "stop" },
    { "input": "combo:l1+r1", "type": "transport", "action": "continue" },
    { "input": "dpad.up", "type": "song-position", "delta": "+16" },
    { "input": "dpad.down", "type": "song-position", "delta": "-16" }
  ]
}`}

Combos let you stack actions. L1+R1 together means Continue. dpad.up nudges position forward by 16 sixteenth-notes (one bar in 4/4).

Use case 1 — pocket sync rig for hardware jams

Plug a DualSense into your laptop. Run the bridge with MIDI clock master enabled. Hardware MIDI out from the laptop into a Volca chain. The gamepad becomes a sync controller — tap a fresh tempo, ride the stick for half-time drops, hit L1 to start the chain when the room is ready. No mouse, no menu, no laptop screen.

Use case 2 — visual sync for VJ rigs

Resolume Arena, Notch, MadMapper all sync to MIDI clock. Drive the visual rig from the gamepad and the lighting/visuals stay locked to the music's tempo. Half-time stick = visuals slow down to match the breakdown. Hit Start to launch a scene. The same controller drives audio MIDI (clip launch, FX) and visual MIDI (clock).

Use case 3 — drift correction for Bluetooth gear

Bluetooth MIDI gear sometimes drifts by 0.1–0.3 BPM over a long set. With the bridge re-sending clock at sub-200 microsecond jitter from a stable timer, you get tighter sync than re-broadcasting from a phone. Useful for OP-1 chains and any Bluetooth-only synth.

Limitations

  • You can't be master and slave at the same time. If your DAW is also outputting clock, decide who's in charge.
  • Ableton Link is better for multi-device sync over Wi-Fi than MIDI clock. The bridge sends MIDI clock; if your network is multi-host, look at Link.
  • Rate-mod a clock and hardware sequencers may glitch. Volcas and old MachineDrums hate sudden tempo jumps. Smooth the rate change to taste.
  • Tap tempo on Bluetooth inherits Bluetooth jitter. For tightest sync, use USB.
  • Song Position Pointer only works while transport is stopped. Most DAWs ignore SPP mid-playback.

Turn a gamepad into a tempo controller and you'll wonder why every studio doesn't have one on the desk. Grab Universal Controller MIDI, enable clock master, and tap a fresh tempo with your thumb.

Keep reading

More setup walkthroughs