A tiny SuperCollider openFrameworks clock bridge

Hi

I made a minimal OSC bridge for sharing one clock between SuperCollider and openFrameworks. Built small on purpose — to avoid the induced debilitation of heavier setups.

SuperCollider owns the clock and sends a phase ramp (0…1) once per bar. openFrameworks receives it, subdivides it into a step grid at its own frame rate, and you click a step to arm it. From then on it sounds once per bar, the instant the phase sweeps across it — and the on-screen flash is driven by the beat echoed back from SC, so if the two ever drift you can watch them separate.

Two messages. That’s the whole contract:

SC ──/phase <float 0…1>──► OF
OF ──/beat ────► SC

Small enough to read top to bottom, and meant as a starting point you build off of.

https://github.com/leeMeredith/sc-of-phase-bridge

I’d appreciate any feedback, and I’d welcome anything you’d add or approach differently — whether on the SC side or the OF side.

Thank you to everyone that works on SuperCollider

1 Like

Update: the openFrameworks side is now an installable addon, so the bridge is easier to pick up from either direction:

Nothing changed on the SuperCollider end — it’s the same small bridge.scd. SC holds the clock: a plain Routine on SystemClock sends a phase ramp (0…1) once per bar, and an OSCdef listens for which steps openFrameworks has armed. When the phase crosses one of those steps, SC plays it and sends the beat back; the visual over on the OF side is triggered by that returning message, so if the timing ever slips you can see it. SC never decides beats or meter — it only says where it is in the bar.
Two messages each way:
SC ──/phase <float 0…1>──► OF
OF ──/beat ────► SC
I left the SC side plain — easy to read and swap the voice.
thax

3 Likes

HI
Small addition: there’s now a second example in the addon — example-twoWindow — for putting the graphics on their own screen.
It separates the operator view from the audience view, the clickable grid stays in one window, and a second output-only window draws from the same clock — a sweep that tracks phase and a pulse on each beat. Both windows read one shared bridge, so the phase and beats stay aligned across them.

Thanks again.