@maruaudio/dsp/mixing/constant outputs the same clamped value on every sample: a DC or offset source for modulation graphs and the simplest probe for comparing execution lanes. It has no input and no state besides the stored value.
const state = initConstantNode(48000)
setConstantNodeValue(state, 0.375)
const y = constantNodeTick(state) // 0.375Parameters
| Setter | Range the setter enforces | Default |
|---|---|---|
setConstantNodeValue | −1 to 1 | 0 |
The sample rate passed to initConstantNode is stored and not read.
Lifecycle
initConstantNode → setConstantNodeValue → constantNodeTick. There is no reset: the tick reads the stored value and changes nothing. Ticks allocate nothing and do no I/O.
When to use it
A fixed control offset, a bias to add to a modulation signal, or a known signal to feed a chain when checking that two targets produce the same numbers.
Limits
- Mono sample tick, not a block Processor.
- The clamp is the kernel node's conditional clamp, not the
math/rangepolicy: a NaN passes through unchanged. - A new value applies on the next tick, with no smoothing.