VClamp
Video oscillator to constrain a value between two parameters
See also: Clip VStep
Description
Analogous to the audio Clip class. Returns the input x if min < v < max, min if v < min, max if v > max.
Supported Rates: frame, shape, pixel
Class Methods
VClamp.fr(v, min, max)
VClamp.sr(v, min, max)
VClamp.pr(v, min, max)
Make a VClamp VGen at requested rate.
Arguments
v
Input value to clamp.
min
Minimum value to clamp v to.
max
Maximum value to clamp v to.
Returns:
x if min < v < max, min if v < min, max if v > max.
Dimensions
input |
output |
1, 1, 1, 1 |
1 |
2, 2, 2, 2 |
2 |
3, 3, 3, 3 |
3 |
4, 4, 4, 4 |
4 |
Examples
(
~t = ScinthDef.new(\t, {
var pos = VNormPos.pr;
var wave = (max(VX.pr(pos), VY.pr(pos)) * 25).sin;
VBWOut.pr(VClamp.pr(wave, 0.0, 0.5) * 2);
}).add;
)
(
~k = Scinth.new(\t);
)
Last modified July 28, 2020: Update for a 0.0.7 Scintillator release (#5) (0177d81)