Skip to content

Mixer and snapshots

Hans Lindetorp edited this page Jan 31, 2024 · 2 revisions

If your Audio-element has its controls set to "true", there will be a button in you top-right corner of the screen when you run the webpage in a browser. Click this button and you can see the Graphical User Interface for WAXML. It is still early days, but there are a few really useful tools worth mentioning. Firstly, there is a graphical arranger view that visualizes the playback of the audio files specified in your iMusicXML file. You can zoom in and out and scroll to the left to see what files got played at what position.

<?xml version="1.0" encoding="UTF-8"?>
<Audio version="1.0" timeUnit="ms" controls="true">

    
</Audio>

Dynamic Mixer

If you set the control attribute of a Mixer element to "waxml-dynamic-mixer", it will pop up in the user interface with controls like this:

<Mixer id="intensity-mixer" controls="waxml-dynamic-mixer">       
  <GainNode class="mix1" id="mix1" />
  <GainNode class="mix2" id="mix2" />
  <GainNode class="mix3" id="mix3" />
  <GainNode class="mix4" id="mix4" />
</Mixer>

Dynamic Mixer

Full Mixer

If you set the control attribute of a Mixer element to "", you will instead get a user interface with sliders for all included variables in each channel (child node) of the mixer (see code example below):

<Mixer controls="waxml-variable-matrix">
            
  <Chain id="ch1" output="#master">
    <var name="volume" value="$ch1_volume" mapin="-30,6" default="0" convert="dB->power" />
    <var name="pan" value="$ch1_pan" mapin="-1,1" default="0"/>
    <var name="filter_cutoff" value="$ch1_filter_cutoff" mapin="-100,100" default="0"/>
    <var name="filter_resonance" value="$ch1_filter_resonance" mapin="0,30" default="0"/>
    <var name="send1" value="$ch1_send1" mapin="-30,6" default="-40" convert="dB->power" />
    
    <GainNode output=".channel"/>
    <include href="mixer-channel.xml"/>
  </Chain>

  <!-- repeat for each channel -->
</Mixer>

Full Mixer

Snapshots

The full mixer also comes with a snapshot feature that lets you take a snapshot of all selected sliders and store them in your audio config file like this:

<Snapshot class="HP">
  <Command type="set" variable="mix_transition_time" value="1000" />
  <Command type="set" variable="music_volume" value="-2.56" />
  <Command type="set" variable="music_filter_cutoff" value="57.15" />
  <Command type="set" variable="music_filter_resonance" value="4.51" />
</Snapshot>

A snapshot can be triggered similarly to any audio objects in WAXML using either javascript:

waxml.trig("HP");

or HTML:

<button data-waxml-click-trig="HP">Trigg HP snapshot</button>

Snapshots

Clone this wiki locally