Clock Sync
To play in time with a DAW, drum machine, or another sequencer, Resonon can share a MIDI clock — either driving everything as the master, or following an external source. This guide covers the virtual-port setup you need first, then both clock modes, and finally syncing with a DAW.
Setting Up a Virtual MIDI Port
Section titled “Setting Up a Virtual MIDI Port”Clock sync rides over a MIDI port shared between Resonon and the other application. On most systems that means a virtual port.
macOS (IAC Driver)
Section titled “macOS (IAC Driver)”- Open Audio MIDI Setup (Applications → Utilities).
- Choose Window → Show MIDI Studio (
Cmd+2). - Double-click IAC Driver, check Device is online, and make sure at least one port exists (default: “Bus 1”).
- Click Apply.
Windows (loopMIDI)
Section titled “Windows (loopMIDI)”Install loopMIDI and create a virtual port (e.g. “loopMIDI Port”).
Linux (ALSA / JACK)
Section titled “Linux (ALSA / JACK)”Use an ALSA or JACK virtual MIDI port from your audio setup.
Confirm the port is visible to Resonon:
print(midi_ports()); // "IAC Driver Bus 1" (or your virtual port) should appearresonon --list-ports # same, from the command lineMaster Mode — Sending Clock
Section titled “Master Mode — Sending Clock”midi_clock_send(true) makes Resonon the clock master: it emits 24-PPQ clock
ticks to all connected output ports, alongside Start, Stop, and Continue transport
messages.
midi_connect("IAC Driver Bus 1", "daw");midi_clock_send(true);setbpm(120);PLAY;Disable it with midi_clock_send(false). In your DAW, set the transport to follow
external MIDI clock on the same port and it will lock to Resonon’s tempo.
Follower Mode — Following Clock
Section titled “Follower Mode — Following Clock”midi_clock_follow(alias) syncs Resonon’s tempo and transport to an external clock
arriving on a connected input port:
midi_input_connect("DAW Output", "daw");midi_clock_follow("daw");While following:
- Tempo is derived by averaging 24 ticks (one quarter note).
- Start resets playback to the beginning; Stop pauses; Continue resumes.
- A soft PLL applies phase correction (up to ~1 ms per quarter note) to stay tightly locked.
Turn it off by passing false:
midi_clock_follow(false);Output Delay & Clock Offset
Section titled “Output Delay & Clock Offset”Two knobs align MIDI with your audio and with external gear:
midi_delay(ms) delays all outgoing MIDI — notes and clock. Use it to
compensate for audio output latency so MIDI and audio stay aligned:
midi_delay(15); // delay all MIDI output by 15msprint(midi_delay()); // getter: prints 15midi_clock_offset(ms) shifts only clock ticks — positive delays them, negative
sends them earlier — independent of midi_delay(). The total delay on ticks is
midi_delay() + midi_clock_offset():
midi_delay(15); // all MIDI delayed 15msmidi_clock_offset(-5); // clock ticks shifted 5ms earlier// Effective clock delay: 15 + (-5) = 10ms// Effective note delay: 15ms| Function | Description |
|---|---|
midi_clock_send(true / false) | Enable / disable 24-PPQ clock output (master mode) |
midi_clock_follow(alias / false) | Follow / stop following external clock (follower mode) |
midi_delay(ms) / midi_delay() | Set / get global MIDI output delay (notes + clock) |
midi_clock_offset(ms) / midi_clock_offset() | Set / get clock-only offset |
Troubleshooting
Section titled “Troubleshooting”| Error | Cause | Fix |
|---|---|---|
No MIDI input connected with alias '...' | midi_clock_follow with an unknown alias | Connect the input first with midi_input_connect() |
| Tempo drifts or won’t lock | No clock arriving, or wrong port | Confirm the source is sending clock and check midi_routing() |
| Clock send has no effect | Nothing follows the port | Set your DAW’s transport to follow external MIDI clock |
midi_routing() prints the current clock state (mode: master (sending) or
mode: follower (from "...")) — check it first when sync misbehaves.
Syncing With a DAW
Section titled “Syncing With a DAW”Any DAW that accepts external MIDI input can play instruments driven by Resonon over the virtual port. The steps are the same everywhere:
- Open your DAW’s MIDI preferences and enable the virtual port as an input.
- Create an instrument track and load a synth or plugin.
- Set the track’s MIDI input to the virtual port (or “All Inputs”) and enable input monitoring.
- Send notes from Resonon:
midi_connect("IAC Driver Bus 1", "daw");
let t = MidiTrack(1);t << [C4 E4 G4 E4];PLAY;To record Resonon’s output as MIDI clips, arm the DAW track and press record before running your code.
Multiple channels
Section titled “Multiple channels”Drive several DAW instruments at once by putting each on its own channel:
midi_connect("IAC Driver Bus 1", "daw");
let drums = MidiTrack(10); // channel 10 (GM drums)let bass = MidiTrack(1);let lead = MidiTrack(2);In the DAW, create one track per channel listening to the shared port.
Next Steps
Section titled “Next Steps”Synced and playing — now get your work out as files.
- Export & MPE — write Standard MIDI Files
- MIDI In & CC — bring notes and controllers back in
- Troubleshooting — fixes for common issues