Tone.TickSignal
↳ EXTENDS Tone.SignalTone.TickSignal extends Tone.Signal, but adds the capability to calculate the number of elapsed ticks. exponential and target curves are approximated with multiple linear ramps. Thank you Bruno Dias, H. Sofia Pinto, and David M. Matos, for your WAC paper describing integrating timing functions for tempo calculations.
CONSTRUCTOR
new Tone.TickSignal (The initial value of the signal
- numberOfOutputs
- channelInterpretation
- channelCount
- context
- channelCountMode
- numberOfInputs
- value
- convert
- units
- getTimeOfTick
- exponentialRampToValueAtTime
- timeToTicks
- getDurationOfTicks
- getTicksAtTime
- ticksToTime
- setTargetAtTime
- toMaster
- chain
- connect
- disconnect
- fan
- cancelAndHoldAtTime
- cancelScheduledValues
- exponentialRampTo
- linearRampTo
- linearRampToValueAtTime
- rampTo
- setRampPoint
- exponentialApproachValueAtTime
- setValueAtTime
- setValueCurveAtTime
- targetRampTo
- getValueAtTime
- dispose
Members
.numberOfOutputs
↝ Number READONLY #The number of outputs coming out of the AudioNode.
.channelInterpretation
↝ String READONLY #channelInterpretation determines how individual channels will be treated when up-mixing and down-mixing connections to any inputs to the node. The default value is “speakers”.
.channelCount
↝ Number READONLY #channelCount is the number of channels used when up-mixing and down-mixing connections to any inputs to the node. The default value is 2 except for specific nodes where its value is specially determined.
.context
↝ Tone.Context READONLY #Get the audio context belonging to this instance.
.channelCountMode
↝ String READONLY #channelCountMode determines how channels will be counted when up-mixing and down-mixing connections to any inputs to the node. The default value is “max”. This attribute has no effect for nodes with no inputs.
.numberOfInputs
↝ Number READONLY #The number of inputs feeding into the AudioNode. For source nodes, this will be 0.
Methods
.getTimeOfTick ( )
#Given a tick, returns the time that tick occurs at.
.exponentialRampToValueAtTime ( )
#Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.
.timeToTicks ( )
#The time interval to convert to ticks.
When along the automation timeline to convert the ticks.
The duration in ticks.
The inverse of ticksToTime. Convert a duration in seconds to the corresponding number of ticks accounting for any automation curves starting at the given time.
.getDurationOfTicks ( )
#The number of ticks to calculate
The time to get the next tick from
The duration of the number of ticks from the given time in seconds
Return the elapsed time of the number of ticks from the given time
.getTicksAtTime ( )
#The time to get the tick count at
The number of ticks which have elapsed at the time given any automations.
Returns the tick value at the time. Takes into account any automation curves scheduled on the signal.
.ticksToTime ( )
#The number of ticks to convert to seconds.
When along the automation timeline to convert the ticks.
The duration in seconds of the ticks.
Convert some number of ticks their the duration in seconds accounting for any automation curves starting at the given time.
.setTargetAtTime ( )
#Start exponentially approaching the target value at the given time with a rate having the given time constant.
.toMaster ( )
#this
Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)
EXAMPLE
.chain ( )
#this
Connect the output of this node to the rest of the nodes in series.
EXAMPLE
.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
.fan ( )
#this
connect the output of this node to the rest of the nodes in parallel.
.cancelAndHoldAtTime ( )
#this
This is similar to cancelScheduledValues except it holds the automated value at time until the next automated event.
.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
.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
.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.
.exponentialApproachValueAtTime ( )
#The value to ramp to.
When the ramp should start.
the time that it takes the value to ramp from it’s current value
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. This methods is similar to setTargetAtTime except the third argument is a time instead of a ‘timeConstant’
EXAMPLE
.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 ( )
#If the values in the curve should be scaled by some value
this
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
.getValueAtTime ( )
#Return the current signal value at the given time.