Tone.TimelineState
↳ EXTENDS Tone.TimelineA Timeline State. Provides the methods: setStateAtTime("state", time)
and getValueAtTime(time)
.
CONSTRUCTOR
new Tone.TimelineState (The initial state of the TimelineState. Defaults to undefined
Members
.memory
↝ Positive #The memory of the timeline, i.e. how many events in the past it will retain
Methods
.getNextState ( )
#The state to look for
When to check from
The event with the given state after the time
Return the event after the time with the given state
.getValueAtTime ( )
#The time to query.
The name of the state input in setStateAtTime.
Returns the scheduled state scheduled before or at the given time.
.setStateAtTime ( )
#The name of the state to set.
The time to query.
this
Add a state to the timeline.
.getLastState ( )
#The state to look for
When to check before
The event with the given state before the time
Return the event before the time with the given state
.forEach ( )
#The callback to invoke with every item
this
Iterate over everything in the array
.forEachAfter ( )
#The time to check if items are before
The callback to invoke with every item
this
Iterate over everything in the array after the given time.
.forEachAtTime ( )
#The time to check if items are before
The callback to invoke with every item
this
Iterate over everything in the array at the given time
.forEachBefore ( )
#The time to check if items are before
The callback to invoke with every item
this
Iterate over everything in the array at or before the given time.
.forEachBetween ( )
#The time to check if items are before
The end of the test interval.
The callback to invoke with every item
this
Iterate over everything in the array between the startTime and endTime. The timerange is inclusive of the startTime, but exclusive of the endTime. range = [startTime, endTime).
.forEachFrom ( )
#The time to check if items are before
The callback to invoke with every item
this
Iterate over everything in the array at or after the given time. Similar to forEachAfter, but includes the item(s) at the given time.
.get ( )
#The time to query.
Which value in the object to compare
The event object set after that time.
Get the nearest event whose time is less than or equal to the given time.
.getAfter ( )
#The time to query.
Which value in the object to compare
The event object after the given time
Get the event which is scheduled after the given time.
.getBefore ( )
#The time to query.
Which value in the object to compare
The event object before the given time
Get the event before the event at the given time.
.peek ( )
#The first event object
Return the first event in the timeline without removing it
.previousEvent ( )
#The event to find the previous one of
The event right before the given event
Returns the previous event if there is one. null otherwise
.remove ( )
#The event object to remove from the list.
this
Remove an event from the timeline.
.add ( )
#The event object to insert into the timeline.
this
Insert an event object onto the timeline. Events must have a “time” attribute.
.shift ( )
#The first event object
Return the first event in the timeline and remove it
.cancel ( )
#The time to query.
this
Cancel events after the given time
.cancelBefore ( )
#The time to cancel before.
this
Cancel events before or equal to the given time.