Tone.Add
↳ EXTENDS Tone.SignalAdd 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 ( [If no value is provided, Tone.Add will sum the first and second inputs.
EXAMPLE
EXAMPLE
Members
.context
↝ Tone.Context READONLY #Get the audio context belonging to this instance.
.lfo
↝ Tone.LFO READONLY #The LFO created by the signal instance. If none was created, this is null.
Methods
.connect ( )
#optionally which output to connect from
optionally which input to connect to
this
connect the output of a ToneNode to an AudioParam, AudioNode, or ToneNode
.disconnect ( )
#Either the output index to disconnect if the output is an array, or the node to disconnect from.
this
disconnect the output
.toMaster ( )
#this
Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)
EXAMPLE
.getTimeConstant ( )
#The time to convert
The time constant to get an exponentially approaching curve to over 99% of towards the target value.
Convert between Time and time constant. The time constant returned can be used in setTargetAtTime.
.cancelAndHoldAtTime ( )
#this
This is similar to cancelScheduledValues except it holds the automated value at cancelTime until the next automated event.
.linearRampToValueAtTime ( )
#Schedules a linear continuous change in parameter value from the previous scheduled parameter value to the given value.
.rampTo ( )
#The time that it takes the value to ramp from it’s current value
When the ramp should start.
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
EXAMPLE
.setRampPoint ( )
#(Optionally) pass the now value in.
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.
.setTargetAtTime ( )
#Start exponentially approaching the target value at the given time with a rate having the given time constant.
.setValueAtTime ( )
#The value to set the signal.
The time when the change should occur.
this
Schedules a parameter value change at the given time.
EXAMPLE
.setValueCurveAtTime ( )
#Sets an array of arbitrary parameter values starting at the given time for the given duration.
.targetRampTo ( )
#The value to ramp to.
the time that it takes the value to ramp from it’s current value
When the ramp should start.
this
Start exponentially approaching the target value at the given time. Since it is an exponential approach it will continue approaching after the ramp duration. The rampTime is the time that it takes to reach over 99% of the way towards the value.
EXAMPLE
.linearRampTo ( )
#The value to ramp to.
the time that it takes the value to ramp from it’s current value
When the ramp should start.
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
.cancelScheduledValues ( )
#this
Cancels all scheduled parameter changes with times greater than or equal to startTime.
.exponentialRampTo ( )
#The value to ramp to.
the time that it takes the value to ramp from it’s current value
When the ramp should start.
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
.exponentialRampToValueAtTime ( )
#Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.