<source>
#
<source>
elements are defined within the <head>
element
and all sources exist for the entire duration of the scene.
File Inputs#
<clip> and <channel> elements can provide audio signals for <source>
elements
using the source
attribute.
If no source
attribute is given, an unnamed <source>
is implicitly created.
A <source>
can be fed by multiple <clip>
elements over time,
but only if they don’t overlap.
If the port
attribute (see below) is given,
no <clip>
elements can be assigned.
An implementation may re-use the same unnamed <source>
for multiple non-overlapping <clip>
elements, but this is not required.
Live Inputs#
The port
attribute can be used to provide live input signals,
for example from microphones, external sound hardware or
any software capable of producing audio signals
(and connecting them with the software loading the ASDF scene).
The content of the port
attribute isn’t strictly specified and
it is up to the reproduction software to interpret it.
For example, the SSR provides an --input-prefix
option
to which the content of the port
attribute is appended.
By default, the prefix is system:capture_
and appending numbers starting
with 1
will select the corresponding hardware input channels.
The scene live-sources.asd
shows an example of
using the first 4 hardware inputs as sources:
<asdf version="0.4">
<head>
<source port="1" name="live input 1" pos="-1.5 2" />
<source port="2" name="live input 2" pos="-0.5 2" />
<source port="3" name="live input 3" pos="0.5 2" />
<source port="4" name="live input 4" pos="1.5 2" />
</head>
</asdf>
Live sources and sources driven by audio files can be mixed in one scene and
<transform> elements can apply to either.
See e.g. live-sources-and-file-sources.asd
:
<asdf version="0.4">
<head>
<source port="1" name="live input 1" pos="-1.5 2" />
<source port="2" name="live input 2" pos="-0.5 2" />
<source port="3" name="live input 3" id="three" />
<source port="4" name="live input 4" pos="1.5 2" />
</head>
<body>
<clip file="audio/xmas.wav" pos="0 2.5" />
<!-- Source "three" is only active during this time -->
<transform apply-to="three" pos="0.5 2" dur="1 min" />
<clip file="audio/xmas.wav" pos="0 2.5" />
</body>
</asdf>
Transform Attributes#
Any <source>
element with an id
attribute can be the target of a
<transform> (using the apply-to
attribute).
Like <clip> and <channel>,
<source>
can also use transform attributes
like pos
, rot
etc. as a shortcut,
see source-transform.asd
:
<asdf version="0.4">
<head>
<source id="src-one" pos="-1 1" />
<source id="src-two" pos="1 1" />
</head>
<clip file="audio/marimba.ogg">
<channel source="src-one" />
<channel source="src-two" />
</clip>
<clip file="audio/marimba.ogg">
<channel source="src-two" />
<channel source="src-one" />
</clip>
</asdf>