Skip to content

rescale

Rescales values to a user defined range.

Syntax

iout rescale ival, ioldmin, ioldmax, inewmin, inewmax
kout rescalek kval, koldmin, koldmax, knewmin, knewmax  
iout = rescale(ival, ioldmin, ioldmax, inewmin, inewmax)
kout = rescalek(kval, koldmin, koldmax, knewmin, knewmax)

Usage

Given a value, and parameters representing points describing the proportions of the transform, rescale will scale the value linearly. rescale is essentially the same as the Csound scale opcode with a different argument order. . The argument order is based on the rescale function in Common Music.


Outputs and arguments

i/koutArr[] -- output array

i/kval -- output value from.

i/kinArr[] -- input array

i/kndx -- index from which to retrieve the item.