midiclock
midiclock · sourcesHardware MIDI transport bridge. Locks to a MIDI device and surfaces the System Real-Time stream as gate/CV: clock (gate) at a user-selectable subdivision — 24=quarter (default, patch directly into TIMELORDE.clock to slave it to the external transport), 12=eighth, 6=sixteenth, 3=32nd, 1=raw 24 PPQN; run (cv, 0/1) tracks transport state; midistart + midistop fire one-shot gates on MIDI Start (0xFA) and Stop (0xFC). Continue (0xFB) raises run without re-firing midistart, so downstream loops resume in place. Channel-voice messages are ignored — pair with MIDI-CV-BUDDY for note/velocity. Same Web MIDI / ConstantSource / 2 ms lookahead plumbing as MIDI-CV-BUDDY.
the faceplate
0 inputs · 4 outputs · 0 params
outputs
| id | cable | what it does |
|---|---|---|
clock | gate | A short ~5 ms pulse whose rising edge fires once every N incoming MIDI ticks, where N is the card's clock-division setting (MIDI runs at a fixed 24 ticks per quarter note, so N=24 gives one pulse per quarter note, 12 an eighth, 6 a sixteenth, 3 a 32nd, and 1 the raw 24-PPQN tick stream). Patch it into a SEQUENCER's CLOCK IN or TIMELORDE to slave the rack's timing to the external transport. On a MIDI Start the divider re-zeros so the first pulse lands cleanly on the downbeat. gate / trigger; trigger — fires once per rising edge |
run | cv | A level that sits at 0 while the external transport is stopped and rises to 1 while it is running; it latches to 1 on both MIDI Start and MIDI Continue and drops to 0 on MIDI Stop. Use it as a gate to enable downstream modules only while the master transport is playing. control voltage (CV) |
midistart | gate | A one-shot pulse whose rising edge fires the instant a MIDI Start message (0xFA) arrives — the 'play from the top' signal. It does NOT fire on MIDI Continue, because Continue exists precisely to resume mid-song without re-zeroing downstream loops; patch this into a reset/restart input to snap things back to the beginning when the transport starts fresh. gate / trigger; trigger — fires once per rising edge |
midistop | gate | A one-shot pulse whose rising edge fires when a MIDI Stop message (0xFC) arrives. Patch it where you want something to fire exactly when the external transport halts (mute an envelope, reset a counter, drop a gate). gate / trigger; trigger — fires once per rising edge |
controls
| control | what it does |
|---|---|
| Divisor | How many incoming MIDI ticks go by between edges on the CLOCK jack. MIDI is fixed at 24 pulses per quarter note, so 1/4 (24) emits one edge per beat — the setting TIMELORDE and most hardware expect — while 1/8, 1/16 and 1/32 subdivide it and `raw` (1) passes the whole 24 PPQN stream through unchanged. Only these five are offered because only they divide 24 evenly: a division that does not lands on no note value and drifts against every other clock in the room. Changing it re-zeros the divider, so a mid-song change starts counting from the next tick rather than partway through, and the first edge afterwards is clean. |
| Midiclock connect {n} | The one-time-per-origin permission gesture. Web MIDI needs the browser's consent before any device is even visible, and until it is granted this module has no stream to listen to and all four jacks sit at rest — so this is the first thing to press, not an optional extra. It reaches the same request every MIDI module in the rack shares, which always yields a nameable outcome: granted, refused, unsupported, or the quiet case where the browser suppressed its own prompt without telling anyone. Once access is granted the dock's device body lists the inputs it found and remembers the one you pick, so a reloaded patch re-attaches without another click. |
source
midiclock.ts on GitHub.