Tone.IntervalTimeline

↳ EXTENDS Tone

Similar to Tone.Timeline, but all events represent intervals with both “time” and “duration” times. The events are placed in a tree structure optimized for querying an intersection point with the timeline events. Internally uses an Interval Tree to represent the data.

CONSTRUCTOR

new Tone.IntervalTimeline ( )

Members

.length

Number READONLY #

The number of items in the timeline.

</>

Methods

.remove ( )

#
event

The event to remove from the timeline

type: Object
↪ returns Tone.IntervalTimeline

this

Remove an event from the timeline.

</>

.cancel ( )

#
time

The time to query.

type: Number
↪ returns Tone.IntervalTimeline

this

Remove events whose time time is after the given time

</>

.dispose ( )

#
↪ returns Tone.IntervalTimeline

this

Clean up

</>

.forEach ( )

#
callback

The callback to invoke with every item

type: function
↪ returns Tone.IntervalTimeline

this

Iterate over everything in the timeline.

</>

.forEachAtTime ( )

#
time

The time to check if items are overlapping

type: Number
callback

The callback to invoke with every item

type: function
↪ returns Tone.IntervalTimeline

this

Iterate over everything in the array in which the given time overlaps with the time and duration time of the event.

</>

.forEachFrom ( )

#
time

The time to check if items are before

type: Number
callback

The callback to invoke with every item

type: function
↪ returns Tone.IntervalTimeline

this

Iterate over everything in the array in which the time is greater than or equal to the given time.

</>

.get ( )

#
event

The event to add to the timeline

type: Object
↪ returns Object

The event which spans the desired time

Get an event whose time and duration span the give time. Will return the match whose “time” value is closest to the given time.

</>

.add ( )

#
event

The event to add to the timeline

type: Object
↪ returns Tone.IntervalTimeline

this

The event to add to the timeline. All events must have a time and duration value

</>
docs generated Sep 15 2019