<effect>
  <name>ladspa fastLookaheadLimiter</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;ladspa_fastLookaheadLimiterON&gt; == 1) then

    ihandle dssiinit &quot;&lt;ladspa_fastLookaheadLimiter_ladspa&gt;&quot;, 0, 0

    dssiactivate ihandle, 1
	
    dssictls ihandle, 0, &lt;ladspa_fastLookaheadLimiter_Input gain&gt;, 1                                        ; -20 - 20
    dssictls ihandle, 1, &lt;ladspa_fastLookaheadLimiter_Limit&gt;, 1                                             ; -20 - 0
    dssictls ihandle, 2, &lt;ladspa_fastLookaheadLimiter_Release time&gt;, 1                                      ; 0,01 - 2

    aout1, aout2   dssiaudio ihandle, ain1, ain2                                ; stereo in, stereo out
else
    aout1   =   ain1
    aout2   =   ain2
endif

</code>
  <comments>a wrapper of ladspa plugin 1913 called Fast Lookahead limiter, created by Steve Harris. Licensed under GPL.
plugin has stereo inputs, stereo output.

The dssi opcodes are wrapping the ladspa plugin so it can be used as an effect in Blue.
The PATH for the ladspa plugins on my Linux systemm is /usr/lib/ladspa. Be sure to set the right PATH if you run OSX or Windows.

DESCRIPTION:

This is a limiter with an attack time of 5ms. It adds just over 5ms of lantecy to the input signal, 
but it guatantees that there will be no signals over the limit, and tries to get the minimum ammount of distortion.
Input gain (dB)


CONTROLLERS:

ON/OFF              -       bypass
File Selector       -       set path for fast_lookahead_limiter_1913.so
Input gain          -       adjust input gain
Limit               -       limits the signal, in dB
Release Time        -       The longer the release time, the less low frequency distortions

---

version 1.02, July 2020
- added BSB information comments

version 1.01, May 2020
- added comments on controllers

version 1.0, June 2019
- initial version by Menno Knevel
</comments>
  <opcodeList/>
  <graphicInterface editEnabled='false'>
    <gridSettings>
      <width>5</width>
      <height>5</height>
      <gridStyle>DOT</gridStyle>
      <snapGridEnabled>true</snapGridEnabled>
    </gridSettings>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
      <objectName></objectName>
      <x>0</x>
      <y>0</y>
      <groupName>Group</groupName>
      <backgroundColor>0x00000033</backgroundColor>
      <borderColor>0x000000ff</borderColor>
      <labelTextColor>0xffffffff</labelTextColor>
      <titleEnabled>true</titleEnabled>
      <width>20</width>
      <height>20</height>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>ladspa_fastLookaheadLimiterON</objectName>
        <x>0</x>
        <y>0</y>
        <comment>bypass</comment>
        <automationAllowed>true</automationAllowed>
        <label/>
        <selected>true</selected>
        <randomizable>true</randomizable>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
        <objectName></objectName>
        <x>10</x>
        <y>10</y>
        <groupName>Group</groupName>
        <backgroundColor>0x666666ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>20</width>
        <height>20</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>120</y>
          <label>Release time</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>90</y>
          <label>Limit</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_fastLookaheadLimiter_Release time</objectName>
          <x>10</x>
          <y>110</y>
          <comment>The longer the release time, the less low frequency distortions</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.01</minimum>
          <maximum>2.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>1.01</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_fastLookaheadLimiter_Input gain</objectName>
          <x>10</x>
          <y>50</y>
          <comment>adjust input gain</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-20.0</minimum>
          <maximum>20.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>-5.0</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_fastLookaheadLimiter_Limit</objectName>
          <x>10</x>
          <y>80</y>
          <comment>limits the signal, in dB</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-20.0</minimum>
          <maximum>0.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>-13.9</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBFileSelector'>
          <objectName>ladspa_fastLookaheadLimiter_ladspa</objectName>
          <x>10</x>
          <y>10</y>
          <comment>set path for fast_lookahead_limiter_1913.so</comment>
          <fileName>/usr/lib/ladspa/fast_lookahead_limiter_1913.so</fileName>
          <textFieldWidth>280</textFieldWidth>
          <stringChannelEnabled>false</stringChannelEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>60</y>
          <label>Input gain</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='-2056868794' name='ladspa_fastLookaheadLimiterON' label='' min='0.0' max='1.0' bdresolution='1' automationEnabled='false' value='1.0'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-2056868792' name='ladspa_fastLookaheadLimiter_Release time' label='' min='0.01' max='2.0' bdresolution='0.1' automationEnabled='false' value='1.01'>
      <line name='' version='2' max='2.0' min='0.01' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.01'/>
      </line>
    </parameter>
    <parameter uniqueId='-2056868790' name='ladspa_fastLookaheadLimiter_Input gain' label='' min='-20.0' max='20.0' bdresolution='0.01' automationEnabled='false' value='-5.0'>
      <line name='' version='2' max='20.0' min='-20.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='-5.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-2056868788' name='ladspa_fastLookaheadLimiter_Limit' label='' min='-20.0' max='0.0' bdresolution='0.1' automationEnabled='false' value='-13.9'>
      <line name='' version='2' max='0.0' min='-20.0' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='-13.9'/>
      </line>
    </parameter>
  </parameterList>
</effect>