2026-07-26 · Street Grid Clock

A clock that sags

The Branca Series went nineteen modules deep before it had a clock. A patch built only from these modules could not generate its own time — you had to borrow one. Street Grid Clock closes that gap, and while building it there was one decision worth writing down.

The obvious version is wrong

The idea was a clock that behaves like a mains grid under load: it dips, then recovers. Straightforward enough. The obvious implementation is to perturb the tempo with noise — jitter it around nominal, sometimes faster, sometimes slower, averaging out to the set rate.

That version sounds bad, and it took very little time to work out why.

A clock that sometimes runs fast pushes the patch ahead of the beat. Everything downstream arrives early. There is a word for that feeling and it is not "unstable" — it is "wrong". Rushing reads as a mistake. It is the sound of a drummer who is nervous.

Dragging is different. A clock that only ever slows down and then recovers pulls the patch behind the beat. That reads as weight. As effort. As a machine working against something. It is the sound of a drummer who is holding back on purpose, and it is musically useful in a way that symmetric jitter never is.

So the sag is one-directional. It only ever reduces the rate.

// On average about one sag every two seconds at full depth.
const double pPerSample = b * 0.5 / sampleRate;
if (randUnit() < pPerSample) sag = 1.0;

// Exponential recovery, roughly a 250 ms time constant.
sag *= std::exp(-1.0 / (0.25 * sampleRate));
if (sag < 1e-4) sag = 0.0;

// At the deepest point the clock runs at 60% of nominal.
hzEff = hz * (1.0 - 0.4 * b * sag);

At full depth a sag arrives about every two seconds, drops the rate to 60% of nominal at its deepest, and recovers over roughly a quarter-second. The depth control scales both how often it happens and how far it goes, so turning it down does not just make the sags shallower — it makes them rarer too.

Zero has to mean zero

The second decision matters more, and it is the kind of thing that is easy to get lazy about.

When BROWNOUT is at zero, the random number generator is not consulted at all and the sag state is forced to zero. Not scaled to a very small number. Not multiplied by a coefficient that happens to round to nothing. Never called.

if (brownout > 0.f) {
    // ... sag logic, RNG, recovery
} else {
    sag = 0.0;
}

The result is that at zero the timing is bit-identical to a clean clock. Not "nearly steady" — exactly steady, sample for sample, indistinguishable from a clock with no brownout code in it at all.

This is not perfectionism. It is the difference between a module people will use as their patch master and one they will not. A clock is infrastructure. If there is any doubt at all about whether it drifts when the character control is off, nobody sensible will build on it — they will reach for something they trust and use this one as an effect, if at all.

"Nearly steady" would have defeated the entire purpose of shipping a clock.

Testing it away from the host

The timing logic lives in ClockCore, a host-independent class with no VCV Rack dependency, which means it can be tested offline in a plain C++ binary rather than by ear inside Rack. The suite asserts the things that are easy to get wrong and hard to hear: that phase does not drift over long runs, that swing delays only the odd-numbered pulses, that reset is reproducible, and that at brownout zero the output is exactly the clean-clock output.

That last test is the one that matters. It is trivially easy to write brownout code that looks disabled at zero and is not, and it is very difficult to notice by listening.

The rest of it

RATE is exponential — bpm = 20 × 15^rate — which puts 20 BPM at the bottom, 300 at the top, and most of the useful range in the lower half of the dial. Swing delays odd-numbered pulses by up to half a period. There are four outputs at /1, /2, /4 and /8, so one module can drive percussion, texture, melody and structure at related tempos, and an external clock input for when you would rather follow than lead.

None of that is unusual. The brownout is the only interesting part, and the interesting part of the brownout is what it refuses to do.


Street Grid Clock is 12 HP and part of the Branca Series — nineteen free, MIT-licensed VCV Rack modules. Full documentation · Source