A UGen that constrains a signal to a given range, by "wrapping" values outside
the range. This is similar to the wrap2
binary operator but permits both a
lower range value lo
and an upper range value hi
.
An input value greater than or equal to hi
will be wrapped back to
(in - hi) % (hi - lo) + lo
. An input value less than lo
will be wrapped
back to hi - (lo - in) % (hi - lo)
.
===Examples===
// wrap pulse wave to modulate timbre
play {
val hi = SinOsc.ar(0.1).linExp(-1, 1, 0.01, 1.0)
Wrap.ar(Pulse.ar(300), 0, hi) * 0.2 / hi
}
- See also
- Companion
- class
Type members
Value members
Concrete methods
- Value Params
- hi
upper margin of wrapping (exclusive)
- in
input signal to constrain
- lo
lower margin of wrapping (inclusive)
- Value Params
- hi
upper margin of wrapping (exclusive)
- in
input signal to constrain
- lo
lower margin of wrapping (inclusive)