Tone.TickSignal
↳ EXTENDS Tone.TimelineSignalTone.TickSignal extends Tone.TimelineSignal, 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
- getTickAtTime
- exponentialRampToValueAtTime
- getDurationOfTicks
- setTargetAtTime
- getTimeOfTick
- toMaster
- connect
- disconnect
- exponentialRampTo
- getTimeConstant
- rampTo
- targetRampTo
- linearRampTo
- setRampPoint
- cancelScheduledValues
- setValueAtTime
- setValueCurveAtTime
- exponentialRampToValueBetween
- cancelAndHoldAtTime
- dispose
- getValueAtTime
- linearRampToValueAtTime
- linearRampToValueBetween
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
.getTickAtTime ( )
#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.
.exponentialRampToValueAtTime ( )
#Schedules an exponential continuous change in parameter value from the previous scheduled parameter value to the given value.
.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
.setTargetAtTime ( )
#Start exponentially approaching the target value at the given time with a rate having the given time constant.
.getTimeOfTick ( )
#Given a tick, returns the time that tick occurs at.
.toMaster ( )
#this
Connect ‘this’ to the master output. Shorthand for this.connect(Tone.Master)
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
.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
.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.
.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
.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
.setRampPoint ( )
#When to set the ramp point
this
Sets the computed value at the given time. This provides a point from which a linear or exponential curve can be scheduled after. Will cancel events after the given time and shorten the currently scheduled linear or exponential ramp so that it ends at time
. This is to avoid discontinuities and clicks in envelopes.
.cancelScheduledValues ( )
#this
Cancels all scheduled parameter changes with times greater than or equal to startTime.
.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
Set an array of arbitrary values starting at the given time for the given duration.
.exponentialRampToValueBetween ( )
#The value to ramp to.
The beginning anchor point to do the exponential ramp
The ending anchor point by which the value of the signal will equal the given value.
this
Do a exponential ramp to the given value between the start and finish times.
.cancelAndHoldAtTime ( )
#this
Cancels all scheduled parameter changes with times greater than or equal to cancelTime and sets the output of the signal to be the value at cancelTime. Similar to (cancelScheduledValues)[#cancelscheduledvalues].
.getValueAtTime ( )
#Get the scheduled value at the given time. This will return the unconverted (raw) value.
.linearRampToValueAtTime ( )
#Schedules a linear continuous change in parameter value from the previous scheduled parameter value to the given value.
.linearRampToValueBetween ( )
#The value to ramp to.
The beginning anchor point to do the linear ramp
The ending anchor point by which the value of the signal will equal the given value.
this
Do a linear ramp to the given value between the start and finish times.