Timeline:
Filter:
CuePlayer/Classes (extension) | Class

Timeline
ExtensionExtension

Schedule functions in time using beats or seconds

Description

Timeline can be used for scheduling functions in time.

Class Methods

 

.new

Create a new Timeline instance.

Arguments:

clock

An instance of TempoClock.

 

options

An event containing options for the timeline. Valid options are:

  • A Symbol. Choose between \beats or \time. Default is in time.
  • A quantisation value in beats.
  • When a path to an scd file is used (see newFromPath) this will reload the file before every play, thus allowing for a smooth workflow while composing. It may be set to false to improve performance.

Returns:

An instance of Timeline.

.newFromArray

Create an instance of Timeline using an array of time - function pairs; time is in beats or optionally in seconds.

Arguments:

array

An instance of Array with time - function pairs, like [ 0, { }, 1, { } ].

clock

See new method.

options

See new method.

Returns:

An instance of Timeline.

 

.newFromPath

Create an instance of Timeline using an external scd file containing an Array of time - function pairs; time is in beats or optionally in seconds.

Arguments:

path

A String representing the path of an scd file. The file must return an Array of time - function pairs, like [ 0, { }, 1, { } ].

clock

See new method. time - function

options

See new method.

Returns:

An instance of Timeline.

Instance Methods

.play

Start the timeline according to quantisation value.

Returns:

The Timeline instance.

.stop

Stop the timeline.

 

.add

Add a time,function pair, like [ 1.5, { } ].

Arguments:

time

This is in seconds or beats according to options.

function

A Function to be avaluated at the given time.

Returns:

The Timeline instance.

.plot

Graph a simple representation of the scheduled items.

Arguments:

timeUnitLength

Choose the width (in pixels) of every second in the plot. Also, use the +/- keys on the keyboard to zoom in/out of the graph.

Returns:

The Timeline instance.

.options

Returns the current options event.

.clock

Get or set the TempoClock.

Examples