Tone.Add

↳ EXTENDS Tone.Signal

Add a signal and a number or two signals. When no value is passed into the constructor, Tone.Add will sum input[0] and input[1]. If a value is passed into the constructor, the it will be added to the input.

CONSTRUCTOR

new Tone.Add ( [
value
] )
value

If no value is provided, Tone.Add will sum the first and second inputs.

type: number
optional

EXAMPLE

var signal = new Tone.Signal(2);
var add = new Tone.Add(2);
signal.connect(add);
//the output of add equals 4
 

EXAMPLE

//if constructed with no arguments
//it will add the first and second inputs
var add = new Tone.Add();
var sig0 = new Tone.Signal(3).connect(add, 0, 0);
var sig1 = new Tone.Signal(4).connect(add, 0, 1);
//the output of add equals 7. 

Members

↳ inherited from Tone.Param

.convert

↝ Boolean #

If the value should be converted or not

</>
↳ inherited from Tone.Param

.units

↝ Tone.Type #

The units of the parameter

</>
↳ inherited from Tone.Param

.value

↝ Number #

The current value of the parameter.

</>

Methods

.dispose ( )

#
↪ returns Tone.Add

this

Clean up.

</>
↳ inherited from Tone.Param

.exponentialRampToValue ( )

#
value

The value to ramp to.

type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
↪ returns Tone.Param

this

Schedules an exponential continuous change in parameter value from the current time and current value to the given value over the duration of the rampTime.

EXAMPLE

//exponentially ramp to the value 2 over 4 seconds. 
signal.exponentialRampToValue(2, 4);
</>
↳ inherited from Tone.Param

.exponentialRampToValueAtTime ( )

#
value
type: number
endTime
type: Time
↪ returns Tone.Param

this

Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.

</>
↳ inherited from Tone.Param

.linearRampToValue ( )

#
value

The value to ramp to.

type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
↪ returns Tone.Param

this

Schedules an linear continuous change in parameter value from the current time and current value to the given value over the duration of the rampTime.

EXAMPLE

//linearly ramp to the value 4 over 3 seconds. 
signal.linearRampToValue(4, 3);
</>
↳ inherited from Tone.Param

.linearRampToValueAtTime ( )

#
value
type: number
endTime
type: Time
↪ returns Tone.Param

this

Schedules a linear continuous change in parameter value from the previous scheduled parameter value to the given value.

</>
↳ inherited from Tone.Param

.rampTo ( )

#
value
type: number
rampTime

the time that it takes the value to ramp from it’s current value

type: Time
↪ returns Tone.Param

this

Ramps to the given value over the duration of the rampTime. Automatically selects the best ramp type (exponential or linear) depending on the units of the signal

EXAMPLE

//ramp to the value either linearly or exponentially 
//depending on the "units" value of the signal
signal.rampTo(0, 10);
</>
↳ inherited from Tone.Param

.setRampPoint ( )

#
now

(Optionally) pass the now value in.

type: number
optional
↪ returns Tone.Param

this

Creates a schedule point with the current value at the current time. This is useful for creating an automation anchor point in order to schedule changes from the current value.

</>
↳ inherited from Tone.Param

.setTargetAtTime ( )

#
value
type: number
startTime
type: Time
timeConstant
type: number
↪ returns Tone.Param

this

Start exponentially approaching the target value at the given time with a rate having the given time constant.

</>
↳ inherited from Tone.Param

.setValueAtTime ( )

#
value

The value to set the signal.

type: *
time

The time when the change should occur.

type: Time
↪ returns Tone.Param

this

Schedules a parameter value change at the given time.

EXAMPLE

//set the frequency to "G4" in exactly 1 second from now. 
freq.setValueAtTime("G4", "+1");
</>
↳ inherited from Tone.Param

.cancelScheduledValues ( )

#
startTime
type: Time
↪ returns Tone.Param

this

Cancels all scheduled parameter changes with times greater than or equal to startTime.

</>
↳ inherited from Tone.Param

.setValueCurveAtTime ( )

#
values
type: Array
startTime
type: Time
duration
type: Time
↪ returns Tone.Param

this

Sets an array of arbitrary parameter values starting at the given time for the given duration.

</>
docs generated Sep 15 2019