Unit Delay

UtilityunitdelayLight CPU

Holds a sample for one tick — the node that makes feedback loops legal.

What it does

Delays a signal by exactly one sample — and legalises feedback loops.

Wraps no DaisySP class: it is a single float held across samples. Its output is read at the very top of the audio callback, before any other node runs, and its input is stored at the very bottom, after all of them. Because the value you read never depends on anything computed in the same pass, a wire back into this node creates no ordering constraint — so a cycle that runs through a Unit Delay is accepted, while a cycle without one is still refused. The write is clamped to ±Limit so a loop with gain above unity buzzes instead of going silent.

Parameters

  • Limit (±)

    limit
    Default 4Range 1 … 100

    The hard ceiling on what this node stores, applied to the write and never to the read. It exists so a feedback loop that gains more than it loses ends up loud and buzzing rather than silent — without it the loop would reach infinity and then NaN, and NaN spreads downstream as silence, which tells you nothing about where the problem is. Leave it at 4 unless a loop you WANT is being flattened; there is no way to switch it off.

One sample of memory. Its output is the value written on the previous sample, so it can sit inside a loop that would otherwise be rejected: Out → your processing → back into In. That is how you build a comb filter, an allpass, or a Karplus-Strong string out of the palette. Outside a loop it is a one-sample alignment delay.

Ports

In

  • In input

Out

  • Out (z⁻¹) output

Audio Control

Inputs

In
Value to store for the next sample.

Outputs

Out (z⁻¹)
The value stored on the previous sample. Starts at 0.

Rules and gotchas

  • A feedback loop is legal only if a Unit Delay is somewhere in it. A DSP cycle with no Unit Delay is still rejected — the generated C++ would reference a value before it exists.
  • Every wire into a Unit Delay is exempt from ordering, not just the one that closes the loop. Two Unit Delays in the same loop therefore behave like one for the sort; each still holds its own sample.
  • The Limit clamps the WRITE, never the read, and it is always on. It is a safety bound rather than a sound: at ±4 it sits far outside the normal ±1 audio range, so an ordinary loop never touches it.
  • A loop needs to lose more than it gains or it will run away into the clamp. Put an attenuator in it — Scale / Offset, or a Mixer level below 1. A gain of exactly 1.0 does not decay.
  • One sample at 48 kHz is about 21 microseconds. For a comb tuned to an audible pitch use the Comb Filter module; chaining Unit Delays to reach a musical delay time is not practical.

Patches using it

  • Comb Filter (Feedback Loop)standard

Bundled with the app — open one from the example browser.