Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
clip

Language Guide / Functions · Generated API signature

clip

klang::clip

Alias for clamp in signal-flow expressions.

Limits a value to the supplied bounds. Bounds on either side of zero can produce hard clipping distortion when the input exceeds them.

-1-0.5-0.5-0.25000.50.2510.5ResultInput x
clip(x, −0.5, 0.5)

Based on std::clamp through Klang’s clamp.

Direct call

const signal limited = clip(sample, -0.5, 0.5);

Signal flow

const signal limited = sample >> clip(-0.5, 0.5);