Skip to content

Audio Signal Routing

Hans Lindetorp edited this page Feb 25, 2021 · 2 revisions

The output of (almost) any element can be changed from the default behavior specified by its parent element (whether it's a Mixer, Chain, Voice or Synth element) to a specific target. This target is specified using standard CSS Selectors. This means that a target element must have an ID or a class name and the source element must have its "output"-attribute set to that value. This example shows how to connect the output of a Synth to the input of a Chain in a Mixer:

<Synth output="#ch1">
...
</Synth>


<Chain id="ch1">
...
</Chain>

In this way, it's possible to create a feedback loop in a delay:

<Chain id="delay">
  <DelayNode delayTime="500" maxDelayTime="2000"></DelayNode>
  <GainNode gain="-3dB"></GainNode>
  <BiquadFilterNode frequency="20000"></BiquadFilterNode>
  <Send output="#delay"></Send>
</Chain>

or sending a signal to a reverb bus:

<Chain id="ch1">
  <Send output="#reverb" gain="-3dB"></Send>
</Chain>

<Chain id="reverb">
  <ConvolverNode src="fx/large-bottle-hall.wav"></ConvolverNode>
</Chain>

Complex routing

There are no limits for how many destinations one output can be routed to. E.g. if several elements have a common class name, an output can connect to them by targeting their class name (in a similar way to how a CSS rule can apply to multiple HTML elements with the same class name (in this example, I've used both id and class names for clarity but the ids are not used). If CSS selectors are new to you, it's recommended to have a read at W3schools to realize all possibilities: https://www.w3schools.com/cssref/css_selectors.asp

ex:

<Chain id="ch1">
  <Send output=".reverb" gain="-3dB"></Send>
</Chain>

<Chain id="reverb1" class="reverb">
  <ConvolverNode src="fx/large-bottle-hall1.wav"></ConvolverNode>
</Chain>

<Chain id="reverb2" class="reverb">
  <ConvolverNode src="fx/large-bottle-hall2.wav"></ConvolverNode>
</Chain>

As well as having one output being connected to multiple targets, the opposite is also possible; many outputs can connect to one single target. This is mimicking the behaviour of a mixing console sending audio from all channels to one effect channel.

ex:

<Chain id="ch1">
  <Send output="#reverb" gain="-3dB"></Send>
</Chain>

<Chain id="ch2">
  <Send output="#reverb" gain="-6dB"></Send>
</Chain>

<Chain id="reverb">
  <ConvolverNode src="fx/large-bottle-hall1.wav"></ConvolverNode>
</Chain>
Clone this wiki locally