Clamp Node

Constrains an audio/control signal to a specified min-max range, so that the output is always guaranteed to be within those boundaries. It’s useful to ensure a control signal is always within an expected range.

Note: this Node does a hard clamp, meaning it will not try to compress or otherwise gracefully attenuate a signal. If a sample is outside the min/max range, it’s immediately clamped. Consequently, it has the potential to add bad amounts of distortion to an audio signal when clamping occurs.

If you are looking for a softer alternative for audio signals, try the Compressor Node. To do a linear transformation of a range of control signal values (e.g. converting a [-1, 1] signal to a [0, 1] signal proportionally), you can use the Constant Range Transform Node instead.


Inputs

Audio/Control Input

The audio or control signal to clamp.

Min-Control Input

When the Automate Min from input setting is enabled, the audio/control signal connected to this input automates the Min setting. If this input is enabled, but there is no connection to it, it’s practically the same as if a constant 0 signal was connected.

Max-Control Input

When the Automate Max from input setting is enabled, the audio/control signal connected to this input automates the Max setting. If this input is enabled, but there is no connection to it, it’s practically the same as if a constant 0 signal was connected.


Settings

Min

The lowest value of samples in the output, inclusive. If a sample is lower than the Min value, it gets replaced with the Min value.

Max

The greatest value of samples in the output, inclusive. If a sample is greater than the Max value, it gets replaced with the Max value.

Automate Min from input

Enables the Min-control input and disables the Min setting. When enabled, the effective value of the Min setting is read from that input.

Automate Max from input

Enables the Max-control input and disables the Max setting. When enabled, the effective value of the Max setting is read from that input.


Outputs

Audio/Control Output

The audio or control signal with clamping applied.


Technical Details

The clamping is applied on a per-sample basis. This is also the case when the Min-control input or the Max-control input is enabled, in which case those inputs are also processed on a per-sample basis.

If, for any reason, the effective order of min-max values is reversed (i.e. min > max), they are automatically swapped under the hood. This means every sample in the output will continue to remain between these 2 values.