scale2
Arbitrary signal scaling with optional smoothing.
Maps an input range to an output range, with optional smoothing.
Syntax
Initialization
ihtime -- smoothing half-time in seconds. For a constant mapped value, this is the time needed to halve the remaining difference between the output and that value. Zero disables smoothing (the default). Negative values are not allowed.
Performance
kinput -- input value. Values below kimin or above kimax are clamped to those bounds before scaling.
kmin -- output value corresponding to kimin.
kmax -- output value corresponding to kimax. The output range may run in either direction.
kimin -- Optional; Minimum of the incoming value range, defaulting to zero.
kimax -- Optional; Maximum of the incoming value range, defaulting to one. It must be greater than kimin.
Smoothing starts from zero each time the opcode initializes. The output can therefore start outside the output range while it moves toward the mapped value. With smoothing disabled, the output is the mapped value immediately.
Warning
The argument order is minimum before maximum, which differs from scale.
Examples
Here is an example of the scale2 opcode. It uses the file scale2.csd.
See also
Linear and Exponential Generators
Credits
Author: John ffitch after David Akbari
December
2020