Tone.TickSource↳ EXTENDS Tone
Uses Tone.TickSignal to track elapsed ticks with complex automation curves.
CONSTRUCTORnew Tone.TickSource (
The initial frequency that the signal ticks at
.seconds↝ Seconds #
The time since ticks=0 that the TickSource has been running. Accounts for tempo curves
.state↝ Tone.State READONLY #
Returns the playback state of the source, either “started”, “stopped” or “paused”.
.ticks↝ Ticks #
The number of times the callback was invoked. Starts counting at 0 and increments after the callback was invoked. Returns -1 when stopped.
.stop ( )#
Stop the clock. Stopping the clock resets the tick counter to 0.
.forEachTickBetween ( )#
The beginning of the search range
The end of the search range
Invoke the callback event at all scheduled ticks between the start time and the end time
.getSecondsAtTime ( )#
Return the elapsed seconds at the given time.
.getStateAtTime ( )#
Returns the scheduled state at the given time.
.getTicksAtTime ( )#
Get the elapsed ticks at the given time
.getTimeOfTick ( )#
The tick number.
When to measure the tick value from.
The time of the tick
Get the time of the given tick. The second argument is when to test before. Since ticks can be set (with setTicksAtTime) there may be multiple times for a given tick value.
.pause ( )#
Pause the clock. Pausing does not reset the tick counter.
.setTicksAtTime ( )#
The tick value to set
When to set the tick value
Set the clock’s ticks at the given time.
.start ( )#
The time the clock should start
Start the clock at the given time. Optionally pass in an offset of where to start the tick counter from.