Source / Sound synthesis
dssi.register
Register a DSSI plugin.
Type:
(string) -> unit
Arguments:
(unlabeled)(of typestring): Path of the DSSI plugin file.
synth.all.saw
Saw synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.01): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.(unlabeled)(of typesource(midi=midi(channels=16), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
synth.all.sine
Sine synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.01): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.(unlabeled)(of typesource(midi=midi(channels=16), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
synth.all.square
Square synthesizer. It creates one synthesizer for each channel.
Type:
(?id : string?, ?attack : float, ?decay : float, ?envelope : bool,
?release : float, ?sustain : float, source(midi=midi(channels=16), 'a)) ->
source(midi=midi(channels=16), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.01): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.(unlabeled)(of typesource(midi=midi(channels=16), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
synth.saw
Saw synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).channel(of typeint, which defaults to0): MIDI channel to handle.decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.05): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.volume(of typefloat, which defaults to0.3): Initial volume.(unlabeled)(of typesource(midi=midi(channels=1), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
synth.sine
Sine synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).channel(of typeint, which defaults to0): MIDI channel to handle.decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.05): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.volume(of typefloat, which defaults to0.3): Initial volume.(unlabeled)(of typesource(midi=midi(channels=1), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready
synth.square
Square synthesizer.
Type:
(?id : string?, ?attack : float, ?channel : int, ?decay : float,
?envelope : bool, ?release : float, ?sustain : float, ?volume : float,
source(midi=midi(channels=1), 'a)) -> source(midi=midi(channels=1), 'a)
Arguments:
id(of typestring?, which defaults tonull): Force the value of the source ID.attack(of typefloat, which defaults to0.02): Envelope attack (in seconds).channel(of typeint, which defaults to0): MIDI channel to handle.decay(of typefloat, which defaults to0.01): Envelope decay (in seconds).envelope(of typebool, which defaults totrue): Use envelope.release(of typefloat, which defaults to0.05): Envelope release (in seconds).sustain(of typefloat, which defaults to0.9): Envelope sustain level.volume(of typefloat, which defaults to0.3): Initial volume.(unlabeled)(of typesource(midi=midi(channels=1), 'a))
Methods:
buffered(of type() -> [string * float]): Length of buffered data.clock(of typeclock): The source's clockduration(of type() -> float): Estimation of the duration of the current track.elapsed(of type() -> float): Elapsed time in the current track.fallible(of typebool): Indicate if a source may fail, i.e. may not be ready to stream.generate_frame(of type() -> unit): Generate a frame from the source without consuming it. This can be useful in advanced cases where generating a frame is required to trigger some side effect like calculating some metadata before making a decision. You should make sure that the source is available before calling this function and it should only be called inside synchronous streaming loop callback such ason_frame!id(of type() -> string): Identifier of the source.insert_metadata(of type(?new_track : bool, [string * string]) -> unit): Dynamically insert metadata in a stream. Inserts a new track with the given metadata ifnew_trackistrue.is_active(of type() -> bool):trueif the source is active, i.e. it is continuously animated by its own clock whenever it is ready. Typically,truefor outputs and sources such asinput.http.is_ready(of type() -> bool): Indicate if a source is ready to stream. This does not mean that the source is currently streaming, just that its resources are all properly initialized.is_up(of type() -> bool): Indicate that the source can be asked to produce some data at any time. This istruewhen the source is currently being used or if it could be used at any time, typically inside aswitchorfallback.last_metadata(of type() -> [string * string]?): Return the last metadata from the source.log(of type{level : (() -> int).{set : (int) -> unit}}): Get or set the source's log level, from1to5.register_command(of type(?usage : string?, description : string, string, ((string) -> string)) -> unit): Register a server command for this source. Command is registered under the source's id namespace when it gets up and de-registered when it gets down.remaining(of type() -> float): Estimation of remaining time in the current track.reset_last_metadata_on_track(of type(() -> bool).{set : (bool) -> unit}): Iftrue, the source'slast_metadatais reset on each new track. If a metadata is present along with the track mark, then it becomes the newlast_metadata, otherwise,last_metadata becomesnull`.seek(of type(float) -> float): Seek forward, in seconds (returns the amount of time effectively seeked).self_sync(of type() -> bool): Is the source currently controlling its own real-time loop.self_sync_description(of type() -> string)skip(of type() -> unit): Skip to the next track.time(of type() -> float): Get a source's time, based on its assigned clock.
Callbacks:
on_frame(of type(?before : bool, synchronous : bool, (() -> unit)) -> unit): Call a given handler on frame. Whenbeforeistrue, callback is executed before computing the frame and after otherwiseon_frame_checksum(of type(?before : ((string?) -> unit)?, synchronous : bool, ((cache : string?, string) -> unit)) -> unit): Call a given handler Register callbacks to compute frame checksums for debugging purposes. This is useful to track frame content changes through the streaming pipeline. Thebeforecallback is called before computing the frame with the checksum of the cached frame (if any,nullotherwise). The main callback is called after computing the frame with the checksum of the generated frame and the remaining cache (if any).on_metadata(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler to execute on each metadataon_position(of type(position : {float}, ?remaining : bool, ?allow_partial : bool, synchronous : bool, ((float, [string * string]) -> unit)) -> unit): Call a given handler on track position. Ifremainingisfalse, callback is executed when position in track is more or equal toposition. Ifremainingistrue, callback is executed when remaining time in the current track is less or equal toposition. Keep in mind that elapsed time is exact while remaining time is always estimated. Remaining time is usually more accurate for file-based sources. Whenallow_partialistrue, if the current track ends before theoffsetposition is reached, callback is still executedon_shutdown(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called when source shuts downon_track(of type(synchronous : bool, (([string * string]) -> unit)) -> unit): Call a given handler on track markson_wake_up(of type(synchronous : bool, (() -> unit)) -> unit): Call a given handler to be called after the source is asked to get ready