Timeline Node
Generates a timeline position signal that can be started, paused, stopped, looped and reversed, for driving SynchronizedAudioPlayer and TimelineQuantizedTrigger nodes. Every output bus is stereo and carries the current timeline position in frames in its left channel, or 0 while the timeline is not playing. The number of output buses is set by numberOfOutputs.
Configuration
numberOfOutputs
Type: Int
Default: 4
The number of output audio buses, each carrying the same timeline position.
Properties
Inherits properties from its parents, Node, SwitchboardObject.
bpm
Type: Int
Default: 0
Unit: BPM
Tempo in beats per minute, used only to size quantized loops set with the loop action. Fractional values are truncated to whole numbers. Must be set before using a quantized loop.
position (Read only)
Type: Float
The current timeline position in seconds. Use the setPosition action to jump to a different position. Not meaningful until the graph has started.
Actions
Inherits actions from its parent, SwitchboardObject.
loop
Enables or disables looping. When enabled, the position jumps back to the loop start whenever it reaches the loop end. The loop is given either by start and end, or by quantization and length to fit it to the beat grid set by bpm. Takes effect at the start of the next audio buffer.
Parameters
| Name | Type | Description |
|---|---|---|
enabled | Boolean | true to enable looping, false to disable it. The other parameters are ignored when false. |
end (Optional) | Float | Loop end in seconds. Required when enabling the loop without quantization. |
length (Optional) | Float | Loop length as a number of 4-beat bars. Required when quantization is given. |
quantization (Optional) | Float | Grid the loop start snaps to, as a fraction of a 4-beat bar (0.25 is one beat). When given, start and end are ignored and the loop starts on the grid line that puts the current position inside the loop, so looping takes effect without waiting a whole loop length. |
start (Optional) | Float | Loop start in seconds. Required when enabling the loop without quantization. |
Return Value
Boolean — Always true.
pause
Pauses the timeline at the start of the next audio buffer, keeping the current position.
Parameters
None.
Return Value
Boolean — Always true.
reverse
Sets the direction of the timeline at the start of the next audio buffer. In reverse the position counts down and can go below 0.
Parameters
| Name | Type | Description |
|---|---|---|
enabled | Boolean | true to play backwards, false to play forwards. |
Return Value
Boolean — Always true.
setPosition
Jumps to a new position at the start of the next audio buffer, without changing whether the timeline is playing. Only works once the graph has started, because the position is converted to frames at the graph's sample rate.
Parameters
| Name | Type | Description |
|---|---|---|
position | Float | The new position in seconds. |
Return Value
Boolean — Always true.
start
Starts or resumes the timeline from the current position at the start of the next audio buffer.
Parameters
None.