The callback function to invoke at the scheduled tick.
ReadonlycontextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
Invoke all of the callbacks bound to the event with any arguments passed in.
The name of the event.
The arguments to pass to the functions listening.
The rate the callback function should be invoked.
ReadonlynameThe name of the class
Remove the event listener.
The event to stop listening to.
Optionalcallback: (...args: any[]) => voidThe callback which was bound to the event with Emitter.on. If no callback is given, all callbacks events are removed.
Bind a callback to a specific event.
The name of the event to listen for.
The callback to invoke when the event is emitted
Bind a callback which is only invoked once
The name of the event to listen for.
The callback to invoke when the event is emitted
StaticversionThe version number semver
Indicates if the instance was disposed. 'Disposing' an instance means that all of the Web Audio nodes that were created for the instance are disconnected and freed for garbage collection.
The duration in seconds of one sample.
The time since ticks=0 that the Clock has been running. Accounts for tempo curves
Returns the playback state of the source, either "started", "stopped" or "paused".
The number of times the callback was invoked. Starts counting at 0 and increments after the callback was invoked.
Clean up
Returns the scheduled state at the given time.
The name of the state input in setStateAtTime.
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.
The tick number.
When to measure the tick value from.
The time of the tick
Set multiple properties at once with an object.
Convert the incoming time to seconds. This is calculated against the current TransportInstance bpm
StaticgetReturns all of the default options belonging to the class.
A sample accurate clock which provides a callback at the given rate. While the callback is not sample-accurate (it is still susceptible to loose JS timing), the time passed in as the argument to the callback is precise. For most applications, it is better to use Tone.Transport instead of the Clock by itself since you can synchronize multiple callbacks.
Example