Optionalcallback: ToneEventCallback<CallbackType<ValueType>>
The callback to invoke on each event
Optionalvalue: ValueType[]
the array of events
Optionaloptions: Partial<PartOptions<ValueType>>Protected_the amount of variation from the given time.
Protected_Loop value
Protected_When the note is scheduled to start.
Protected_When the note is scheduled to start.
Protected_The playback speed of the note. A speed of 1 is no change.
Protected_private holder of probability value
Protected_A delay time from when the event is scheduled to start
Protected_Tracks the scheduled events
The callback to invoke.
ReadonlycontextThe context belonging to the node.
Set this debug flag to log all events that happen in this class.
If mute is true, the callback won't be invoked.
ReadonlynameThe name of the class
The value which is passed to the callback function.
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.
If set to true, will apply small random variation to the callback time. If the value is given as a time, it will randomize by that amount.
If set to true, will apply small random variation to the callback time. If the value is given as a time, it will randomize by that amount.
The number of scheduled notes in the part.
If the part should loop or not between Part.loopStart and Part.loopEnd. If set to true, the part will loop indefinitely, if set to a number greater than 1 it will play a specific number of times, if set to false, 0 or 1, the part will only play once.
If the note should loop or not between ToneEvent.loopStart and ToneEvent.loopEnd. If set to true, the event will loop indefinitely, if set to a number greater than 1 it will play a specific number of times, if set to false, 0 or 1, the part will only play once.
The loopStart point determines when it will loop if Part.loop is true.
The playback rate of the part
The probability of the notes being triggered.
The probability of the notes being triggered.
The current progress of the loop interval. Returns 0 if the event is not started yet or it is not set to loop.
The duration in seconds of one sample.
The start from the scheduled start time.
The start from the scheduled start time.
Returns the playback state of the note, either "started" or "stopped".
Protected_Get the duration of the loop.
Protected_Get a subset of the properties which are in the partial props
Protected_Internal tick method
The time of the event in seconds
Optionalvalue: anyAdd a an event to the part.
The time the note should start. If an object is passed in, it should have a 'time' attribute and the rest of the object will be used as the 'value'.
Optionalvalue: any
Any value to add to the timeline
Get/Set an Event's value at the given time. If a value is passed in and no event exists at the given time, one will be created with that value. If two events are at the same time, the first one will be returned.
The time of the event to get or set.
Optionalvalue: any
If a value is passed in, the value of the event at the given time will be set to it.
Cancel scheduled state change events: i.e. "start" and "stop".
Optionalafter: Time | TransportTimeClass<number>
The time after which to cancel the scheduled events.
Remove all of the notes from the group.
disconnect and dispose.
Get the object's attributes.
ProtectedlogPrints the outputs to the console log for debugging purposes.
Prints the contents only if either the object has a property
called debug set to true, or a variable called TONE_DEBUG_CLASS
is set to the name of the class.
Remove an event from the part. If the event at that time is a Part, it will remove the entire part.
Remove an event from the part. If the event at that time is a Part, it will remove the entire part.
The time of the event
Optionalvalue: any
Optionally select only a specific event value
Set multiple properties at once with an object.
Convert the incoming time to seconds. This is calculated against the current TransportClass bpm
Optionaltime: TimeConvert the input time into ticks
Optionaltime: Time | TimeClass<number, TimeBaseUnit>StaticgetReturns all of the default options belonging to the class.
Part is a collection ToneEvents which can be started/stopped and looped as a single unit.
Example
Example