clocked

clockedRunner · utilities

Self-contained mini-LIVECODE owning a single clocked() callback. Spawned by the parent LIVECODE card when you invoke clocked(division, fn); deleting the runner cancels the schedule. Body is editable inline; the audio-domain factory re-evaluates it on every division boundary derived from TIMELORDE.bpm.

A self-contained mini-LIVECODE that owns a single clocked() callback. You don't add it from the palette — a LIVECODE module spawns one for you when your script calls clocked(division, fn), and the runner stores that function body plus its musical division (e.g. 1/16) on its own state. It subscribes to the rack's shared clock and re-runs the body on every tick that crosses the next division boundary, locked to TIMELORDE's tempo (so a clock.bpm(140) call retimes it on the next tick, and a MIDI-locked tempo follows automatically). Its faceplate shows the body in a code editor with a DIVISION picker beside it, and you can edit the body inline — it recompiles on change, and the next tick runs the new version. It has no audio jacks: like LIVECODE itself, it acts by mutating the rack through the patch graph each tick. The clock subscription belongs to the module rather than to any window onto it, so the body keeps firing whether or not its faceplate is open; deleting the module is what cancels it.

the faceplate

clockedaudiocvgatepitch
0 inputs · 0 outputs · 0 params

controls

controlwhat it does
Clocked runner division {n}How often the callback body runs, as a division of TIMELORDE's beat. 1/16 is sixteen evaluations per beat, 1 is once per beat, and 2x and 4x are SLOWER than a beat — one evaluation every two or four. The period is re-derived from the live tempo on every tick rather than latched when the runner was made, so a clock.bpm(140) from the parent LIVECODE, or a tempo locked to incoming MIDI clock, retimes this runner on its next boundary with no restart. Changing the division takes effect the same way, on the next boundary. The finest three settings (1/128, 1/256, 1/512) are derived from the worker scheduler's own 25 ms tick rather than from a TIMELORDE output port, because the master clock does not publish divisions that fine — so at a fast tempo they approach the scheduler's own resolution and stop getting proportionally faster.

source

clocked-runner.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo