tecs.audio.timeline#
Overview#
Functions#
newfunction#
function(
clock: function(): number,
options: Options?,
player: (function(sound: any, options: any, at: number): integer)?
): TimelineCreates a timeline over a clock.
The mixer makes these, through Audio.timeline, and runs their update from its own. A timeline made here directly has to be updated by its maker.
Arguments#
clock-function(): number- reads the audio clock in seconds
options-Options?- the tempo, bar length, lookahead and start, or nil
player-(function(sound: any, options: any, at: number): integer)?
Returns#
Timeline-
the timeline, running unless
options.paused
Raises#
| Type | Condition |
|---|---|
string |
when the tempo is not positive and finite |
Types#
Cuerecord#
record CueA handle on an event, to cancel it before it is sent.
Members#
settledfield#
settled: booleanRead-only. Reports whether the event has gone to the backend, or been cancelled, so cancel would do nothing.
handlefield#
handle: integerRead-only. The voice a play cue started once it was sent, zero before then and for a start the mixer refused.
cancelmethod#
function(exclusive self: Cue): booleanArguments#
exclusive self-Cue
Returns#
boolean
Optionstype#
type Options = {
tempo: number?,
beatsPerBar: integer?,
lookahead: number?,
start: number?,
paused: boolean?
}Configures a timeline.
Members#
fields
tempofield#
tempo: number?Caller-writable. Beats a minute, 60 by default, so a beat is a second.
beatsPerBarfield#
beatsPerBar: integer?Caller-writable. Beats in a bar, four by default, for nextBar.
lookaheadfield#
lookahead: number?Caller-writable. Seconds ahead events are sent, 0.05 by default.
startfield#
start: number?Caller-writable. The beat the timeline starts at, zero by default.
pausedfield#
paused: boolean?Caller-writable. Starts the timeline paused.
Timelinerecord#
record TimelineLocal time with a tempo and a pause, mapped onto the audio clock.
Members#
nowmethod#
function(borrows self: Timeline): numberArguments#
borrows self-Timeline
Returns#
number
toClockmethod#
function(borrows self: Timeline, beat: number): numberArguments#
borrows self-Timelinebeat-number
Returns#
number
fromClockmethod#
function(borrows self: Timeline, seconds: number): numberArguments#
borrows self-Timelineseconds-number
Returns#
number
tempomethod#
function(borrows self: Timeline): numberArguments#
borrows self-Timeline
Returns#
number
setTempomethod#
function(exclusive self: Timeline, beatsPerMinute: number)Arguments#
exclusive self-TimelinebeatsPerMinute-number
beatsPerBarmethod#
function(borrows self: Timeline): integerArguments#
borrows self-Timeline
Returns#
integer
nextBeatmethod#
function(borrows self: Timeline): numberArguments#
borrows self-Timeline
Returns#
number
nextBarmethod#
function(borrows self: Timeline): numberArguments#
borrows self-Timeline
Returns#
number
pausemethod#
function(exclusive self: Timeline)Arguments#
exclusive self-Timeline
resumemethod#
function(exclusive self: Timeline)Arguments#
exclusive self-Timeline
pausedmethod#
function(borrows self: Timeline): booleanArguments#
borrows self-Timeline
Returns#
boolean
seekmethod#
function(exclusive self: Timeline, beat: number)Arguments#
exclusive self-Timelinebeat-number
followmethod#
function(exclusive self: Timeline, held: (function(): boolean)?)Arguments#
exclusive self-Timelineheld-(function(): boolean)?
atmethod#
function(
exclusive self: Timeline,
beat: number,
run: function(at: number): nil
): CueArguments#
exclusive self-Timelinebeat-numberrun-function(at: number): nil
Returns#
playmethod#
function(exclusive self: Timeline, sound: any, options: {[string]: any}?): CueArguments#
exclusive self-Timelinesound-anyoptions-{[string]: any}?
Returns#
pendingmethod#
function(borrows self: Timeline): integerArguments#
borrows self-Timeline
Returns#
integer
upcomingmethod#
function(borrows self: Timeline, limit: integer?): {number}Arguments#
borrows self-Timelinelimit-integer?
Returns#
{number}
updatemethod#
function(exclusive self: Timeline): booleanArguments#
exclusive self-Timeline
Returns#
boolean
closemethod#
function(exclusive self: Timeline)Arguments#
exclusive self-Timeline
closedStatemethod#
function(borrows self: Timeline): booleanArguments#
borrows self-Timeline
Returns#
boolean
Values#
LOOKAHEADvariable#
const LOOKAHEAD: numberSeconds of lookahead a timeline schedules by default.