<interface>
  <bindings>
    <!-- Variables -->

    <!-- Footswitch controller # used to grab loops initially -->
    <declare var="VAR_midi_footswitch" type="int" init="64"/>

    <declare var="VAR_loopid_footswitch" type="int" init="340"/>

    <!-- Startup -->
    <!-- By default, load single loop onto the footswitch -->
    <binding input="start-interface" 
     output1="video-show-loop" 
     parameters1="layoutid=0 and
                  loopid=VAR_loopid_footswitch"
     output2="set-load-loop-id"
     parameters2="loopid=VAR_loopid_footswitch"/>

    <!-- Rest of the bindings... -->
    <binding input="midicontroller"
     conditions="VAR_keyheld_up=1 and controlnum=VAR_midi_footswitch and
                 controlval=VAR_switch_on"
     output="slide-loop-amplifier"
     parameters="loopid=VAR_loopid_footswitch and slide=VAR_slide_speed/2"/> 
    <binding input="midicontroller"
     conditions="VAR_keyheld_down=1 and controlnum=VAR_midi_footswitch and
                 controlval=VAR_switch_on"
     output="slide-loop-amplifier"
     parameters="loopid=VAR_loopid_footswitch and slide=-VAR_slide_speed/2"/> 

    <!-- Erase Loops -->
    <binding input="midicontroller"
     conditions="VAR_keyheld_space=1 and controlnum=VAR_midi_footswitch and 
                 controlval=VAR_switch_on"
     output1="erase-loop" parameters1="loopid=VAR_loopid_footswitch" 
     output2="set-variable" parameters2="var=VAR_xferloop and value=0"/>

    <!-- Overdub Loops -->
    <!-- Auto-overdub for first recorded loop- disabled!
    <binding input="midicontroller"
     conditions="SYSTEM_num_loops_in_map=0 and controlnum=VAR_midi_footswitch
                 and controlval=VAR_switch_on"
     output1="trigger-loop"
     parameters1="loopid=VAR_loopid_footswitch and overdub=1 and
                  overdubfeedback=VAR_overdubfeedback and vol=1.0" 
     output2="set-variable" parameters2="var=VAR_xferloop and value=1"
     output3="set-variable" parameters3="var=VAR_xferidx and 
                                         value=VAR_loopid_footswitch"/>
      -->

    <binding input="midicontroller"
     conditions="VAR_overdubmode=1 and controlnum=VAR_midi_footswitch
                 and controlval=VAR_switch_on"
     output1="trigger-loop" 
     parameters1="overdub=1 and overdubfeedback=VAR_overdubfeedback and
                  loopid=VAR_loopid_footswitch and vol=1.0" 
     output2="set-variable" parameters2="var=VAR_xferloop and value=1"
     output3="set-variable" parameters3="var=VAR_xferidx and
                                         value=VAR_loopid_footswitch"/>

    <!-- Trigger Loops -->
    <binding input="midicontroller"
     conditions="controlnum=VAR_midi_footswitch and controlval=VAR_switch_on"
     output1="trigger-loop" 
     parameters1="loopid=VAR_loopid_footswitch and vol=1.0" 
     output2="set-variable" parameters2="var=VAR_xferloop and value=1"
     output3="set-variable" parameters3="var=VAR_xferidx and
                                         value=VAR_loopid_footswitch"/>
  </bindings>

  <graphics>
    <layout id="0" name="Footswitch" scale="1.0,1.3" pos="0.90,0.85"
     label="0" elabel="1" namepos="0.02,0.02" show="1">
      <element id="0" name="SW" base="0.0,0.0" looppos="0.05,0.05" 
       loopsize="0.1" namepos="0.01,0.00">
        <box outline="TBLR" pos="0.00,0.00, 0.10,0.10"/>
      </element> 
    </layout>
  </graphics>
</interface>
