title: Language reference

h3. Liquidsoap scripting language reference

h4. Categories

The **Source / ...** categories contain all functions that return sources.
The **Input** functions are those which build elementary sources
(playing files, synthesizing sound, etc.).
The **Output** functions are those which take a source and register it
for being streamed to the outside (file, soundcard, audio server, etc.).
The **Visualization** functions are experimental ones that let you 
visualize in real-time some aspects of the audio stream.
The **Sound Processing** functions are those which basically work on the source 
as a continuous audio stream. They would typically be mixers of streams,
audio effects or analysis.
Finally, **Track Processing** functions are basically all 
others, often having a behaviour that depends on or affects the extra 
information that liquidsoap puts in streams: track limits and metadata.

* "Source / Conversions":#SourceConversions
* "Source / Input":#SourceInput
* "Source / MIDI Processing":#SourceMIDIProcessing
* "Source / Output":#SourceOutput
* "Source / Sound Processing":#SourceSoundProcessing
* "Source / Sound Synthesis":#SourceSoundSynthesis
* "Source / Track Processing":#SourceTrackProcessing
* "Source / Video Processing":#SourceVideoProcessing
* "Source / Visualization":#SourceVisualization
* "Bool":#Bool
* "Control":#Control
* "Interaction":#Interaction
* "Liquidsoap":#Liquidsoap
* "List":#List
* "Math":#Math
* "String":#String
* "System":#System
* "Uncategorized":#Uncategorized


h4@SourceConversions. Source / Conversions
h5. audio_to_stereo
<pre>(?id:string, source(audio=*+1,video=0,midi=0))
 ->source(audio=2,video=0,midi=0)</pre>

Convert any kind of audio source into a stereo source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=*+1,video=0,midi=0)</code>)

h5. drop_audio
<pre>(?id:string, source(audio='a,video='b,midi='c))
 ->source(audio=0,video='b,midi='c)</pre>

Drop all audio channels of a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c)</code>)

h5. drop_midi
<pre>(?id:string, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi=0)</pre>

Drop all midi channels of a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c)</code>)

h5. drop_video
<pre>(?id:string, source(audio='a,video='b,midi='c))
 ->source(audio='a,video=0,midi='c)</pre>

Drop all video channels of a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c)</code>)

h5. mux_audio
<pre>(?id:string, ~audio:source(audio='a,video=0,midi=0),
 source(audio=0,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Add audio channnels to a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>audio</code> (<code>source(audio='a,video=0,midi=0) where 'a is a fixed arity type</code>)
* <code>(unlabeled)</code> (<code>source(audio=0,video='b,midi='c) where 'b, 'c is a fixed arity type</code>)

h5. mux_video
<pre>(?id:string, ~video:source(audio=0,video='a,midi=0),
 source(audio='b,video=0,midi='c))
 ->source(audio='b,video='a,midi='c) where 'b, 'a, 'c is a fixed arity type</pre>

Add video channnels to a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>video</code> (<code>source(audio=0,video='a,midi=0) where 'a is a fixed arity type</code>)
* <code>(unlabeled)</code> (<code>source(audio='b,video=0,midi='c) where 'b, 'c is a fixed arity type</code>)



h4@SourceInput. Source / Input
h5. blank
<pre>(?id:string, ?duration:float)->source('a)</pre>

Produce silence and blank images.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>): Duration of blank tracks in seconds, default means forever.

h5. dolebrai
<pre>()
 ->source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</pre>

Relay the audio stream of Dolebraï, a libre music netradio running liquidsoap.


h5. empty
<pre>(?id:string)->source(audio='a,video='b,midi='c)</pre>

A source that does not produce anything. No silence, no track at all.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.

h5. fail
<pre>()->source('a)</pre>

Creates a source that fails to produce anything.


h5. in
<pre>()
 ->source(audio='a+1,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Create a source from the first available input driver in this list:
  portaudio, alsa, oss, blank


h5. input.alsa
<pre>(?id:string, ?bufferize:bool, ?clock_safe:bool,
 ?device:string)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Stream from an ALSA input device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>bufferize</code> (<code>bool</code> -- defaults to <code>true</code>): Bufferize input
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated ALSA clock
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;default&quot;</code>): Alsa device to use

h5. input.external
<pre>(?id:string, ?buffer:float, ?max:float,
 ?channels:int, ?samplerate:int, ?restart:bool,
 ?restart_on_error:bool, string)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Stream data from an external application.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>buffer</code> (<code>float</code> -- defaults to <code>2.</code>): Duration of the pre-buffered data.
* <code>max</code> (<code>float</code> -- defaults to <code>10.</code>): Maximum duration of the buffered data.
* <code>channels</code> (<code>int</code> -- defaults to <code>2</code>): Number of channels.
* <code>samplerate</code> (<code>int</code> -- defaults to <code>44100</code>): Samplerate.
* <code>restart</code> (<code>bool</code> -- defaults to <code>true</code>): Restart process when exited.
* <code>restart_on_error</code> (<code>bool</code> -- defaults to <code>false</code>): Restart process when exited with error.
* <code>(unlabeled)</code> (<code>string</code>): Command to execute.

h5. input.harbor
<pre>(?id:string, ?buffer:float, ?max:float,
 ?on_connect:(([(string*string)])->unit),
 ?on_disconnect:(()->unit), ?user:string,
 ?password:string, ?port:int, ?auth:((string,
 string)->bool), ?dumpfile:string, ?logfile:string,
 ?debug:bool, string)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Retrieves the given http stream from the harbor.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>buffer</code> (<code>float</code> -- defaults to <code>2.</code>): Duration of the pre-buffered data.
* <code>max</code> (<code>float</code> -- defaults to <code>10.</code>): Maximum duration of the buffered data.
* <code>on_connect</code> (<code>([(string*string)])-&gt;unit</code> -- defaults to <code>{()}</code>): Function to execute when a source is connected. Its receives the list of headers, of the form: (<label>,<value>). All labels are lowercase.
* <code>on_disconnect</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Functions to excecute when a source is disconnected
* <code>user</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Source user. Override default if not empty.
* <code>password</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Source password. Override default if not empty.
* <code>port</code> (<code>int</code> -- defaults to <code>-1</code>): Port used to connect to the source. Harbor default if negative.
* <code>auth</code> (<code>(string, string)-&gt;bool</code> -- defaults to <code>{false}</code>): Authentication function. <code>f(login,password)</code> returns <code>true</code> if the user should be granted access for this login. Override any other method if used.
* <code>dumpfile</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Dump stream to file, for debugging purpose. Disabled if empty.
* <code>logfile</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Log buffer status to file, for debugging purpose. Disabled if empty.
* <code>debug</code> (<code>bool</code> -- defaults to <code>false</code>): Run in debugging mode by not catching some exceptions.
* <code>(unlabeled)</code> (<code>string</code>): Mountpoint to look for.

h5. input.http
<pre>(?id:string, ?autostart:bool, ?bind_address:string,
 ?buffer:float, ?timeout:float,
 ?new_track_on_metadata:bool, ?force_mime:string,
 ?playlist_mode:string, ?poll_delay:float,
 ?max:float, ?logfile:string, ?debug:bool,
 ?user_agent:string, string)
 ->source(audio='a,video='b,midi=0) where 'a, 'b is a fixed arity type</pre>

Forwards the given http stream. The relay can be paused/resumed using the start/stop telnet commands.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>autostart</code> (<code>bool</code> -- defaults to <code>true</code>): Initially start relaying or not.
* <code>bind_address</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Address to bind on the local machine. This option can be useful if your machine is bound to multiple IPs. Empty means no bind address.
* <code>buffer</code> (<code>float</code> -- defaults to <code>2.</code>): Duration of the pre-buffered data.
* <code>timeout</code> (<code>float</code> -- defaults to <code>10.</code>): Timeout for http connection.
* <code>new_track_on_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Treat new metadata as new track.
* <code>force_mime</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force mime data type. Not used if empty.
* <code>playlist_mode</code> (<code>string</code> -- defaults to <code>&quot;normal&quot;</code>): Valid modes are "normal", "random", "randomize" and "first". The first ones have the same meaning as for the mode parameter of the playlist operator. The last one discards all entries but the first one.
* <code>poll_delay</code> (<code>float</code> -- defaults to <code>2.</code>): Polling delay when trying to connect to the stream.
* <code>max</code> (<code>float</code> -- defaults to <code>10.</code>): Maximum duration of the buffered data.
* <code>logfile</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Log buffer status to file, for debugging purpose. Disabled if empty.
* <code>debug</code> (<code>bool</code> -- defaults to <code>false</code>): Run in debugging mode, not catching some exceptions.
* <code>user_agent</code> (<code>string</code> -- defaults to <code>&quot;liquidsoap/1.0.0-beta1 (Unix; ocaml 3.11.2)&quot;</code>): User agent.
* <code>(unlabeled)</code> (<code>string</code>): URL of an http stream (default port is 80).

h5. input.jack
<pre>(?id:string, ?clock_safe:bool, ?buffer_size:int,
 ?server:string)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Get stream from jack.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated bjack clock.
* <code>buffer_size</code> (<code>int</code> -- defaults to <code>2</code>): Set buffer size, in frames. Must be >= 1.
* <code>server</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Jack server to connect to.

h5. input.jack.legacy
<pre>(?id:string, ?clock_safe:bool, ?ports:[string])
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>
WARNING: This is DEPRECATED!

Deprecated jack input.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated Jack clock
* <code>ports</code> (<code>[string]</code> -- defaults to <code>[&quot;input_0&quot;, &quot;input_1&quot;]</code>): Port names.

h5. input.keyboard.sdl
<pre>(?id:string, ?velocity:float)
 ->source(audio='a,video=0,midi='b+1) where 'a, 'b is a fixed arity type</pre>
WARNING: This is only EXPERIMENTAL!

Play notes from the keyboard.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>velocity</code> (<code>float</code> -- defaults to <code>0.8</code>): Velocity of notes.

h5. input.lastfm
<pre>(?id:string, ?autostart:bool, ?buffer:float,
 ?bind_address:string, ?timeout:float,
 ?poll_delay:float, ?new_track_on_metadata:bool,
 ?debug:bool, ?max:float, ?user_agent:string,
 ~user:string, ~password:string, string)
 ->source(audio=2,video=0,midi=0)</pre>

Forwards the given lastfm stream. The relay can be paused/resumed using the start/stop telnet commands.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>autostart</code> (<code>bool</code> -- defaults to <code>true</code>): Initially start relaying or not.
* <code>buffer</code> (<code>float</code> -- defaults to <code>10.</code>): Duration of the pre-buffered data.
* <code>bind_address</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Address to bind on the local machine. This option can be useful if your machine is bound to multiple IPs. "" means no bind address.
* <code>timeout</code> (<code>float</code> -- defaults to <code>10.</code>): Timeout for HTTP connections.
* <code>poll_delay</code> (<code>float</code> -- defaults to <code>2.</code>): Polling delay.
* <code>new_track_on_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Treat new metadata as new track.
* <code>debug</code> (<code>bool</code> -- defaults to <code>false</code>): Run in debugging mode by not catching some exceptions.
* <code>max</code> (<code>float</code> -- defaults to <code>25.</code>): Maximum duration of the buffered data.
* <code>user_agent</code> (<code>string</code> -- defaults to <code>&quot;liquidsoap/1.0.0-beta1 (Unix; ocaml 3.11.2)&quot;</code>): User agent.
* <code>user</code> (<code>string</code>): Lastfm user.
* <code>password</code> (<code>string</code>): Lastfm password.
* <code>(unlabeled)</code> (<code>string</code>): URI of a lastfm  stream (e.g. lastfm://user/toots5446/playlist).

h5. input.oss
<pre>(?id:string, ?clock_safe:bool, ?device:string)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Stream from an OSS input device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated OSS clock.
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;/dev/dsp&quot;</code>): OSS device to use.

h5. input.portaudio
<pre>(?id:string, ?clock_safe:bool, ?buflen:int)
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Stream from a portaudio input device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force teh use of the dedicated Portaudio clock.
* <code>buflen</code> (<code>int</code> -- defaults to <code>256</code>): Length of a buffer in samples.

h5. input.pulseaudio
<pre>(?id:string, ?client:string, ?device:string,
 ?clock_safe:bool)
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Stream from a portaudio input device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>client</code> (<code>string</code> -- defaults to <code>&quot;liquidsoap&quot;</code>)
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Device to use. Uses default if set to "".
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated Pulseaudio clock.

h5. mksafe
<pre>(source('a))->source('a)</pre>

Turn a source into an infaillible source.
by adding blank when the source is not available.

* <code>(unlabeled)</code> (<code>source('a)</code>): the source to turn infaillible

h5. noise
<pre>(?id:string, ?duration:float)
 ->source(audio='a,video='b,midi=0)</pre>

Generate white noise.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>)

h5. playlist
<pre>(?id:string, ?length:float, ?default_duration:float,
 ?conservative:bool, ?timeout:float, ?mode:string,
 ?reload:int, ?reload_mode:string,
 ?mime_type:string, ?prefix:string, ?timeout:float,
 string)->source('a)</pre>

Loop on a playlist of URIs.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>length</code> (<code>float</code> -- defaults to <code>10.</code>): How much audio (in sec.) should be queued in advance.
* <code>default_duration</code> (<code>float</code> -- defaults to <code>30.</code>): When unknown, assume this duration (in sec.) for files.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): If true, estimated remaining time on the current track is not considered when computing queue length.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in sec.) for a single download.
* <code>mode</code> (<code>string</code> -- defaults to <code>&quot;randomize&quot;</code>): Play the files in the playlist either in the order ("normal" mode), or shuffle the playlist each time it is loaded, and play it in this order for a whole round ("randomize" mode), or pick a random file in the playlist each time ("random" mode).
* <code>reload</code> (<code>int</code> -- defaults to <code>0</code>): Amount of time (in seconds or rounds) before which the playlist is reloaded; 0 means never.
* <code>reload_mode</code> (<code>string</code> -- defaults to <code>&quot;seconds&quot;</code>): Unit of the reload parameter, either 'rounds' or 'seconds'.
* <code>mime_type</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Default MIME type for the playlist. Empty string means automatic detection.
* <code>prefix</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Add a constant prefix to all requests. Useful for passing extra information using annotate, or for resolution through a particular protocol, such as replaygain.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in seconds) for a single download.
* <code>(unlabeled)</code> (<code>string</code>): URI where to find the playlist.

h5. playlist.once
<pre>(?random:bool, ?on_done:(()->unit), string)
 ->source('a)</pre>

Custom playlist source written using the script language.
Will read directory or playlist, play all files and stop

* <code>random</code> (<code>bool</code> -- defaults to <code>false</code>): Randomize playlist content
* <code>on_done</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Function to execute when the playlist is finished
* <code>(unlabeled)</code> (<code>string</code>): Playlist URI

h5. playlist.safe
<pre>(?id:string, ?mode:string, ?reload:int,
 ?reload_mode:string, ?mime_type:string,
 ?prefix:string, ?timeout:float, string)
 ->source('a)</pre>

Loop on a playlist of local files, and never fail. In order to do so, it has to check every file at the loading, so the streamer startup may take a few seconds. To avoid this, use a standard playlist, and put only a few local files in a default safe_playlist in order to ensure the liveness of the streamer.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>mode</code> (<code>string</code> -- defaults to <code>&quot;randomize&quot;</code>): Play the files in the playlist either in the order ("normal" mode), or shuffle the playlist each time it is loaded, and play it in this order for a whole round ("randomize" mode), or pick a random file in the playlist each time ("random" mode).
* <code>reload</code> (<code>int</code> -- defaults to <code>0</code>): Amount of time (in seconds or rounds) before which the playlist is reloaded; 0 means never.
* <code>reload_mode</code> (<code>string</code> -- defaults to <code>&quot;seconds&quot;</code>): Unit of the reload parameter, either 'rounds' or 'seconds'.
* <code>mime_type</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Default MIME type for the playlist. Empty string means automatic detection.
* <code>prefix</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Add a constant prefix to all requests. Useful for passing extra information using annotate, or for resolution through a particular protocol, such as replaygain.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in seconds) for a single download.
* <code>(unlabeled)</code> (<code>string</code>): URI where to find the playlist.

h5. request.dynamic
<pre>(?id:string, (()->request('a)), ?length:float,
 ?default_duration:float, ?conservative:bool,
 ?timeout:float)->source('a)</pre>

Play request dynamically created by a given function.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>()-&gt;request('a)</code>)
* <code>length</code> (<code>float</code> -- defaults to <code>10.</code>): How much audio (in sec.) should be queued in advance.
* <code>default_duration</code> (<code>float</code> -- defaults to <code>30.</code>): When unknown, assume this duration (in sec.) for files.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): If true, estimated remaining time on the current track is not considered when computing queue length.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in sec.) for a single download.

h5. request.equeue
<pre>(?id:string, ?length:float, ?default_duration:float,
 ?conservative:bool, ?timeout:float)->source('a)</pre>

Receive URIs from users, and play them. Insertion and deletion possible at any position.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>length</code> (<code>float</code> -- defaults to <code>10.</code>): How much audio (in sec.) should be queued in advance.
* <code>default_duration</code> (<code>float</code> -- defaults to <code>30.</code>): When unknown, assume this duration (in sec.) for files.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): If true, estimated remaining time on the current track is not considered when computing queue length.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in sec.) for a single download.

h5. request.queue
<pre>(?id:string, ?queue:[request('a)],
 ?interactive:bool, ?length:float,
 ?default_duration:float, ?conservative:bool,
 ?timeout:float)->source('a)</pre>

Receive URIs from users, and play them.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>queue</code> (<code>[request('a)]</code> -- defaults to <code>[]</code>): Initial queue of requests.
* <code>interactive</code> (<code>bool</code> -- defaults to <code>true</code>): Should the queue be controllable via telnet?
* <code>length</code> (<code>float</code> -- defaults to <code>10.</code>): How much audio (in sec.) should be queued in advance.
* <code>default_duration</code> (<code>float</code> -- defaults to <code>30.</code>): When unknown, assume this duration (in sec.) for files.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): If true, estimated remaining time on the current track is not considered when computing queue length.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in sec.) for a single download.

h5. saw
<pre>(?id:string, ?duration:float, ?float)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Generate a saw wave.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>)
* <code>(unlabeled)</code> (<code>float</code> -- defaults to <code>440.</code>): Frequency of the saw.

h5. sine
<pre>(?id:string, ?duration:float, ?float)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Generate a sine wave.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>)
* <code>(unlabeled)</code> (<code>float</code> -- defaults to <code>440.</code>): Frequency of the sine.

h5. single
<pre>(?id:string, string, ?length:float,
 ?default_duration:float, ?conservative:bool,
 ?timeout:float)->source('a)</pre>

Loop on a request. It never fails if the request is static, meaning that it can be fetched once. Typically, http, ftp, say requests are static, and time is not.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>string</code>): URI where to find the file
* <code>length</code> (<code>float</code> -- defaults to <code>10.</code>): How much audio (in sec.) should be queued in advance.
* <code>default_duration</code> (<code>float</code> -- defaults to <code>30.</code>): When unknown, assume this duration (in sec.) for files.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): If true, estimated remaining time on the current track is not considered when computing queue length.
* <code>timeout</code> (<code>float</code> -- defaults to <code>20.</code>): Timeout (in sec.) for a single download.

h5. square
<pre>(?id:string, ?duration:float, ?float)
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Generate a square wave.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>)
* <code>(unlabeled)</code> (<code>float</code> -- defaults to <code>440.</code>): Frequency of the square.

h5. video.add_image
<pre>(?id:string, ?width:int, ?height:int, ?x:int,
 ?y:int, ?alpha:int, ?duration:float, ?file:string,
 ?metadata:string,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Add a static image on the first video channel. The image can be changed based on metadata.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>width</code> (<code>int</code> -- defaults to <code>-1</code>): Scale to width (negative means original width).
* <code>height</code> (<code>int</code> -- defaults to <code>-1</code>): Scale to width (negative means original height).
* <code>x</code> (<code>int</code> -- defaults to <code>0</code>): x position (negative means from right).
* <code>y</code> (<code>int</code> -- defaults to <code>0</code>): y position (negative means from bottom).
* <code>alpha</code> (<code>int</code> -- defaults to <code>-1</code>): Color to convert to alpha (in 0xRRGGBB format, negative means no alpha).
* <code>duration</code> (<code>float</code> -- defaults to <code>0.</code>)
* <code>file</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Path to image file.
* <code>metadata</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Metadata on which file name should be read (empty means disabled).
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.add_text
<pre>(?id:string, ?font:string, ?size:int, ?color:int,
 ?x:int, ?y:int, ?speed:int, ?cycle:bool,
 ?metadata:string, 'a,
 source(audio='b,video='c+1,midi='d))->source(audio='b,video='c+1,midi='d) where 'b,
 'c, 'd is a fixed arity type,
 'a is either string or ()->string</pre>

Display a text.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>font</code> (<code>string</code> -- defaults to <code>&quot;/usr/share/fonts/truetype/msttcorefonts/Arial.ttf&quot;</code>): Path to ttf font file.
* <code>size</code> (<code>int</code> -- defaults to <code>18</code>): Font size.
* <code>color</code> (<code>int</code> -- defaults to <code>16777215</code>): Text color (in 0xRRGGBB format).
* <code>x</code> (<code>int</code> -- defaults to <code>320</code>): x offset.
* <code>y</code> (<code>int</code> -- defaults to <code>-5</code>): y offset (negative means from bottom).
* <code>speed</code> (<code>int</code> -- defaults to <code>70</code>): Speed in pixels per second (0 means no scrolling).
* <code>cycle</code> (<code>bool</code> -- defaults to <code>true</code>): Cycle text.
* <code>metadata</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Change text on a particular metadata (empty string means disabled).
* <code>(unlabeled)</code> (<code>anything that is either string or ()-&gt;string</code>): Text to display.
* <code>(unlabeled)</code> (<code>source(audio='b,video='c+1,midi='d) where 'b, 'c, 'd is a fixed arity type</code>)



h4@SourceMIDIProcessing. Source / MIDI Processing
h5. midi.chord
<pre>(?id:string, ?metadata:string,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Generate a chord.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>metadata</code> (<code>string</code> -- defaults to <code>&quot;chord&quot;</code>): Name of the metadata containing the chords.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. midi.merge_all
<pre>(?id:string, ?track_out:int,
 source(audio='a,video='b,midi='c+1))
 ->source(audio='a,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Merge all MIDI tracks in one.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>track_out</code> (<code>int</code> -- defaults to <code>0</code>): Destination track.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)

h5. midi.remove
<pre>(?id:string, [int],
 source(audio='a,video='b,midi='c+1))
 ->source(audio='a,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Remove MIDI tracks.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>[int]</code>): Tracks to remove.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)



h4@SourceOutput. Source / Output
h5. buffer
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, ?buffer:float,
 ?max:float, source('a))->source('a)</pre>

Create a buffer between two different clocks.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>buffer</code> (<code>float</code> -- defaults to <code>1.</code>): Amount of data to pre-buffer, in seconds.
* <code>max</code> (<code>float</code> -- defaults to <code>10.</code>): Maximum amount of buffered data, in seconds.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. clock
<pre>(?id:string, ?sync:bool, source('a))->source('a)</pre>

Forces a source and other time-dependent sources to belong to a new clock that runs indepently of others.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>sync</code> (<code>bool</code> -- defaults to <code>true</code>): Do not synchronize the clock on regular wallclock time, but try to run as fast as possible (CPU burning mode).
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. out
<pre>(source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Output a stream using the 'output.prefered' operator. The input source does
not need to be infallible, blank will just be played during failures.

* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</code>): the source to output

h5. output.alsa
<pre>(?id:string, ?bufferize:bool, ?clock_safe:bool,
 ?device:string,
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Output the source's stream to an ALSA output device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>bufferize</code> (<code>bool</code> -- defaults to <code>true</code>): Bufferize output
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated ALSA clock
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;default&quot;</code>): Alsa device to use
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.ao
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, ?clock_safe:bool,
 ?driver:string, ?channels_matrix:string,
 ?buffer_size:int, ?options:[(string*string)],
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Output stream to local sound card using libao.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Use the dedicated AO clock.
* <code>driver</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Driver to be used, "" for AO's default.
* <code>channels_matrix</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Output channels matrix, "" for AO's default.
* <code>buffer_size</code> (<code>int</code> -- defaults to <code>2</code>): Set buffer size, in frames.
* <code>options</code> (<code>[(string*string)]</code> -- defaults to <code>[]</code>): List of parameters, depends on the driver.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.dummy
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, source('a))
 ->source('a)</pre>

Dummy output for debugging purposes.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. output.file
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, ?append:bool,
 ?perm:int, ?dir_perm:int, ?reopen_delay:float,
 ?reopen_on_metadata:bool, ?reopen_when:(()->bool),
 format('a), string, source('a))->source('a)</pre>

Output the source stream in a file.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>append</code> (<code>bool</code> -- defaults to <code>false</code>): Do not truncate but append in the file if it exists.
* <code>perm</code> (<code>int</code> -- defaults to <code>438</code>): Permission of the file if it has to be created, up to umask. You can and should write this number in octal notation: 0oXXX. The default value is however displayed in decimal (0o666 = 6*8^2 + 6*8 + 6 = 438).
* <code>dir_perm</code> (<code>int</code> -- defaults to <code>511</code>): Permission of the directories if some have to be created, up to umask. Although you can enter values in octal notation (0oXXX) they will be displayed in decimal (for instance, 0o777 = 7*8^2 + 7*8 + 7 = 511).
* <code>reopen_delay</code> (<code>float</code> -- defaults to <code>120.</code>): Prevent re-opening of the file within that delay, in seconds.
* <code>reopen_on_metadata</code> (<code>bool</code> -- defaults to <code>false</code>): Re-open on every new metadata information.
* <code>reopen_when</code> (<code>()-&gt;bool</code> -- defaults to <code>{false}</code>): When should the output file be re-opened.
* <code>(unlabeled)</code> (<code>format('a)</code>): Encoding format.
* <code>(unlabeled)</code> (<code>string</code>): Filename where to output the stream. Some strftime conversion specifiers are available: <code>%SMHdmY</code>. You can also use <code>$(..)</code> interpolation notation for metadata.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. output.graphics
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool,
 source(audio=0,video=1,midi=0))
 ->source(audio=0,video=1,midi=0)</pre>

Display video stream using the Graphics library.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>(unlabeled)</code> (<code>source(audio=0,video=1,midi=0)</code>)

h5. output.icecast
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, ?restart:bool,
 ?restart_delay:int, ?mount:string, ?name:string,
 ?protocol:string, ?host:string, ?port:int,
 ?user:string, ?password:string, ?genre:string,
 ?url:string, ?description:string,
 ?on_connect:(()->unit), ?on_disconnect:(()->unit),
 ?public:bool, ?headers:[(string*string)],
 ?icy_metadata:string, ?format:string,
 ?dumpfile:string, format('a), source('a))
 ->source('a)</pre>

Encode and output the stream to an icecast2 or shoutcast server.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>restart</code> (<code>bool</code> -- defaults to <code>false</code>): Restart output after a failure. By default, liquidsoap will stop if the output failed.
* <code>restart_delay</code> (<code>int</code> -- defaults to <code>3</code>): Delay, in seconds, before attempting new connection, if restart is enabled.
* <code>mount</code> (<code>string</code> -- defaults to <code>&quot;Use [name] with .ogg extension if relevant&quot;</code>)
* <code>name</code> (<code>string</code> -- defaults to <code>&quot;Use [mount]&quot;</code>)
* <code>protocol</code> (<code>string</code> -- defaults to <code>&quot;http&quot;</code>): Protocol of the streaming server: 'http' for Icecast, 'icy' for shoutcast.
* <code>host</code> (<code>string</code> -- defaults to <code>&quot;localhost&quot;</code>)
* <code>port</code> (<code>int</code> -- defaults to <code>8000</code>)
* <code>user</code> (<code>string</code> -- defaults to <code>&quot;source&quot;</code>): User for shout source connection. Useful only in special cases, like with per-mountpoint users.
* <code>password</code> (<code>string</code> -- defaults to <code>&quot;hackme&quot;</code>)
* <code>genre</code> (<code>string</code> -- defaults to <code>&quot;Misc&quot;</code>)
* <code>url</code> (<code>string</code> -- defaults to <code>&quot;&quot;http://savonet.sf.net&quot;:http://savonet.sf.net&quot;</code>)
* <code>description</code> (<code>string</code> -- defaults to <code>&quot;OCaml Radio!&quot;</code>)
* <code>on_connect</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when connection is established.
* <code>on_disconnect</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when connection stops.
* <code>public</code> (<code>bool</code> -- defaults to <code>true</code>)
* <code>headers</code> (<code>[(string*string)]</code> -- defaults to <code>[(&quot;User-Agent&quot;,&quot;liquidsoap 1.0.0-beta1&quot;)]</code>): Additional headers.
* <code>icy_metadata</code> (<code>string</code> -- defaults to <code>&quot;guess&quot;</code>): Send new metadata using the ICY protocol. One of: "guess", "true", "false"
* <code>format</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Format, e.g. "audio/ogg". When empty, the encoder is used to guess.
* <code>dumpfile</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Dump stream to file, for debugging purpose. Disabled if empty.
* <code>(unlabeled)</code> (<code>format('a)</code>): Encoding format.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. output.jack
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool, ?clock_safe:bool,
 ?buffer_size:int, ?server:string,
 source(audio='a+1,video=0,midi=0))
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Output stream to jack.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated bjack clock.
* <code>buffer_size</code> (<code>int</code> -- defaults to <code>2</code>): Set buffer size, in frames.
* <code>server</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Jack server to connect to.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>)

h5. output.jack.legacy
<pre>(?id:string, ?clock_safe:bool, ?ports:[string],
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>
WARNING: This is DEPRECATED!

Deprecated jack output.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated Jack clock
* <code>ports</code> (<code>[string]</code> -- defaults to <code>[&quot;output_0&quot;, &quot;output_1&quot;]</code>): Port names.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.oss
<pre>(?id:string, ?clock_safe:bool, ?device:string,
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Output the source's stream to an OSS output device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated OSS clock.
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;/dev/dsp&quot;</code>): OSS device to use.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.portaudio
<pre>(?id:string, ?clock_safe:bool, ?buflen:int,
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Output the source's stream to a portaudio output device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force teh use of the dedicated Portaudio clock.
* <code>buflen</code> (<code>int</code> -- defaults to <code>256</code>): Length of a buffer in samples.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.prefered
<pre>(?id:string, source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Output to local audio card using the first available driver in this list:
  ao, pulseaudio, alsa, oss, dummy

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</code>)

h5. output.pulseaudio
<pre>(?id:string, ?client:string, ?device:string,
 ?clock_safe:bool,
 source(audio='a+1,video='b,midi='c))
 ->source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Output the source's stream to a portaudio output device.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>client</code> (<code>string</code> -- defaults to <code>&quot;liquidsoap&quot;</code>)
* <code>device</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Device to use. Uses default if set to "".
* <code>clock_safe</code> (<code>bool</code> -- defaults to <code>true</code>): Force the use of the dedicated Pulseaudio clock.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. output.sdl
<pre>(?id:string, ?fallible:bool, ?on_start:(()->unit),
 ?on_stop:(()->unit), ?start:bool,
 source(audio=0,video=1,midi=0))
 ->source(audio=0,video=1,midi=0)</pre>

Display a video using SDL.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>fallible</code> (<code>bool</code> -- defaults to <code>false</code>): Allow the child source to fail, in which case the output will be (temporarily) stopped.
* <code>on_start</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting starts.
* <code>on_stop</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Callback executed when outputting stops.
* <code>start</code> (<code>bool</code> -- defaults to <code>true</code>): Automatically start outputting whenever possible. If true, an infallible (normal) output will start outputting as soon as it is created, and a fallible output will (re)start as soon as its source becomes available for streaming.
* <code>(unlabeled)</code> (<code>source(audio=0,video=1,midi=0)</code>)



h4@SourceSoundProcessing. Source / Sound Processing
h5. add
<pre>(?id:string, ?normalize:bool, ?weights:[int],
 [source(audio='a,video='b,midi=0)])
 ->source(audio='a,video='b,midi=0) where 'a, 'b is a fixed arity type</pre>

Mix sources, with optional normalization. Only relay metadata from the first source that is effectively summed.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>normalize</code> (<code>bool</code> -- defaults to <code>true</code>)
* <code>weights</code> (<code>[int]</code> -- defaults to <code>[]</code>): Relative weight of the sources in the sum. The empty list stands for the homogeneous distribution.
* <code>(unlabeled)</code> (<code>[source(audio='a,video='b,midi=0)] where 'a, 'b is a fixed arity type</code>)

h5. amplify
<pre>(?id:string, 'a, ?override:string,
 source(audio='b,video='c,midi='d))->source(audio='b,video='c,midi='d) where 'b,
 'c, 'd is a fixed arity type,
 'a is either float or ()->float</pre>

Multiply the amplitude of the signal.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>anything that is either float or ()-&gt;float</code>): Multiplicative factor.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_amplify&quot;</code>): Specify the name of a metadata field that, when present and well-formed, overrides the amplification factor for the current track. Well-formed values are floats in decimal notation (e.g. '0.7') which are taken as normal/linear multiplicative factors; values can be passed in decibels with the suffix 'dB' (e.g. '-8.2 dB', but the spaces do not matter).
* <code>(unlabeled)</code> (<code>source(audio='b,video='c,midi='d) where 'b, 'c, 'd is a fixed arity type</code>)

h5. bpm
<pre>(?id:string, ?every:int,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>
WARNING: This is only EXPERIMENTAL!

Detect the BPM.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>every</code> (<code>int</code> -- defaults to <code>500</code>)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. clip
<pre>(?id:string, ?min:float, ?max:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Clip sound.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>min</code> (<code>float</code> -- defaults to <code>-0.999</code>): Minimal acceptable value.
* <code>max</code> (<code>float</code> -- defaults to <code>0.999</code>): Maximal acceptable value.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. comb
<pre>(?id:string, ?delay:float, ?feedback:'a,
 source(audio='b,video='c,midi='d))->source(audio='b,video='c,midi='d) where 'b,
 'c, 'd is a fixed arity type,
 'a is either float or ()->float</pre>

Comb filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>delay</code> (<code>float</code> -- defaults to <code>0.001</code>): Delay in seconds.
* <code>feedback</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-6.</code>): Feedback coefficient in dB.
* <code>(unlabeled)</code> (<code>source(audio='b,video='c,midi='d) where 'b, 'c, 'd is a fixed arity type</code>)

h5. compand
<pre>(?id:string, ?mu:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Compand the signal

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>mu</code> (<code>float</code> -- defaults to <code>1.</code>)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. compress
<pre>(?id:string, ?ratio:float, ?attack:'a, ?release:'b,
 ?threshold:'c, ?knee:'d, ?rms_window:float,
 ?gain:'e,
 source(audio='f,video='g,midi='h))->source(audio='f,video='g,midi='h) where 'f,
 'g, 'h is a fixed arity type, 'c, 'b, 'a, 'e,
 'd is either float or ()->float</pre>

Compress the signal.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>ratio</code> (<code>float</code> -- defaults to <code>2.</code>): Gain reduction ratio (n:1).
* <code>attack</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>100.</code>): Attack time (ms).
* <code>release</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>400.</code>): Release time (ms).
* <code>threshold</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-10.</code>): Threshold level (dB).
* <code>knee</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>): Knee radius (dB).
* <code>rms_window</code> (<code>float</code> -- defaults to <code>0.1</code>): Window for computing RMS (in sec).
* <code>gain</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.</code>): Additional gain (dB).
* <code>(unlabeled)</code> (<code>source(audio='f,video='g,midi='h) where 'f, 'g, 'h is a fixed arity type</code>)

h5. compress.exponential
<pre>(?id:string, ?mu:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Exponential compressor.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>mu</code> (<code>float</code> -- defaults to <code>2.</code>): Exponential compression factor, typically greater than 1.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. cross
<pre>(?id:string, ?duration:float, ?override:string,
 ?inhibit:float, ?minimum:float, ?conservative:bool,
 ?active:bool, ((source('a),
 source('a))->source('a)), source('a))->source('a)</pre>

Generic cross operator, allowing the composition of the N last seconds of a track with the beginning of the next track.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>5.</code>): Duration in seconds of the crossed end of track. This value can be changed on a per-file basis using a special metadata field.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_start_next&quot;</code>): Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
* <code>inhibit</code> (<code>float</code> -- defaults to <code>-1.</code>): Minimum delay between two transitions. It is useful in order to avoid that a transition is triggered on top of another when an end-of-track occurs in the first one. Negative values mean <code>duration+1</code>. Warning: zero inhibition can cause infinite loops.
* <code>minimum</code> (<code>float</code> -- defaults to <code>-1.</code>): Minimum duration (in sec.) for a cross: If the track ends without any warning (e.g. in case of skip) there may not be enough data for a decent composition. Set to 0. to avoid having transitions after skips, or more to avoid transitions on short tracks. With the negative default, transitions always occur.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): Do not trust remaining time estimations, always buffering data in advance. This avoids being tricked by skips, either manual or caused by skip_blank().
* <code>active</code> (<code>bool</code> -- defaults to <code>false</code>): The active behavior is to keep ticking the child's clock when the operator is not streaming. Otherwise the child's clock is strictly based on what is streamed off the child source, which results in time-dependent active sources to be frozen when that source is stopped.
* <code>(unlabeled)</code> (<code>(source('a), source('a))-&gt;source('a)</code>): Composition of an end of track and the next track.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. echo
<pre>(?id:string, ?delay:float, ?feedback:'a,
 source(audio='b,video='c,midi='d))->source(audio='b,video='c,midi='d) where 'b,
 'c, 'd is a fixed arity type,
 'a is either float or ()->float</pre>

Add echo.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>delay</code> (<code>float</code> -- defaults to <code>0.5</code>): Delay in seconds.
* <code>feedback</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-6.</code>): Feedback coefficient in dB (negative).
* <code>(unlabeled)</code> (<code>source(audio='b,video='c,midi='d) where 'b, 'c, 'd is a fixed arity type</code>)

h5. fade.final
<pre>(?id:string, ?duration:float, ?type:string,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade a stream to silence.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. fade.in
<pre>(?id:string, ?override:string, ?duration:float,
 ?type:string, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the beginning of tracks. A special override metadata field can be used to set the duration for a specific track (float in seconds).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_fade_in&quot;</code>): Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. fade.initial
<pre>(?id:string, ?duration:float, ?type:string,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the beginning of a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. fade.out
<pre>(?id:string, ?override:string, ?duration:float,
 ?type:string, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the end of tracks. A special override metadata field can be used to set the duration for a specific track (float in seconds).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_fade_out&quot;</code>): Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter
<pre>(?id:string, ~freq:'a, ?q:'b, ~mode:string,
 ?wetness:'c,
 source(audio='d,video='e,midi='f))->source(audio='d,video='e,midi='f) where 'd,
 'e, 'f is a fixed arity type, 'c, 'b,
 'a is either float or ()->float</pre>

Perform several kinds of filtering on the signal

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>freq</code> (<code>anything that is either float or ()-&gt;float</code>)
* <code>q</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>)
* <code>mode</code> (<code>string</code>): Available modes are 'low', 'high', 'band' and 'notch'.
* <code>wetness</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>): How much of the original signal should be added (1. means only filtered and 0. means only original signal).
* <code>(unlabeled)</code> (<code>source(audio='d,video='e,midi='f) where 'd, 'e, 'f is a fixed arity type</code>)

h5. filter.fir
<pre>(?id:string, ~frequency:float, ~beta:float,
 ?coeffs:int, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Low-pass FIR filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency in Hz (frequency at which the response is 0.5, that is -6 dB).
* <code>beta</code> (<code>float</code>): Beta should range between 0 and 1.
* <code>coeffs</code> (<code>int</code> -- defaults to <code>255</code>): Number of coefficients
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.butterworth.bandpass
<pre>(?id:string, ~frequency1:float, ~frequency2:float,
 ?order:int, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency1</code> (<code>float</code>): First corner frequency
* <code>frequency2</code> (<code>float</code>): Second corner frequency
* <code>order</code> (<code>int</code> -- defaults to <code>4</code>): Filter order
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.butterworth.bandstop
<pre>(?id:string, ~frequency1:float, ~frequency2:float,
 ?order:int, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency1</code> (<code>float</code>): First corner frequency
* <code>frequency2</code> (<code>float</code>): Second corner frequency
* <code>order</code> (<code>int</code> -- defaults to <code>4</code>): Filter order
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.butterworth.high
<pre>(?id:string, ~frequency:float, ?order:int,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>order</code> (<code>int</code> -- defaults to <code>4</code>): Filter order
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.butterworth.low
<pre>(?id:string, ~frequency:float, ?order:int,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>order</code> (<code>int</code> -- defaults to <code>4</code>): Filter order
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.allpass
<pre>(?id:string, ~frequency:float, ?bandwidth:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

All pass biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Center frequency
* <code>bandwidth</code> (<code>float</code> -- defaults to <code>0.333333333333</code>): Bandwidth (in octaves)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.bandpass
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Band pass biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Center frequency
* <code>q</code> (<code>float</code> -- defaults to <code>1.</code>): Q
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.high
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

High pass biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>q</code> (<code>float</code> -- defaults to <code>1.</code>): Q
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.highshelf
<pre>(?id:string, ~frequency:float, ?slope:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

High shelf biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Center frequency
* <code>slope</code> (<code>float</code> -- defaults to <code>1.</code>): Shelf slope (in dB/octave)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.low
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Low pass biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>q</code> (<code>float</code> -- defaults to <code>1.</code>): Q
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.lowshelf
<pre>(?id:string, ~frequency:float, ?slope:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Low shelf biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>slope</code> (<code>float</code> -- defaults to <code>1.</code>): Shelf slope (dB/octave)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.notch
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Band pass biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Center frequency
* <code>q</code> (<code>float</code> -- defaults to <code>1.</code>): Q
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.eq.peak
<pre>(?id:string, ~frequency:float, ?q:float,
 ?gain:float, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Peak EQ biquad filter.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Center frequency
* <code>q</code> (<code>float</code> -- defaults to <code>1.</code>): Q
* <code>gain</code> (<code>float</code> -- defaults to <code>1.</code>): Gain (in dB)
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.resonator.allpass
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>q</code> (<code>float</code> -- defaults to <code>60.</code>): Quality factor
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.resonator.bandpass
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>q</code> (<code>float</code> -- defaults to <code>60.</code>): Quality factor
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. filter.iir.resonator.bandstop
<pre>(?id:string, ~frequency:float, ?q:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

IIR filter

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>frequency</code> (<code>float</code>): Corner frequency
* <code>q</code> (<code>float</code> -- defaults to <code>60.</code>): Quality factor
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. flanger
<pre>(?id:string, ?delay:float, ?freq:'a, ?feedback:'b,
 ?phase:'c,
 source(audio='d,video='e,midi='f))->source(audio='d,video='e,midi='f) where 'd,
 'e, 'f is a fixed arity type, 'c, 'b,
 'a is either float or ()->float</pre>

Flanger effect.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>delay</code> (<code>float</code> -- defaults to <code>0.001</code>): Delay in seconds.
* <code>freq</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.5</code>): Frequency in Hz.
* <code>feedback</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.</code>): Feedback coefficient in dB.
* <code>phase</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>): Phase difference between channels in radians.
* <code>(unlabeled)</code> (<code>source(audio='d,video='e,midi='f) where 'd, 'e, 'f is a fixed arity type</code>)

h5. helium
<pre>(source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Increases the pitch, making voices sound like on helium.

* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</code>): The input source.

h5. id
<pre>(?id:string, source('a))->source('a)</pre>

Does not do anything.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. id.empty
<pre>(?id:string, source(audio=0,video=0,midi=0))
 ->source(audio=0,video=0,midi=0)</pre>

Does not do anything, but forces the stream type of the input source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=0,video=0,midi=0)</code>)

h5. id.mono
<pre>(?id:string, source(audio=1,video=0,midi=0))
 ->source(audio=1,video=0,midi=0)</pre>

Does not do anything, but forces the stream type of the input source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=1,video=0,midi=0)</code>)

h5. id.stereo
<pre>(?id:string, source(audio=2,video=0,midi=0))
 ->source(audio=2,video=0,midi=0)</pre>

Does not do anything, but forces the stream type of the input source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=2,video=0,midi=0)</code>)

h5. id.video_only
<pre>(?id:string, source(audio=0,video=1,midi=0))
 ->source(audio=0,video=1,midi=0)</pre>

Does not do anything, but forces the stream type of the input source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=0,video=1,midi=0)</code>)

h5. insert_metadata
<pre>(?id:string, source('a))->source('a)</pre>

Interactively insert metadata using the command <code>ID.insert key1="val1",key2="val2",...</code>.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. limit
<pre>(?id:string, ?ratio:float, ?attack:'a, ?release:'b,
 ?threshold:'c, ?knee:'d, ?rms_window:float,
 ?gain:'e,
 source(audio='f,video='g,midi='h))->source(audio='f,video='g,midi='h) where 'f,
 'g, 'h is a fixed arity type, 'c, 'b, 'a, 'e,
 'd is either float or ()->float</pre>

Limit the signal.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>ratio</code> (<code>float</code> -- defaults to <code>20.</code>): Gain reduction ratio (n:1).
* <code>attack</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>100.</code>): Attack time (ms).
* <code>release</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>400.</code>): Release time (ms).
* <code>threshold</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-10.</code>): Threshold level (dB).
* <code>knee</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>): Knee radius (dB).
* <code>rms_window</code> (<code>float</code> -- defaults to <code>0.1</code>): Window for computing RMS (in sec).
* <code>gain</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.</code>): Additional gain (dB).
* <code>(unlabeled)</code> (<code>source(audio='f,video='g,midi='h) where 'f, 'g, 'h is a fixed arity type</code>)

h5. mean
<pre>(?id:string, source(audio='a,video='b,midi='c))
 ->source(audio=1,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Produce mono audio by taking the mean of all audio channels.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. mic_filter
<pre>(source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Remove low frequencies often produced by microphones.

* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</code>): The input source.

h5. mix
<pre>(?id:string, [source(audio='a,video='b,midi='c)])
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Mixing table controllable via the telnet interface.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>[source(audio='a,video='b,midi='c)] where 'a, 'b, 'c is a fixed arity type</code>)

h5. normalize
<pre>(?id:string, ?target:'a, ?window:float, ?k_up:'b,
 ?k_down:'c, ?threshold:'d, ?gain_min:'e,
 ?gain_max:'f,
 source(audio='g,video='h,midi='i))->source(audio='g,video='h,midi='i) where 'g,
 'h, 'i is a fixed arity type, 'c, 'b, 'a, 'e, 'd,
 'f is either float or ()->float</pre>

Normalize the signal. Dynamic normalization of the signal is sometimes the only option, and can make a listening experience much nicer. However, its dynamic aspect implies some limitations which can go as far as creating saturation in some extreme cases. If possible, consider using some track-based normalization techniques such as those based on replay gain. See the documentation for more details.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>target</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-13.</code>): Desired RMS (dB).
* <code>window</code> (<code>float</code> -- defaults to <code>0.1</code>): Duration of the window used to compute the current RMS power (second).
* <code>k_up</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.005</code>): Coefficient when the power must go up (between 0 and 1, slowest to fastest).
* <code>k_down</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.1</code>): Coefficient when the power must go down (between 0 and 1, slowest to fastest).
* <code>threshold</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-40.</code>): Minimal RMS for activaing gain control (dB).
* <code>gain_min</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>-6.</code>): Minimal gain value (dB).
* <code>gain_max</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>6.</code>): Maximal gain value (dB).
* <code>(unlabeled)</code> (<code>source(audio='g,video='h,midi='i) where 'g, 'h, 'i is a fixed arity type</code>)

h5. nrj
<pre>(source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</pre>

Compress and normalize, producing a more uniform and "full" sound.

* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'c, 'b, 'a is a fixed arity type</code>): The input source.

h5. sky
<pre>(source(audio='a,video='b,midi=0))
 ->source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</pre>

Multiband-compression.

* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</code>): The input source.

h5. smart_cross
<pre>(?id:string, ?duration:float, ?inhibit:float,
 ?minimum:float, ?width:float, ?conservative:bool,
 ?active:bool, ((float, float, [(string*string)],
 [(string*string)],
 source(audio='a+1,video=0,midi=0),
 source(audio='a+1,video=0,midi=0))->source(audio='a+1,video=0,midi=0)),
 source(audio='a+1,video=0,midi=0))
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Cross operator, allowing the composition of the N last seconds of a track with the beginning of the next track, using a transition function depending on the relative power of the signal before and after the end of track.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>5.</code>): Duration in seconds of the crossed end of track.
* <code>inhibit</code> (<code>float</code> -- defaults to <code>-1.</code>): Minimum delay between two transitions. It is useful in order to avoid that a transition is triggered on top of another when an end-of-track occurs in the first one. Negative values mean <code>duration+1</code>. Warning: zero inhibition can cause infinite loops.
* <code>minimum</code> (<code>float</code> -- defaults to <code>-1.</code>): Minimum duration (in sec.) for a cross: If the track ends without any warning (e.g. in case of skip) there may not be enough data for a decent composition. Set to 0. to avoid having transitions after skips, or more to avoid transitions on short tracks. With the negative default, transitions always occur.
* <code>width</code> (<code>float</code> -- defaults to <code>1.</code>): Width of the power computation window.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): Do not trust remaining time estimations, always buffering data in advance. This avoids being tricked by skips, either manual or caused by skip_blank().
* <code>active</code> (<code>bool</code> -- defaults to <code>false</code>): The active behavior is to keep ticking the child's clock when the operator is not streaming. Otherwise the child's clock is strictly based on what is streamed off the child source, which results in time-dependent active sources to be frozen when that source is stopped.
* <code>(unlabeled)</code> (<code>(float, float, [(string*string)], [(string*string)], source(audio='a+1,video=0,midi=0), source(audio='a+1,video=0,midi=0))-&gt;source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>): Transition function, composing from the end of a track and the next track. It also takes the power of the signal before and after the transition, and the metadata.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>)

h5. soundtouch
<pre>(?id:string, ?rate:'a, ?tempo:'b, ?pitch:'c,
 source(audio='d,video='e,midi='f))->source(audio='d,video='e,midi='f) where 'd,
 'e, 'f is a fixed arity type, 'c, 'b,
 'a is either float or ()->float</pre>
WARNING: This is only EXPERIMENTAL!

Change the rate, the tempo or the pitch of the sound.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>rate</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>)
* <code>tempo</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>)
* <code>pitch</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>1.</code>)
* <code>(unlabeled)</code> (<code>source(audio='d,video='e,midi='f) where 'd, 'e, 'f is a fixed arity type</code>)

h5. stereo.ms.decode
<pre>(?id:string, ?width:float,
 source(audio=2,video=0,midi=0))
 ->source(audio=2,video=0,midi=0)</pre>

Decode mid+side stereo (M/S) to left+right stereo.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>width</code> (<code>float</code> -- defaults to <code>1.</code>): Width of the stereo field.
* <code>(unlabeled)</code> (<code>source(audio=2,video=0,midi=0)</code>)

h5. stereo.ms.encode
<pre>(?id:string, source(audio=2,video=0,midi=0))
 ->source(audio=2,video=0,midi=0)</pre>

Encode left+right stereo to mid+side stereo (M/S).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=2,video=0,midi=0)</code>)

h5. stereo.pan
<pre>(?id:string, ?pan:'a, ?field:'b,
 source(audio=2,video=0,midi=0))->source(audio=2,video=0,midi=0) where 'b,
 'a is either float or ()->float</pre>

Pan a stereo sound.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>pan</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>0.</code>): Pan ranges between -1 and 1.
* <code>field</code> (<code>anything that is either float or ()-&gt;float</code> -- defaults to <code>90.</code>): Field width in degrees (between 0 and 90).
* <code>(unlabeled)</code> (<code>source(audio=2,video=0,midi=0)</code>)

h5. stretch
<pre>(?id:string, ~ratio:'a, ?active:bool,
 source(audio='b+1,video=0,midi=0))->source(audio='c+1,video=0,midi=0) where 'c,
 'b is a fixed arity type, 'a is either float or ()
 ->float</pre>

Slow down or accelerate an audio stream by stretching (sounds lower) or squeezing it (sounds higher).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>ratio</code> (<code>anything that is either float or ()-&gt;float</code>): A value higher than 1 means slowing down.
* <code>active</code> (<code>bool</code> -- defaults to <code>true</code>): The active behavior is to keep ticking the child's clock when the operator is not streaming. Otherwise the child's clock is strictly based on what is streamed off the child source, which results in time-dependent active sources to be frozen when that source is stopped.
* <code>(unlabeled)</code> (<code>source(audio='b+1,video=0,midi=0) where 'b is a fixed arity type</code>)

h5. swap
<pre>(?id:string, source(audio=2,video=0,midi=0))
 ->source(audio=2,video=0,midi=0)</pre>

Swap two channels of a stereo source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio=2,video=0,midi=0)</code>)



h4@SourceSoundSynthesis. Source / Sound Synthesis
h5. synth.all.hammond
<pre>(?id:string, ?envelope:bool, ?attack:float,
 ?decay:float, ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+16))
 ->source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</pre>

Hammond synthsizer. It creates one synthesizer for each channel.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.all.saw
<pre>(?id:string, ?envelope:bool, ?attack:float,
 ?decay:float, ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+16))
 ->source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</pre>

Saw synthesizer. It creates one synthesizer for each channel.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.all.sine
<pre>(?id:string, ?envelope:bool, ?attack:float,
 ?decay:float, ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+16))
 ->source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</pre>

Sine synthesizer. It creates one synthesizer for each channel.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.all.square
<pre>(?id:string, ?envelope:bool, ?attack:float,
 ?decay:float, ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+16))
 ->source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</pre>

Square synthesizer. It creates one synthesizer for each channel.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+16) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.hammond
<pre>(?id:string, ?channel:int, ?volume:float,
 ?envelope:bool, ?attack:float, ?decay:float,
 ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+1))
 ->source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Hammond synthsizer.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>channel</code> (<code>int</code> -- defaults to <code>0</code>): MIDI channel to handle.
* <code>volume</code> (<code>float</code> -- defaults to <code>0.3</code>): Initial volume.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.05</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.saw
<pre>(?id:string, ?channel:int, ?volume:float,
 ?envelope:bool, ?attack:float, ?decay:float,
 ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+1))
 ->source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Saw synthesizer.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>channel</code> (<code>int</code> -- defaults to <code>0</code>): MIDI channel to handle.
* <code>volume</code> (<code>float</code> -- defaults to <code>0.3</code>): Initial volume.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.05</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.sine
<pre>(?id:string, ?channel:int, ?volume:float,
 ?envelope:bool, ?attack:float, ?decay:float,
 ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+1))
 ->source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Sine synthesizer.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>channel</code> (<code>int</code> -- defaults to <code>0</code>): MIDI channel to handle.
* <code>volume</code> (<code>float</code> -- defaults to <code>0.3</code>): Initial volume.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.05</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)

h5. synth.square
<pre>(?id:string, ?channel:int, ?volume:float,
 ?envelope:bool, ?attack:float, ?decay:float,
 ?sustain:float, ?release:float,
 source(audio='a+1,video='b,midi='c+1))
 ->source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</pre>

Square synthesizer.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>channel</code> (<code>int</code> -- defaults to <code>0</code>): MIDI channel to handle.
* <code>volume</code> (<code>float</code> -- defaults to <code>0.3</code>): Initial volume.
* <code>envelope</code> (<code>bool</code> -- defaults to <code>true</code>): Use envelope.
* <code>attack</code> (<code>float</code> -- defaults to <code>0.02</code>): Envelope attack (in seconds).
* <code>decay</code> (<code>float</code> -- defaults to <code>0.01</code>): Envelope decay (in seconds).
* <code>sustain</code> (<code>float</code> -- defaults to <code>0.9</code>): Envelope sustain level.
* <code>release</code> (<code>float</code> -- defaults to <code>0.05</code>): Envelope release (in seconds).
* <code>(unlabeled)</code> (<code>source(audio='a+1,video='b,midi='c+1) where 'a, 'b, 'c is a fixed arity type</code>)



h4@SourceTrackProcessing. Source / Track Processing
h5. append
<pre>(?id:string, ?merge:bool, ?insert_missing:bool,
 source('a), (([(string*string)])->source('a)))
 ->source('a)</pre>

Append an extra track to every track. Set the metadata 'liq_append' to 'false' to inhibit appending on one track.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>merge</code> (<code>bool</code> -- defaults to <code>false</code>): Merge the track with its appended track.
* <code>insert_missing</code> (<code>bool</code> -- defaults to <code>true</code>): Treat track beginnings without metadata as having empty one.
* <code>(unlabeled)</code> (<code>source('a)</code>)
* <code>(unlabeled)</code> (<code>([(string*string)])-&gt;source('a)</code>): Given the metadata, build the source producing the track to append. This source is allowed to fail (produce nothing) if no relevant track is to be appended.

h5. at
<pre>((()->bool), source('a))->source('a)</pre>

Restrict a source to play only when a predicate is true.

* <code>(unlabeled)</code> (<code>()-&gt;bool</code>): The predicate, typically a time interval such as <code>{10h-10h30}</code>.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. clear_metadata
<pre>(source('a))->source('a)</pre>

Removes all metadata coming from a source

* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. crossfade
<pre>(?id:string, ~start_next:float, ~fade_in:float,
 ~fade_out:float, source(audio='a,video='b,midi=0))
 ->source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</pre>

Simple crossfade.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>start_next</code> (<code>float</code>): Duration in seconds of the crossed end of track.
* <code>fade_in</code> (<code>float</code>): Duration of the fade in for next track
* <code>fade_out</code> (<code>float</code>): Duration of the fade out for previous track
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</code>): The source to use

h5. delay
<pre>(?id:string, float, source('a))->source('a)</pre>

Prevents the child from being ready again too fast after a end of track

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>float</code>): The source won't be ready less than this amount of seconds after any end of track
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. eat_blank
<pre>(?id:string, ?at_beginning:bool, ?threshold:float,
 ?length:float, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Eat blanks, i.e., drop the contents of the stream until it is not blank anymore.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>at_beginning</code> (<code>bool</code> -- defaults to <code>false</code>): Only eat at the beginning of a track.
* <code>threshold</code> (<code>float</code> -- defaults to <code>-40.</code>): Power in decibels under which the stream is considered silent.
* <code>length</code> (<code>float</code> -- defaults to <code>20.</code>): Maximum silence length allowed, in seconds.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. fallback
<pre>(?id:string, ?track_sensitive:bool,
 ?replay_metadata:bool, ?transitions:[(source('a),
 source('a))->source('a)], [source('a)])
 ->source('a)</pre>

At the beginning of each track, select the first ready child.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>track_sensitive</code> (<code>bool</code> -- defaults to <code>true</code>): Re-select only on end of tracks.
* <code>replay_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Replay the last metadata of a child when switching to it in the middle of a track.
* <code>transitions</code> (<code>[(source('a), source('a))-&gt;source('a)]</code> -- defaults to <code>[]</code>): Transition functions, padded with <code>fun (x,y) -> y</code> functions.
* <code>(unlabeled)</code> (<code>[source('a)]</code>): Select the first ready source in this list.

h5. fallback.skip
<pre>(~input:source('a), source('a))->source('a)</pre>

Special track insensitive fallback that
always skip current song before switching.

* <code>input</code> (<code>source('a)</code>): The input source
* <code>(unlabeled)</code> (<code>source('a)</code>): The fallback source

h5. map_metadata
<pre>(?id:string,
 (([(string*string)])->[(string*string)]),
 ?update:bool, ?strip:bool, ?insert_missing:bool,
 source('a))->source('a)</pre>

Rewrite metadata on the fly using a function.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>([(string*string)])-&gt;[(string*string)]</code>): A function that returns new metadata.
* <code>update</code> (<code>bool</code> -- defaults to <code>true</code>): Only update metadata. If false, only returned values will be set as metadata.
* <code>strip</code> (<code>bool</code> -- defaults to <code>false</code>): Completely remove empty metadata. Operates on both empty values and empty metadata chunk.
* <code>insert_missing</code> (<code>bool</code> -- defaults to <code>true</code>): Treat track beginnings without metadata as having empty ones. The operational order is: create empty if needed, map and strip if enabled.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. on_blank
<pre>(?id:string, (()->unit), ?on_noise:(()->unit),
 ?threshold:float, ?length:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Calls a given handler when detecting a blank.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>()-&gt;unit</code>): Handler called when blank is detected.
* <code>on_noise</code> (<code>()-&gt;unit</code> -- defaults to <code>{()}</code>): Handler called when noise is detected.
* <code>threshold</code> (<code>float</code> -- defaults to <code>-40.</code>): Power in decibels under which the stream is considered silent.
* <code>length</code> (<code>float</code> -- defaults to <code>20.</code>): Maximum silence length allowed, in seconds.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. on_end
<pre>(?id:string, ?delay:float, ((float,
 [(string*string)])->unit), source('a))->source('a)</pre>

Call a given handler when there is less than a given amount of time remaining before then end of track.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>delay</code> (<code>float</code> -- defaults to <code>5.</code>): Execute handler when remaining time is less or equal to this value.
* <code>(unlabeled)</code> (<code>(float, [(string*string)])-&gt;unit</code>): Function to execute. First argument is the remaining time, second is the latest metadata.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. on_metadata
<pre>(?id:string, (([(string*string)])->unit),
 source('a))->source('a)</pre>

Call a given handler on metadata packets.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>([(string*string)])-&gt;unit</code>): Function called on every metadata packet in the stream. It should be fast because it is ran in the main thread.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. on_track
<pre>(?id:string, (([(string*string)])->unit),
 source('a))->source('a)</pre>

Call a given handler on new tracks.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>([(string*string)])-&gt;unit</code>): Function called on every beginning of track in the stream, with the corresponding metadata as argument. If there is no metadata at the beginning of track, the empty list is passed. That function should be fast because it is ran in the main thread.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. once
<pre>(source('a))->source('a)</pre>

Creates a source that plays only one track of the input source.

* <code>(unlabeled)</code> (<code>source('a)</code>): The input source.

h5. prepend
<pre>(?id:string, ?merge:bool,
 source(audio='a,video='b,midi='c),
 (([(string*string)])->source(audio='a,video='b,midi='c)))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Prepend an extra track before every track. Set the metadata 'liq_prepend' to 'false' to inhibit prepending on one track.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>merge</code> (<code>bool</code> -- defaults to <code>false</code>): Merge the track with its appended track.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)
* <code>(unlabeled)</code> (<code>([(string*string)])-&gt;source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>): Given the metadata, build the source producing the track to prepend. This source is allowed to fail (produce nothing) if no relevant track is to be appended. However, success must be immediate or it will not be taken into account.

h5. random
<pre>(?id:string, ?track_sensitive:bool,
 ?replay_metadata:bool, ?transitions:[(source('a),
 source('a))->source('a)], ?weights:[int],
 [source('a)])->source('a)</pre>

At the beginning of every track, select a random ready child.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>track_sensitive</code> (<code>bool</code> -- defaults to <code>true</code>): Re-select only on end of tracks.
* <code>replay_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Replay the last metadata of a child when switching to it in the middle of a track.
* <code>transitions</code> (<code>[(source('a), source('a))-&gt;source('a)]</code> -- defaults to <code>[]</code>): Transition functions, padded with <code>fun (x,y) -> y</code> functions.
* <code>weights</code> (<code>[int]</code> -- defaults to <code>[]</code>): Weights of the children (padded with 1), defining for each child the probability that it is selected.
* <code>(unlabeled)</code> (<code>[source('a)]</code>)

h5. rewrite_metadata
<pre>([(string*string)], ?insert_missing:bool,
 ?update:bool, ?strip:bool, source('a))->source('a)</pre>

Rewrite metadata on the fly using a list of (target,rules).

* <code>(unlabeled)</code> (<code>[(string*string)]</code>): List of (target,value) rewriting rules.
* <code>insert_missing</code> (<code>bool</code> -- defaults to <code>true</code>): Treat track beginnings without metadata as having empty ones. The operational order is: create empty if needed, map and strip if enabled.
* <code>update</code> (<code>bool</code> -- defaults to <code>true</code>): Only update metadata. If false, only returned values will be set as metadata.
* <code>strip</code> (<code>bool</code> -- defaults to <code>false</code>): Completly remove empty metadata. Operates on both empty values and empty metadata chunk.
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. rotate
<pre>(?id:string, ?track_sensitive:bool,
 ?replay_metadata:bool, ?transitions:[(source('a),
 source('a))->source('a)], ?weights:[int],
 [source('a)])->source('a)</pre>

Rotate between the sources.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>track_sensitive</code> (<code>bool</code> -- defaults to <code>true</code>): Re-select only on end of tracks.
* <code>replay_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Replay the last metadata of a child when switching to it in the middle of a track.
* <code>transitions</code> (<code>[(source('a), source('a))-&gt;source('a)]</code> -- defaults to <code>[]</code>): Transition functions, padded with <code>fun (x,y) -> y</code> functions.
* <code>weights</code> (<code>[int]</code> -- defaults to <code>[]</code>): Weights of the children (padded with 1), defining for each child how many tracks are played from it per round, if that many are actually available.
* <code>(unlabeled)</code> (<code>[source('a)]</code>)

h5. say_metadata
<pre>(source(?A), ?pattern:string)->source(?A)</pre>

Append speech-synthesized tracks reading the metadata.

* <code>(unlabeled)</code> (<code>source(?A)</code>): The source to use
* <code>pattern</code> (<code>string</code> -- defaults to <code>&quot;say:$(if $(artist),\&quot;It was $(artist)$(if $(title),\\\&quot;, $(title)\\\&quot;).\&quot;)&quot;</code>): Pattern to use

h5. sequence
<pre>(?id:string, ?merge:bool, [source('a)])->source('a)</pre>

Play only one track of every successive source, except for the last one which is played as much as available.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>merge</code> (<code>bool</code> -- defaults to <code>false</code>)
* <code>(unlabeled)</code> (<code>[source('a)]</code>)

h5. skip_blank
<pre>(?id:string, ?threshold:float, ?length:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Skip track when detecting a blank.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>threshold</code> (<code>float</code> -- defaults to <code>-40.</code>): Power in decibels under which the stream is considered silent.
* <code>length</code> (<code>float</code> -- defaults to <code>20.</code>): Maximum silence length allowed, in seconds.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. smart_crossfade
<pre>(?start_next:float, ?fade_in:float, ?fade_out:float,
 ?default:((source(audio='a+1,video=0,midi=0),
 source(audio='a+1,video=0,midi=0))->source(audio='a+1,video=0,midi=0)),
 ?high:float, ?medium:float, ?margin:float,
 ?width:float, ?conservative:bool,
 source(audio='a+1,video=0,midi=0))
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Crossfade between tracks, taking the respective volume levels into account in
the choice of the transition.

* <code>start_next</code> (<code>float</code> -- defaults to <code>5.</code>): Crossing duration, if any.
* <code>fade_in</code> (<code>float</code> -- defaults to <code>3.</code>): Fade-in duration, if any.
* <code>fade_out</code> (<code>float</code> -- defaults to <code>3.</code>): Fade-out duration, if any.
* <code>default</code> (<code>(source(audio='a+1,video=0,midi=0), source(audio='a+1,video=0,midi=0))-&gt;source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code> -- defaults to <code>&lt;fun&gt;</code>): Transition used when no rule applies (default: sequence).
* <code>high</code> (<code>float</code> -- defaults to <code>-15.</code>): Value, in dB, for loud sound level
* <code>medium</code> (<code>float</code> -- defaults to <code>-32.</code>): Value, in dB, for medium sound level
* <code>margin</code> (<code>float</code> -- defaults to <code>4.</code>): Margin to detect sources that have too different sound level for crossing.
* <code>width</code> (<code>float</code> -- defaults to <code>2.</code>): Width of the volume analysis window.
* <code>conservative</code> (<code>bool</code> -- defaults to <code>false</code>): Always prepare for a premature end-of-track.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>): The input source.

h5. smooth_add
<pre>(?delay:float, ?p:float,
 ~normal:source(audio='a,video='b,midi=0),
 ~special:source(audio='a,video='b,midi=0))
 ->source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</pre>

Mixes two streams, with faded transitions between the state when only the
normal stream is available and when the special stream gets added on top of
it.

* <code>delay</code> (<code>float</code> -- defaults to <code>0.5</code>): Delay before starting the special source.
* <code>p</code> (<code>float</code> -- defaults to <code>0.2</code>): Portion of amplitude of the normal source in the mix.
* <code>normal</code> (<code>source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</code>): The normal source, which could be called the carrier too.
* <code>special</code> (<code>source(audio='a,video='b,midi=0) where 'b, 'a is a fixed arity type</code>): The special source.

h5. source.dynamic
<pre>(?id:string, (()->[source('a)]))->source('a)</pre>

Dynamically change the underlying source.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>()-&gt;[source('a)]</code>)

h5. store_metadata
<pre>(?id:string, ?size:int, source('a))->source('a)</pre>

Keep track of the last N metadata packets in the stream, and make the history available via a server command.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>size</code> (<code>int</code> -- defaults to <code>10</code>): Size of the history
* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. strip_blank
<pre>(?id:string, ?threshold:float, ?length:float,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Make the source unavailable when it is streaming blank.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>threshold</code> (<code>float</code> -- defaults to <code>-40.</code>): Power in decibels under which the stream is considered silent.
* <code>length</code> (<code>float</code> -- defaults to <code>20.</code>): Maximum silence length allowed, in seconds.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. switch
<pre>(?id:string, ?track_sensitive:bool,
 ?replay_metadata:bool, ?transitions:[(source('a),
 source('a))->source('a)], ?single:[bool],
 [((()->bool)*source('a))])->source('a)</pre>

At the beginning of a track, select the first source
              whose predicate is true.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>track_sensitive</code> (<code>bool</code> -- defaults to <code>true</code>): Re-select only on end of tracks.
* <code>replay_metadata</code> (<code>bool</code> -- defaults to <code>true</code>): Replay the last metadata of a child when switching to it in the middle of a track.
* <code>transitions</code> (<code>[(source('a), source('a))-&gt;source('a)]</code> -- defaults to <code>[]</code>): Transition functions, padded with <code>fun (x,y) -> y</code> functions.
* <code>single</code> (<code>[bool]</code> -- defaults to <code>[]</code>): Forbid the selection of a branch for two tracks in a row. The empty list stands for <code>[false,...,false]</code>.
* <code>(unlabeled)</code> (<code>[((()-&gt;bool)*source('a))]</code>): Sources with the predicate telling when they can be played.



h4@SourceVideoProcessing. Source / Video Processing
h5. video.fade.final
<pre>(?id:string, ?duration:float, ?transition:string,
 ?type:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade a stream to black.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>transition</code> (<code>string</code> -- defaults to <code>&quot;fade&quot;</code>): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.fade.in
<pre>(?id:string, ?override:string, ?duration:float,
 ?transition:string, ?type:string,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the beginning of tracks. Metadata 'liq_video_fade_in' can be used to set the duration for a specific track (float in seconds).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_video_fade_in&quot;</code>): Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>transition</code> (<code>string</code> -- defaults to <code>&quot;fade&quot;</code>): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.fade.initial
<pre>(?id:string, ?duration:float, ?transition:string,
 ?type:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the beginning of a stream.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>transition</code> (<code>string</code> -- defaults to <code>&quot;fade&quot;</code>): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.fade.out
<pre>(?id:string, ?override:string, ?duration:float,
 ?transition:string, ?type:string,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fade the end of tracks. Metadata 'liq_video_fade_out' can be used to set the duration for a specific track (float in seconds).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>override</code> (<code>string</code> -- defaults to <code>&quot;liq_video_fade_out&quot;</code>): Metadata field which, if present and containing a float, overrides the 'duration' parameter for current track.
* <code>duration</code> (<code>float</code> -- defaults to <code>3.</code>): Duration of the fading. This value can be set on a per-file basis using the metadata field passed as override.
* <code>transition</code> (<code>string</code> -- defaults to <code>&quot;fade&quot;</code>): Kind of transition (fade|slide_left|slide_right|slide_up|slide_down|grow|disc|random).
* <code>type</code> (<code>string</code> -- defaults to <code>&quot;lin&quot;</code>): Fader shape (lin|sin|log|exp): linear, sinusoidal, logarithmic or exponential.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.fill
<pre>(?id:string, ?color:int,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Fill frame with a color.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>color</code> (<code>int</code> -- defaults to <code>0</code>): Color to fill the image with.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.greyscale
<pre>(?id:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Convert video to greyscale.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.invert
<pre>(?id:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Invert video.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.lomo
<pre>(?id:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Emulate the "Lomo effect".

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.opacity
<pre>(?id:string, float,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Scale opacity of video.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>float</code>): Coefficient to scale opacity with.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.opacity.blur
<pre>(?id:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Blur opacity of video.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.rotate
<pre>(?id:string, ?angle:float, ?speed:float,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Rotate video.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>angle</code> (<code>float</code> -- defaults to <code>0.</code>): Initial angle in radians.
* <code>speed</code> (<code>float</code> -- defaults to <code>3.1416</code>): Rotation speed in radians per sec.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.scale
<pre>(?id:string, ?coef:float, ?coef_x:float,
 ?coef_y:float, ?offset_x:int, ?offset_y:int,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Scale and translate video.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>coef</code> (<code>float</code> -- defaults to <code>1.</code>): Scaling coefficient in both directions.
* <code>coef_x</code> (<code>float</code> -- defaults to <code>1.</code>): x scaling
* <code>coef_y</code> (<code>float</code> -- defaults to <code>1.</code>): y scaling
* <code>offset_x</code> (<code>int</code> -- defaults to <code>1</code>): x offset
* <code>offset_y</code> (<code>int</code> -- defaults to <code>1</code>): y offset
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.sepia
<pre>(?id:string, source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Convert video to sepia.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.tile
<pre>(?id:string, ?normalize:bool, ?weights:[int],
 ?proportional:bool,
 [source(audio='a,video='b+1,midi='c)])
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Tile sources (same as add but produces tiles of videos).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>normalize</code> (<code>bool</code> -- defaults to <code>true</code>)
* <code>weights</code> (<code>[int]</code> -- defaults to <code>[]</code>): Relative weight of the sources in the sum. The empty list stands for the homogeneous distribution.
* <code>proportional</code> (<code>bool</code> -- defaults to <code>true</code>): Scale preserving the proportions.
* <code>(unlabeled)</code> (<code>[source(audio='a,video='b+1,midi='c)] where 'a, 'b, 'c is a fixed arity type</code>)

h5. video.transparent
<pre>(?id:string, ?precision:float, ?color:int,
 source(audio='a,video='b+1,midi='c))
 ->source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Set a color to be transparent.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>precision</code> (<code>float</code> -- defaults to <code>0.</code>): Precision in color matching (0. means match precisely the color and 1. means match every color).
* <code>color</code> (<code>int</code> -- defaults to <code>0</code>): Color which should be transparent (in 0xRRGGBB format).
* <code>(unlabeled)</code> (<code>source(audio='a,video='b+1,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)



h4@SourceVisualization. Source / Visualization
h5. video.volume
<pre>(?id:string, source(audio='a+1,video=0,midi=0))
 ->source(audio='a+1,video=1,midi=0) where 'a is a fixed arity type</pre>

Graphical visualization of the sound.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>)

h5. visu.glvolume
<pre>(?id:string, source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

Graphical visualization of the volume using openGL.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)

h5. visu.volume
<pre>(?id:string, source(audio='a+1,video=0,midi=0))
 ->source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</pre>

Graphical visualization of the volume.

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>(unlabeled)</code> (<code>source(audio='a+1,video=0,midi=0) where 'a is a fixed arity type</code>)

h5. vumeter
<pre>(?id:string, ?scroll:bool,
 source(audio='a,video='b,midi='c))
 ->source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</pre>

VU meter (display the volume).

* <code>id</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>): Force the value of the source ID.
* <code>scroll</code> (<code>bool</code> -- defaults to <code>false</code>): Scroll.
* <code>(unlabeled)</code> (<code>source(audio='a,video='b,midi='c) where 'a, 'b, 'c is a fixed arity type</code>)



h4@Bool. Bool
h5. !=
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. <
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. <=
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. ==
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. >
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. >=
<pre>('a, 'a)->bool where 'a is an orderable type</pre>

Comparison of comparable values.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)

h5. and
<pre>(bool, bool)->bool</pre>

Return the conjunction of its arguments

* <code>(unlabeled)</code> (<code>bool</code>)
* <code>(unlabeled)</code> (<code>bool</code>)

h5. not
<pre>(bool)->bool</pre>

Returns the negation of its argument.

* <code>(unlabeled)</code> (<code>bool</code>)

h5. or
<pre>(bool, bool)->bool</pre>

Return the disjunction of its arguments

* <code>(unlabeled)</code> (<code>bool</code>)
* <code>(unlabeled)</code> (<code>bool</code>)

h5. random.bool
<pre>()->bool</pre>

Generate a random value.




h4@Control. Control
h5. add_timeout
<pre>(?fast:bool, float, (()->float))->unit</pre>

Call a function in N seconds. If the result of the function is a positive or null integer, the task will be scheduled after this amount of time (in seconds.)

* <code>fast</code> (<code>bool</code> -- defaults to <code>true</code>): Set to <code>false</code> if the execution of the code can take long in order to lower its priority below that of request resolutions and fast timeouts. This is only effective if you set a dedicated queue for fast tasks, see the "scheduler" settings for more details.
* <code>(unlabeled)</code> (<code>float</code>)
* <code>(unlabeled)</code> (<code>()-&gt;float</code>)

h5. ignore
<pre>('a)->unit</pre>

Convert anything to unit, preventing warnings.

* <code>(unlabeled)</code> (<code>'a</code>)



h4@Interaction. Interaction
h5. add_skip_command
<pre>(source('a))->unit</pre>

Add a skip function to a source
when it does not have one
by default

* <code>(unlabeled)</code> (<code>source('a)</code>): The source to attach the command to.

h5. audioscrobbler.nowplaying
<pre>(~user:string, ~password:string, ?host:string,
 ?port:int, ?length:bool, [(string*string)])->unit</pre>

Submit a now playing song using the audioscrobbler protocol.

* <code>user</code> (<code>string</code>)
* <code>password</code> (<code>string</code>)
* <code>host</code> (<code>string</code> -- defaults to <code>&quot;post.audioscrobbler.com&quot;</code>): Host for audioscrobbling submissions.
* <code>port</code> (<code>int</code> -- defaults to <code>80</code>): Port for audioscrobbling submissions.
* <code>length</code> (<code>bool</code> -- defaults to <code>false</code>): Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
* <code>(unlabeled)</code> (<code>[(string*string)]</code>)

h5. audioscrobbler.submit
<pre>(?source:string, ~user:string, ~password:string,
 ?host:string, ?port:int, ?length:bool,
 [(string*string)])->unit</pre>

Submit a played song using the audioscrobbler protocol.

* <code>source</code> (<code>string</code> -- defaults to <code>&quot;broadcast&quot;</code>): Source for tracks. Should be one of: "broadcast", "user", "recommendation" or "unknown". Since liquidsoap is intented for radio broadcasting, this is the default. Sources other than user don't need duration to be set.
* <code>user</code> (<code>string</code>)
* <code>password</code> (<code>string</code>)
* <code>host</code> (<code>string</code> -- defaults to <code>&quot;post.audioscrobbler.com&quot;</code>): Host for audioscrobbling submissions.
* <code>port</code> (<code>int</code> -- defaults to <code>80</code>): Port for audioscrobbling submissions.
* <code>length</code> (<code>bool</code> -- defaults to <code>false</code>): Try to submit length information. This operation can be CPU intensive. Value forced to true when used with the "user" source type.
* <code>(unlabeled)</code> (<code>[(string*string)]</code>)

h5. icy.update_metadata
<pre>(?host:string, ?port:int, ?user:string,
 ?password:string, ~mount:string, ?protocol:string,
 ?headers:[(string*string)], [(string*string)])
 ->unit</pre>

Update metata on an icecast mountpoint using the ICY protocol.

* <code>host</code> (<code>string</code> -- defaults to <code>&quot;localhost&quot;</code>)
* <code>port</code> (<code>int</code> -- defaults to <code>8000</code>)
* <code>user</code> (<code>string</code> -- defaults to <code>&quot;source&quot;</code>)
* <code>password</code> (<code>string</code> -- defaults to <code>&quot;hackme&quot;</code>)
* <code>mount</code> (<code>string</code>)
* <code>protocol</code> (<code>string</code> -- defaults to <code>&quot;http&quot;</code>): Protocol to use. One of: "icy" or "http"
* <code>headers</code> (<code>[(string*string)]</code> -- defaults to <code>[(&quot;User-Agent&quot;,&quot;liquidsoap 1.0.0-beta1&quot;)]</code>): Additional headers.
* <code>(unlabeled)</code> (<code>[(string*string)]</code>)

h5. interactive.float
<pre>(string, float)->()->float</pre>

Read a float from an interactive input.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>float</code>)

h5. interactive.string
<pre>(string, string)->()->string</pre>

Read a string from an interactive input.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. print
<pre>(?newline:bool, 'a)->unit</pre>

Print on standard output.

* <code>newline</code> (<code>bool</code> -- defaults to <code>true</code>): If true, a newline is added after displaying the value.
* <code>(unlabeled)</code> (<code>'a</code>)



h4@Liquidsoap. Liquidsoap
h5. add_decoder
<pre>(~name:string, ~description:string,
 ~test:((string)->int), string)->unit</pre>

Register an external file decoder. The encoder should output in WAV format to his standard output (stdout) and read data from its standard input (stdin).

* <code>name</code> (<code>string</code>): Format/decoder's name.
* <code>description</code> (<code>string</code>): Description of the decoder.
* <code>test</code> (<code>(string)-&gt;int</code>): Function used to determine if the file should be decoded by the decoder. Returned values are: 0: no decodable audio, -1: decodable audio but number of audio channels unknown, x: fixed number of decodable audio channels.
* <code>(unlabeled)</code> (<code>string</code>): Process to start.

h5. add_metadata_resolver
<pre>(string, ((string)->[(string*string)]))->unit</pre>

Register an external file metadata decoder.

* <code>(unlabeled)</code> (<code>string</code>): Format/resolver's name.
* <code>(unlabeled)</code> (<code>(string)-&gt;[(string*string)]</code>): Process to start. The function takes the format and filename as argument and returns a list of (name,value) fields.

h5. add_oblivious_decoder
<pre>(~name:string, ~description:string,
 ~test:((string)->int), ?buffer:float,
 ((string)->string))->unit</pre>

Register an external file decoder. The encoder should output in WAV format to his standard output (stdout) and read data from the file it receives. The estimated remaining duration for this decoder will be unknown until the @buffer@ last seconds of the file. If possible, it is recommended to decode from stdin and use @add_decoder@.

* <code>name</code> (<code>string</code>): Format/decoder's name.
* <code>description</code> (<code>string</code>): Description of the decoder.
* <code>test</code> (<code>(string)-&gt;int</code>): Function used to determine if the file should be decoded by the decoder. Returned values are: 0: no decodable audio, -1: decodable audio but number of audio channels unknown, x: fixed number of decodable audio channels.
* <code>buffer</code> (<code>float</code> -- defaults to <code>5.</code>)
* <code>(unlabeled)</code> (<code>(string)-&gt;string</code>): Process to start. The function takes the filename as argument and returns the process to start.

h5. add_protocol
<pre>(?temporary:bool, string, ((string,
 float)->[string]))->unit</pre>

Register a new protocol.

* <code>temporary</code> (<code>bool</code> -- defaults to <code>false</code>): if true, file removed when it is finished.
* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>(string, float)-&gt;[string]</code>)

h5. configure.libdir
<pre>string</pre>

Liquidsoap's library directory.


h5. configure.logdir
<pre>string</pre>

Liquidsoap's logging directory.


h5. configure.rundir
<pre>string</pre>

Liquidsoap's PID file directory.


h5. enable_replaygain_metadata
<pre>(?extract_replaygain:string)->unit</pre>

Enable replay gain metadata resolver. This resolver will
process any file decoded by liquidsoap and add a @replay_gain@
metadata when this value could be computed. For a finer-grained
replay gain processing, use the @replay_gain@ protocol.

* <code>extract_replaygain</code> (<code>string</code> -- defaults to <code>&quot;/usr/local/lib/liquidsoap/1.0.0-beta1/extract-replaygain&quot;</code>): The extraction program

h5. execute
<pre>(string, ?string)->[string]</pre>
WARNING: This is DEPRECATED!

Execute a liquidsoap server command.
This operator is deprecated, in favor of 'server.execute'.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)

h5. file.duration
<pre>(string)->float</pre>

Compute the duration in seconds of audio data contained in a file. The computation may be expensive. Returns -1. if computation failed, typically if the file was not recognized as valid audio.

* <code>(unlabeled)</code> (<code>string</code>)

h5. get
<pre>(~default:'a, string)
 ->'a where 'a is bool, int, float, string or [string]</pre>

Get a setting's value.

* <code>default</code> (<code>anything that is bool, int, float, string or [string]</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. get_clock_status
<pre>()->[(string*int)]</pre>

Get the current time for all allocated clocks.


h5. liquidsoap.version
<pre>string</pre>

Liquidsoap version string.


h5. os.type
<pre>string</pre>

Type of OS running liquidsoap.


h5. playlist.parse
<pre>(string)->[([(string*string)]*string)]</pre>

Try to parse a local playlist. Return a list of (metadata,URI) items, where metadata is a list of (key,value) bindings.

* <code>(unlabeled)</code> (<code>string</code>)

h5. request.create
<pre>(?indicators:[string], ?persistent:bool, string)
 ->request('a)</pre>

Create a request. Creation may fail if there is no available RID, which cannot be detected currently: in that case one will obtain a request that will fail to be resolved.

* <code>indicators</code> (<code>[string]</code> -- defaults to <code>[]</code>)
* <code>persistent</code> (<code>bool</code> -- defaults to <code>false</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. request.create.raw
<pre>(?indicators:[string], ?persistent:bool, string)
 ->request(audio=0,video=0,midi=0)</pre>

Create a raw request, i.e. for files that should not be decoded for streaming. Creation may fail if there is no available RID, which cannot be detected currently: in that case one will obtain a request that will fail to be resolved.

* <code>indicators</code> (<code>[string]</code> -- defaults to <code>[]</code>)
* <code>persistent</code> (<code>bool</code> -- defaults to <code>false</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. request.destroy
<pre>(?force:bool, request('a))->unit</pre>

Destroying a request causes any temporary associated file to be deleted, and releases its RID. Persistent requests resist to destroying, unless forced.

* <code>force</code> (<code>bool</code> -- defaults to <code>false</code>): Destroy the request even if it is persistent.
* <code>(unlabeled)</code> (<code>request('a)</code>)

h5. request.filename
<pre>(request('a))->string</pre>

Return a valid local filename if the request is ready, and the empty string otherwise.

* <code>(unlabeled)</code> (<code>request('a)</code>)

h5. request.ready
<pre>(request('a))->bool</pre>

Check if a request is ready, i.e. is associated to a valid local file. Unless the initial URI was such a file, a request has to be resolved before being ready.

* <code>(unlabeled)</code> (<code>request('a)</code>)

h5. request.resolve
<pre>(?timeout:float, request('a))->bool</pre>

Resolve a request, i.e. attempt to get a valid local file. The operation can take some time. Return true if the resolving was successful, false otherwise (timeout or invalid URI).

* <code>timeout</code> (<code>float</code> -- defaults to <code>30.</code>): Limit in seconds to the duration of the resolving.
* <code>(unlabeled)</code> (<code>request('a)</code>)

h5. server.execute
<pre>(string, ?string)->[string]</pre>

Execute a liquidsoap server command.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)

h5. set
<pre>(string, 'a)
 ->unit where 'a is bool, int, float, string or [string]</pre>

Change some setting. Use <code>liquidsoap --conf-descr</code> and <code>liquidsoap --conf-descr-key KEY</code> on the command-line to get some information about available settings.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>anything that is bool, int, float, string or [string]</code>)

h5. source.id
<pre>(source('a))->string</pre>

Get one source's identifier.

* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. source.is_ready
<pre>(source('a))->bool</pre>

Indicate if a source is ready to stream, or currently streaming.

* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. source.remaining
<pre>(source('a))->float</pre>

Estimation of remaining time in the current track.

* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. source.shutdown
<pre>(source('a))->unit</pre>

Desactivate a source.

* <code>(unlabeled)</code> (<code>source('a)</code>)

h5. source.skip
<pre>(source('a))->unit</pre>

Skip to the next track.

* <code>(unlabeled)</code> (<code>source('a)</code>)



h4@List. List
h5. _[_]
<pre>(string, [(string*string)])->string</pre>

<code>l[k]</code> returns the first <code>v</code> such that <code>(k,v)</code> is in the list <code>l</code>.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>[(string*string)]</code>)

h5. fst
<pre>(('a*'b))->'a</pre>

Get the first component of a pair.

* <code>(unlabeled)</code> (<code>('a*'b)</code>)

h5. list.append
<pre>(['a], ['a])->['a]</pre>

Catenate two lists.

* <code>(unlabeled)</code> (<code>['a]</code>)
* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.assoc
<pre>(string, [(string*string)])->string</pre>

Alias for the <code>l[k]</code> notation.

* <code>(unlabeled)</code> (<code>string</code>): Key to look for
* <code>(unlabeled)</code> (<code>[(string*string)]</code>): List of pairs (key,value)

h5. list.fold
<pre>((('a, 'b)->'a), 'a, ['b])->'a</pre>

Fold a function on every element of a list.

* <code>(unlabeled)</code> (<code>('a, 'b)-&gt;'a</code>)
* <code>(unlabeled)</code> (<code>'a</code>)
* <code>(unlabeled)</code> (<code>['b]</code>)

h5. list.hd
<pre>([string])->string</pre>

Return the head (first element) of a list, or "" if the list is empty.

* <code>(unlabeled)</code> (<code>[string]</code>)

h5. list.iter
<pre>((('a)->unit), ['a])->unit</pre>

Call a function on every element of a list.

* <code>(unlabeled)</code> (<code>('a)-&gt;unit</code>)
* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.length
<pre>(['a])->int</pre>

Get the length of a list, i.e. its number of elements.

* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.map
<pre>((('a)->'b), ['a])->['b]</pre>

Map a function on every element of a list.

* <code>(unlabeled)</code> (<code>('a)-&gt;'b</code>)
* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.mem
<pre>('a, ['a])->bool where 'a is an orderable type</pre>

Check if an element belongs to a list.

* <code>(unlabeled)</code> (<code>anything that is an orderable type</code>)
* <code>(unlabeled)</code> (<code>['a] where 'a is an orderable type</code>)

h5. list.mem_assoc
<pre>(string, [(string*string)])->bool</pre>

list.mem_assoc(key,l) returns true if l contains a pair
(key,value)

* <code>(unlabeled)</code> (<code>string</code>): Key to look for
* <code>(unlabeled)</code> (<code>[(string*string)]</code>): List of pairs (key,value)

h5. list.nth
<pre>(['a], int)->'a</pre>

Get the n-th element of a list (the first element is at position 0).

* <code>(unlabeled)</code> (<code>['a]</code>)
* <code>(unlabeled)</code> (<code>int</code>)

h5. list.remove
<pre>('a, ['a])->['a]</pre>

Remove a value from a list.

* <code>(unlabeled)</code> (<code>'a</code>)
* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.remove_assoc
<pre>(string, [(string*string)])->[(string*string)]</pre>

Remove a pair from an associative list

* <code>(unlabeled)</code> (<code>string</code>): Key of pair to be removed
* <code>(unlabeled)</code> (<code>[(string*string)]</code>): List of pairs (key,value)

h5. list.rev
<pre>(['a])->['a]</pre>

Revert list order.

* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.sort
<pre>((('a, 'a)->int), ['a])->['a]</pre>

Sort a list according to a comparison function.

* <code>(unlabeled)</code> (<code>('a, 'a)-&gt;int</code>)
* <code>(unlabeled)</code> (<code>['a]</code>)

h5. list.tl
<pre>(['a])->['a]</pre>

Return the list without its first element.

* <code>(unlabeled)</code> (<code>['a]</code>)

h5. snd
<pre>(('a*'b))->'b</pre>

Get the second component of a pair.

* <code>(unlabeled)</code> (<code>('a*'b)</code>)



h4@Math. Math
h5. *
<pre>('a, 'a)->'a where 'a is a number type</pre>

Multiplication of numbers.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)
* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. +
<pre>('a, 'a)->'a where 'a is a number type</pre>

Addition of numbers.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)
* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. -
<pre>('a, 'a)->'a where 'a is a number type</pre>

Substraction  of numbers.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)
* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. /
<pre>('a, 'a)->'a where 'a is a number type</pre>

Division of numbers.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)
* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. abs
<pre>('a)->'a where 'a is a number type</pre>

Absolute value.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. bool_of_float
<pre>(float)->bool</pre>

Convert a float to a bool.

* <code>(unlabeled)</code> (<code>float</code>)

h5. bool_of_int
<pre>(int)->bool</pre>

Convert an int to a bool.

* <code>(unlabeled)</code> (<code>int</code>)

h5. dB_of_lin
<pre>(float)->float</pre>

Convert linear scale into decibels.

* <code>(unlabeled)</code> (<code>float</code>)

h5. float_of_int
<pre>(int)->float</pre>

Convert an int to a float.

* <code>(unlabeled)</code> (<code>int</code>)

h5. int_of_float
<pre>(float)->int</pre>

Convert a float to a int.

* <code>(unlabeled)</code> (<code>float</code>)

h5. lin_of_dB
<pre>(float)->float</pre>

Convert decibels into linear scale.

* <code>(unlabeled)</code> (<code>float</code>)

h5. pow
<pre>('a, 'a)->'a where 'a is a number type</pre>

Exponentiation of numbers.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)
* <code>(unlabeled)</code> (<code>anything that is a number type</code>)

h5. random.float
<pre>(?min:float, ?max:float)->float</pre>

Generate a random value.

* <code>min</code> (<code>float</code> -- defaults to <code>-1000000.</code>)
* <code>max</code> (<code>float</code> -- defaults to <code>1000000.</code>)

h5. ~-
<pre>('a)->'a where 'a is a number type</pre>

Returns the opposite of its argument.

* <code>(unlabeled)</code> (<code>anything that is a number type</code>)



h4@String. String
h5. %
<pre>(string, [(string*string)])->string</pre>

<code>pattern % [...,(k,v),...]</code> changes in the pattern occurences of:
 - <code>$(k)</code> into <code>v</code>;
 - <code>$(if $(k2),"a","b")</code> into "a" if k2 is found in the list, "b" otherwise.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>[(string*string)]</code>)

h5. ^
<pre>(string, string)->string</pre>

Concatenate strings.

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. bool_of_string
<pre>(?default:bool, string)->bool</pre>

Convert a string to a bool.

* <code>default</code> (<code>bool</code> -- defaults to <code>false</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. float_of_string
<pre>(?default:float, string)->float</pre>

Convert a string to a float.

* <code>default</code> (<code>float</code> -- defaults to <code>0.</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. int_of_string
<pre>(?default:int, string)->int</pre>

Convert a string to a int.

* <code>default</code> (<code>int</code> -- defaults to <code>0</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. quote
<pre>(string)->string</pre>

Escape shell metacharacters.

* <code>(unlabeled)</code> (<code>string</code>)

h5. string.capitalize
<pre>(?capitalize:bool, ?space_sensitive:bool, string)
 ->string</pre>

Return a string with the first character set to upper case (capitalize), or to lower case (uncapitalize).

* <code>capitalize</code> (<code>bool</code> -- defaults to <code>true</code>): Capitalize if true, uncapitalize otherwise
* <code>space_sensitive</code> (<code>bool</code> -- defaults to <code>true</code>): Capitalize each space separated sub-string.
* <code>(unlabeled)</code> (<code>string</code>)

h5. string.case
<pre>(?lower:bool, string)->string</pre>

Convert a string to lower or upper case.

* <code>lower</code> (<code>bool</code> -- defaults to <code>true</code>): Convert to lower case if true and uppercase otherwise.
* <code>(unlabeled)</code> (<code>string</code>)

h5. string.concat
<pre>(?separator:string, [string])->string</pre>

Concatenate strings.

* <code>separator</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>(unlabeled)</code> (<code>[string]</code>)

h5. string.extract
<pre>(~pattern:string, string)->[(string*string)]</pre>

Extract substrings from a string. 
Perl compatible regular expressions are recognized. Hence, special characters should be escaped. 
Returns a list of (index,value).
If the list does not have a pair associated to some index, it means that the corresponding pattern was not found.

* <code>pattern</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. string.match
<pre>(~pattern:string, string)->bool</pre>

Match a string with an expression. 
Perl compatible regular expressions are recognized. Hence, special characters should be escaped.

* <code>pattern</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. string.replace
<pre>(~pattern:string, ((string)->string), string)
 ->string</pre>

Replace substrings in a string. 
Will replace all substrings matched in the pattern by the string returned by the replace function.

* <code>pattern</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>(string)-&gt;string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. string.split
<pre>(~separator:string, string)->[string]</pre>

Split a string at 'separator'. 
Perl compatible regular expressions are recognized. Hence, special characters should be escaped.

* <code>separator</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. string_of
<pre>('a)->string</pre>

Return the representation of a value.

* <code>(unlabeled)</code> (<code>'a</code>)



h4@System. System
h5. argv
<pre>(?default:string, int)->string</pre>

Get command-line parameters.

* <code>default</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>(unlabeled)</code> (<code>int</code>)

h5. basename
<pre>(string)->string</pre>

Get the base name of a path.
Implemented using the corresponding shell command.

* <code>(unlabeled)</code> (<code>string</code>): Path

h5. dirname
<pre>(?default:string, string)->string</pre>

Get the directory name of a path.
Implemented using the corresponding shell command.

* <code>default</code> (<code>string</code> -- defaults to <code>&quot;/nonexistent&quot;</code>): Value returned in case of error.
* <code>(unlabeled)</code> (<code>string</code>): Path

h5. exec_at
<pre>(?freq:float, ~pred:(()->bool), (()->unit))->unit</pre>

Execute a given action when a predicate is true.
This will be run in background.

* <code>freq</code> (<code>float</code> -- defaults to <code>1.</code>): Frequency for checking the predicate, in seconds.
* <code>pred</code> (<code>()-&gt;bool</code>): Predicate indicating when to execute the function, typically a time interval such as <code>{10h-10h30}</code>.
* <code>(unlabeled)</code> (<code>()-&gt;unit</code>): Function to execute when the predicate is true.

h5. garbage_collect
<pre>()->unit</pre>

Trigger full major garbage collection.


h5. get_mime
<pre>(string)->string</pre>

Generic mime test. First try to use file.mime if it exist.
Otherwise try to get the value using the file binary.
Returns "" (empty string) if no value can be find.

* <code>(unlabeled)</code> (<code>string</code>): The file to test

h5. get_process_lines
<pre>(string)->[string]</pre>

Perform a shell call and return the list of its output lines.

* <code>(unlabeled)</code> (<code>string</code>)

h5. get_process_output
<pre>(string)->string</pre>

Perform a shell call and return its output.

* <code>(unlabeled)</code> (<code>string</code>)

h5. getopt
<pre>(?default:string, string)->string</pre>

Parse command line options:
<code>getopt("-o")</code> returns "1" if "-o" was passed without any parameter, "0" otherwise.
<code>getopt(default="X","-o")</code> returns "Y" if "-o Y" was passed, "X" otherwise.
The result is removed from the list of arguments, affecting subsequent
calls to <code>argv()</code> and <code>getopt()</code>.

* <code>default</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. getpid
<pre>()->int</pre>

Get the process' pid.


h5. gettimeofday
<pre>()->float</pre>

Return the current time since 00:00:00 GMT, Jan. 1, 1970, in seconds.


h5. log
<pre>(?label:string, ?level:int, string)->unit</pre>

Log a message.

* <code>label</code> (<code>string</code> -- defaults to <code>&quot;lang&quot;</code>)
* <code>level</code> (<code>int</code> -- defaults to <code>3</code>)
* <code>(unlabeled)</code> (<code>string</code>)

h5. on_shutdown
<pre>((()->unit))->unit</pre>

Register a function to be called when Liquidsoap shuts down.

* <code>(unlabeled)</code> (<code>()-&gt;unit</code>)

h5. read
<pre>(?hide:bool)->string</pre>

Read some value from standard input (console).

* <code>hide</code> (<code>bool</code> -- defaults to <code>false</code>): Hide typed characters (for passwords).

h5. server.register
<pre>(?namespace:string, ?description:string,
 ?usage:string, string, ((string)->string))->unit</pre>

Register a command. You can then execute this function through the server, either telnet or socket.

* <code>namespace</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>description</code> (<code>string</code> -- defaults to <code>&quot;No documentation available.&quot;</code>): A description of your command.
* <code>usage</code> (<code>string</code> -- defaults to <code>&quot;&quot;</code>)
* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>(string)-&gt;string</code>)

h5. shutdown
<pre>()->unit</pre>

Shutdown the application.


h5. system
<pre>(string)->unit</pre>

Shell command call. Set verbose to true to log process' output and errors.

* <code>(unlabeled)</code> (<code>string</code>)

h5. test_process
<pre>(string)->bool</pre>

Return true if process exited with 0 code.
Command should return quickly.

* <code>(unlabeled)</code> (<code>string</code>): Command to test



h4@Uncategorized. Uncategorized
h5. log_clocks
<pre>(?float, 'a)->unit</pre>

Create a log of clock times for all the clocks initially present.
The log is in simple format, which you can notably directly use with gnuplot.

* <code>(unlabeled)</code> (<code>float</code> -- defaults to <code>1.</code>)
* <code>(unlabeled)</code> (<code>'a</code>)

h5. replaygain_protocol
<pre>(string, 'a)->[string]</pre>

Register the replaygain protocol

* <code>(unlabeled)</code> (<code>string</code>)
* <code>(unlabeled)</code> (<code>'a</code>)


