Skip to content
Hans Lindetorp edited this page Apr 23, 2020 · 4 revisions

The Chain element connects all its child elements in a serial way, just like a channel with inserts in a mixer or like a chain of modules in a modular synthesizer. The input of a Chain element is connected to its first child element (if it has an input) and the last child element is connected to the Chain elements output which is connected to its parent element. The Chain element is technically a WebAudio GainNode and can therefor have its gain attribute set to control the overall output volume of the Chain.

<?xml version="1.0" encoding="UTF-8"?>
<Audio version="1.0" timeUnit="ms">
  <Chain gain="-3dB">
    <OscillatorNode></OscillatorNode>
    <BiquadFilterNode frequency="500"></BiquadFilterNode>
  </Chain>
</Audio>

This example shows an oscillator sent trough a BiquadFilterNode. The output of the BiquadFilterNode is connected to the Chain element, which is set to reduce the gain with 3dB before the audio passes to the Audio elements main output.

gain

Controls the overall output volume of the Synth. Can be set in dB or power value.

portamento

The attribute "portamento" can be set to any value to control the transition time for oscillator frequency change. This makes it possible for oscillatorNodes to glide between notes. The portamento attribute is inherited to all child nodes but only affects the transition time for frequency change on oscillatorNodes.

Clone this wiki locally