[Function]
(interpl x envelope {keyword value}*)

Returns the interpolated y value of x in envelope, a list of xy coordinate pairs. The return value can be optionally scaled and offset according to the keyword arguments.

interpl supports the following keyword arguments:

:base number
If number is 1 then linear interpolation is performed. If number is greater or less than one then the return value follows an exponential where values greater than 1 produce concave curves and values less than 1 but greater than 0 produce convex curves. The default value is 1.
:scale number
Multiplies the return value by number. The default value is 1.
:offset number
Adds number to the return value after scaling. The default value is 0.
:min number
An alternate name for specifying an offset.
:max number
Sets the multiplier to max-min and the offset to min.

Examples:

Example 1. Interpolation with scale and offset.

(interpl 50 '(0 0 100 1) :scale 2 :offset 3)
 4.0
(interpl 50 '(0 0 100 1) :min -5 :max 5)
 0.0

Example 2. Exponential interpolation.

(interpl 50 '(0 0 100 1) :base 10)
 0.24025308
(interpl 50 '(0 0 100 1) :base .1 )
 0.7597469
(interpl 50 '(0 0 100 1) :base .1 :scale 1000)
 759.7469

See also: