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

    if (&lt;MASTER_DCoffset&gt; == 1) then
        ain1    buthp   ain1, 10
        ain2    buthp   ain2, 10
    endif

    if (&lt;MASTER_Limiter&gt; == 1) then
        ain1   limit   ain1, &lt;MASTER_Limiter_low&gt;, &lt;MASTER_Limiter_high&gt;
        ain2   limit   ain2, &lt;MASTER_Limiter_low&gt;, &lt;MASTER_Limiter_high&gt;
    endif

    aout1 ButtLP ain1, &lt;MASTER_anti alias&gt;, 4
    aout2 ButtLP ain2, &lt;MASTER_anti alias&gt;, 4

else

    aout1   =   ain1
    aout2   =   ain2

endif</code>
  <comments>
DESCRIPTION:

The MASTEReffect is meant to be put on the Master output of the mixer.
It keeps an eye on volume, removes DC and lowpasses the mix in order to prevent aliasing. It is a safeguard.
Of course, they can all be switched on and off, but i keep them all on as long as i am in the composition fase; once the final
mix is done, i check if there is any DC or too high frequencies or too loud volume.

---

version 1.0, December 2020
- Initial release</comments>
  <opcodeList>
    <udo>
      <opcodeName>ButtLP</opcodeName>
      <outTypes>a</outTypes>
      <inTypes>akio</inTypes>
      <codeBody>asig,kf,iN,icnt xin
if icnt &gt;= iN goto cont
asig ButtLP asig,kf,iN,icnt+1
cont:
xout butterlp(asig,kf)</codeBody>
      <comments></comments>
    </udo>
  </opcodeList>
  <graphicInterface editEnabled='false'>
    <gridSettings>
      <width>2</width>
      <height>2</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.BSBGroup'>
        <objectName></objectName>
        <x>10</x>
        <y>10</y>
        <groupName>Group</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>20</width>
        <height>20</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
          <objectName>MASTER_DCoffset</objectName>
          <x>70</x>
          <y>245</y>
          <comment>DC blocker</comment>
          <automationAllowed>true</automationAllowed>
          <label>DC</label>
          <selected>true</selected>
          <randomizable>true</randomizable>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>MASTER_Limiter_low</objectName>
          <x>10</x>
          <y>130</y>
          <comment>limits the negative portion of the incoming signal -1 - 0</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>0.0</maximum>
          <bdresolution>0.05</bdresolution>
          <value>-1.0</value>
          <sliderHeight>100</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>20</x>
          <y>220</y>
          <label>-</label>
          <font>
            <name>System Bold</name>
            <size>22.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>18</x>
          <y>10</y>
          <label>+</label>
          <font>
            <name>System Bold</name>
            <size>16.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>50</x>
          <y>225</y>
          <label>frequency</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
          <objectName>MASTER_Limiter</objectName>
          <x>5</x>
          <y>245</y>
          <automationAllowed>true</automationAllowed>
          <label>limit</label>
          <selected>true</selected>
          <randomizable>true</randomizable>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>MASTER_Limiter_high</objectName>
          <x>10</x>
          <y>25</y>
          <comment>limits the positive portion of the incoming signal 0 - 1</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.05</bdresolution>
          <value>1.0</value>
          <sliderHeight>100</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>55</x>
          <y>10</y>
          <label>antialias</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>MASTER_anti alias</objectName>
          <x>55</x>
          <y>25</y>
          <automationAllowed>true</automationAllowed>
          <minimum>10000.0</minimum>
          <maximum>22000.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>22000.0</value>
          <sliderHeight>170</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>10</x>
          <y>110</y>
          <label>____</label>
          <font>
            <name>System Bold</name>
            <size>16.0</size>
          </font>
        </bsbObject>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>MASTEReffectON</objectName>
        <x>0</x>
        <y>0</y>
        <comment>bypass</comment>
        <automationAllowed>true</automationAllowed>
        <label/>
        <selected>true</selected>
        <randomizable>true</randomizable>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='-152405216' name='MASTER_Limiter_low' label='' min='-1.0' max='0.0' bdresolution='0.05' automationEnabled='false' value='-1.0'>
      <line name='' version='2' max='0.0' min='-1.0' bdresolution='0.05' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='-1.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-152405214' name='MASTER_Limiter_high' label='' min='0.0' max='1.0' bdresolution='0.05' automationEnabled='false' value='1.0'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.05' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-152405212' name='MASTEReffectON' 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='-152405192' name='MASTER_DCoffset' 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='-152405188' name='MASTER_anti alias' label='' min='10000.0' max='22000.0' bdresolution='0.1' automationEnabled='false' value='22000.0'>
      <line name='' version='2' max='22000.0' min='10000.0' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='22000.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-152405186' name='MASTER_Limiter' 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>
  </parameterList>
</effect>