⚙ Clockwork
Clock: tick 0
Grid prototype →

Compiled program

This is exactly what runs on every audio block. Each wire is a variable nK; each unit delay is a variable that keeps its value between ticks. Constants come from p[] so turning a knob never recompiles.


    
  

How Clockwork works

One clock. 48 000 times per second, every block computes exactly once. Each wire carries one number per tick.

Seven atoms. Constant, Copy, Add, Multiply, Unit delay, Switch, Greater-than. Everything else — oscillators, sequencers, envelopes, filters — is built from them. Open any library block to see how.

Unit delay = register. It outputs what its input was on the previous tick. Any feedback loop must pass through one; a loop without a delay is a combinational loop and is rejected, just as in FPGA design.

Explicit fan-out. An output drives exactly one input. Use Copy to send a signal to two places.

Clock enables. To run something slower than the clock (a sequencer step, a sample-and-hold), put a Switch in front of a register so it only updates when an "enable" pulse is 1. See Sample&Hold, Counter4, Seq4.

Control panels. Inside a composite, select a Constant and tick "Show as a control". It becomes a knob, toggle or button on every instance's face.

Editing

Your project autosaves in this browser. Use Export/Import to move it elsewhere.