Tone.CtrlInterpolate

↳ EXTENDS Tone

Tone.CtrlInterpolate will interpolate between given values based on the “index” property. Passing in an array or object literal will interpolate each of the parameters. Note (i.e. “C3”) and Time (i.e. “4n + 2”) can be interpolated. All other values are assumed to be numbers.

CONSTRUCTOR

new Tone.CtrlInterpolate (
values
,
index
)
values

The array of values to interpolate over

type: Array
index

The initial interpolation index.

DEFAULTS

{
index : 0 ,
values : []
}

EXAMPLE

var interp = new Tone.CtrlInterpolate([0, 2, 9, 4]);
interp.index = 0.75;
interp.value; //returns 1.5

 

EXAMPLE

var interp = new Tone.CtrlInterpolate([
	[2, 4, 5],
	[9, 3, 2],
]);

Members

.index

Positive #

The interpolated index between values. For example: a value of 1.5 would interpolate equally between the value at index 1 and the value at index 2.

EXAMPLE

interp.index = 0; 
interp.value; //returns the value at 0
interp.index = 0.5;
interp.value; //returns the value between indices 0 and 1. 
 
</>

.value

* READONLY #

The current interpolated value based on the index

</>

.values

Array #

The values to interpolate between

</>

Methods

.dispose ( )

#
↪ returns Tone.CtrlInterpolate

this

Clean up

</>
docs generated Sep 15 2019