Tone.TimelineState

↳ EXTENDS Tone.Timeline

A Timeline State. Provides the methods: setStateAtTime("state", time) and getValueAtTime(time).

CONSTRUCTOR

new Tone.TimelineState (
initial
)
initial

The initial state of the TimelineState. Defaults to undefined

type: String

Members

inherited from Tone.Timeline

.length

Number READONLY #

The number of items in the timeline.

</>
inherited from Tone.Timeline

.memory

Positive #

The memory of the timeline, i.e. how many events in the past it will retain

</>

Methods

.getNextState ( )

#
state

The state to look for

type: Tone.State
time

When to check from

type: Time
↪ returns Object

The event with the given state after the time

Return the event after the time with the given state

</>

.getValueAtTime ( )

#
time

The time to query.

type: Number
↪ returns String

The name of the state input in setStateAtTime.

Returns the scheduled state scheduled before or at the given time.

</>

.setStateAtTime ( )

#
state

The name of the state to set.

type: String
time

The time to query.

type: Number
↪ returns Tone.TimelineState

this

Add a state to the timeline.

</>

.getLastState ( )

#
state

The state to look for

type: Tone.State
time

When to check before

type: Time
↪ returns Object

The event with the given state before the time

Return the event before the time with the given state

</>
inherited from Tone.Timeline

.forEach ( )

#
callback

The callback to invoke with every item

↪ returns Tone.Timeline

this

Iterate over everything in the array

</>
inherited from Tone.Timeline

.forEachAfter ( )

#
time

The time to check if items are before

type: Number
callback

The callback to invoke with every item

↪ returns Tone.Timeline

this

Iterate over everything in the array after the given time.

</>
inherited from Tone.Timeline

.forEachAtTime ( )

#
time

The time to check if items are before

type: Number
callback

The callback to invoke with every item

↪ returns Tone.Timeline

this

Iterate over everything in the array at the given time

</>
inherited from Tone.Timeline

.forEachBefore ( )

#
time

The time to check if items are before

type: Number
callback

The callback to invoke with every item

↪ returns Tone.Timeline

this

Iterate over everything in the array at or before the given time.

</>
inherited from Tone.Timeline

.forEachBetween ( )

#
startTime

The time to check if items are before

type: Number
endTime

The end of the test interval.

type: Number
callback

The callback to invoke with every item

↪ returns Tone.Timeline

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).

</>
inherited from Tone.Timeline

.forEachFrom ( )

#
time

The time to check if items are before

type: Number
callback

The callback to invoke with every item

↪ returns Tone.Timeline

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.

</>
inherited from Tone.Timeline

.get ( )

#
time

The time to query.

type: Number
comparator

Which value in the object to compare

type: String
↪ returns Object

The event object set after that time.

Get the nearest event whose time is less than or equal to the given time.

</>
inherited from Tone.Timeline

.getAfter ( )

#
time

The time to query.

type: Number
comparator

Which value in the object to compare

type: String
↪ returns Object

The event object after the given time

Get the event which is scheduled after the given time.

</>
inherited from Tone.Timeline

.getBefore ( )

#
time

The time to query.

type: Number
comparator

Which value in the object to compare

type: String
↪ returns Object

The event object before the given time

Get the event before the event at the given time.

</>
inherited from Tone.Timeline

.peek ( )

#
↪ returns Object

The first event object

Return the first event in the timeline without removing it

</>
inherited from Tone.Timeline

.previousEvent ( )

#
event

The event to find the previous one of

type: Object
↪ returns Object

The event right before the given event

Returns the previous event if there is one. null otherwise

</>
inherited from Tone.Timeline

.remove ( )

#
event

The event object to remove from the list.

type: Object
↪ returns Tone.Timeline

this

Remove an event from the timeline.

</>
inherited from Tone.Timeline

.add ( )

#
event

The event object to insert into the timeline.

type: Object
↪ returns Tone.Timeline

this

Insert an event object onto the timeline. Events must have a “time” attribute.

</>
inherited from Tone.Timeline

.shift ( )

#
↪ returns Object

The first event object

Return the first event in the timeline and remove it

</>
inherited from Tone.Timeline

.cancel ( )

#
time

The time to query.

type: Number
↪ returns Tone.Timeline

this

Cancel events after the given time

</>
inherited from Tone.Timeline

.cancelBefore ( )

#
time

The time to cancel before.

type: Number
↪ returns Tone.Timeline

this

Cancel events before or equal to the given time.

</>
inherited from Tone.Timeline

.dispose ( )

#
↪ returns Tone.Timeline

this

Clean up.

</>
docs generated Sep 15 2019