Timeline can be used for scheduling functions in time.
Create a new Timeline instance.
clock |
An instance of TempoClock. |
options |
An event containing options for the timeline. Valid options are:
options: ( mode: \time, quant: 1, liveReload: true ) |
An instance of Timeline.
Create an instance of Timeline using an array of time - function pairs; time is in beats or optionally in seconds.
array |
An instance of Array with time - function pairs, like [ 0, { }, 1, { } ]. |
clock |
See new method. |
options |
See new method. |
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.
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. |
An instance of Timeline.
xxxxxxxxxx
// Example contents of an .scd file
[
1, {"event 1".postln;},
2, {"event 2".postln;},
3, {"event 3".postln;},
4, {"event 4".postln;}
]
Start the timeline according to quantisation value.
The Timeline instance.
Add a time,function pair, like [ 1.5, { } ].
time |
This is in seconds or beats according to options. |
function |
A Function to be avaluated at the given time. |
The Timeline instance.
Graph a simple representation of the scheduled items.
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. |
The Timeline instance.
Returns the current options event.
Get or set the TempoClock.
// Using the add method
(
c = TempoClock(5);
t = Timeline.new(clock: c, options:(mode: \beats, quant: 1));
t.add(2, {"test 1".postln});
t.add(4, {"test 2".postln});
t.add(9, {"test 3".postln});
);
t.play;
t.plot;
// Using an Array
(
t = Timeline.newFromArray(
[
1, {"test 1".postln},
2.5, {"test 2".postln},
3.5, {"test 3".postln}
])
);
t.play;
// Using a path
t = Timeline.newFromPath( PathName(CuePlayer.class.filenameSymbol.asString).parentPath +/+ "HelpSource/Classes/timeline" +/+ "t-score.scd" );
t.play;
// An Array or String can also be converted to a timeline.
t = (PathName(CuePlayer.class.filenameSymbol.asString).parentPath +/+ "HelpSource/Classes/timeline" +/+ "t-score.scd").asTimeline;
t.play;