<effect>
  <name>ladspa divider</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;ladspa_dividerON&gt; == 1) then
    ain =   (ain1 +ain2)*.5                                                     ; mix inputs to mono
    ihandle dssiinit &quot;&lt;ladspa_divider_ladspa&gt;&quot;, 0, 0

    dssiactivate ihandle, 1
	
    dssictls ihandle, 0, &lt;ladspa_divider_Denominator&gt;, 1                                       ; (-30 to 30)

    aout1 dssiaudio ihandle, ain                                                ; mono in, mono out
    aout1 butterlp aout1, &lt;ladspa_divider_frequency&gt;                                           ; filter lowpass
    aout1 = (ain * &lt;ladspa_divider_wetdry&gt;) + (aout1 * (1 - &lt;ladspa_divider_wetdry&gt;))
    aout2   =   aout1
else
    aout1   =   ain1
    aout2   =   ain2
endif

</code>
  <comments>a wrapper of ladspa plugin called Audio Divider, created by Steve Harris. Copyright: The GNU General Public Licence.

The dssi opcodes are wrapping the ladspa plugin so it can be used as an effect for 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:

Reduces the period of the signal by the factor given, and makes it a square wave in the process. 
Has some amplitude tracking capability, but not really useful on complex signals.


CONTROLLERS:

ON/OFF                  -       bypass
File Selector           -       set path for divider_1186.so
Denominator             -       The factor the incoming frequency will be divided by
Mix                     -       mix direct signal with effect
Frequency               -       low pass filter

---

version 1.01
- added comments on controllers

version 1.0, June 2019
- new GUI and small code adaptations by Menno Knevel
- added mixer wet/dry and frequency lowpass filter</comments>
  <opcodeList/>
  <graphicInterface editEnabled='true'>
    <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.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.BSBHSlider' version='2'>
          <objectName>ladspa_divider_frequency</objectName>
          <x>10</x>
          <y>110</y>
          <automationAllowed>true</automationAllowed>
          <minimum>50.0</minimum>
          <maximum>1000.0</maximum>
          <bdresolution>1</bdresolution>
          <value>120.0</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>90</y>
          <label>Mix</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>120</y>
          <label>Frequency</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_divider_wetdry</objectName>
          <x>10</x>
          <y>80</y>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>0.5</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>60</y>
          <label>Denominator</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_divider_Denominator</objectName>
          <x>10</x>
          <y>50</y>
          <automationAllowed>true</automationAllowed>
          <minimum>1.0</minimum>
          <maximum>8.0</maximum>
          <bdresolution>0.002</bdresolution>
          <value>4.5</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBFileSelector'>
          <objectName>ladspa_divider_ladspa</objectName>
          <x>10</x>
          <y>10</y>
          <fileName>/usr/lib/ladspa/divider_1186.so</fileName>
          <textFieldWidth>250</textFieldWidth>
          <stringChannelEnabled>false</stringChannelEnabled>
        </bsbObject>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>ladspa_dividerON</objectName>
        <x>0</x>
        <y>0</y>
        <automationAllowed>true</automationAllowed>
        <label/>
        <selected>true</selected>
        <randomizable>true</randomizable>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='-1970860127' name='ladspa_divider_wetdry' label='' min='0.0' max='1.0' bdresolution='0.1' automationEnabled='false' value='0.5'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.5'/>
      </line>
    </parameter>
    <parameter uniqueId='-1970860125' name='ladspa_divider_frequency' label='' min='50.0' max='1000.0' bdresolution='1' automationEnabled='false' value='120.0'>
      <line name='' version='2' max='1000.0' min='50.0' bdresolution='1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='120.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1970860123' name='ladspa_divider_Denominator' label='' min='1.0' max='8.0' bdresolution='0.002' automationEnabled='false' value='4.5'>
      <line name='' version='2' max='8.0' min='1.0' bdresolution='0.002' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='4.5'/>
      </line>
    </parameter>
    <parameter uniqueId='-1970860121' name='ladspa_dividerON' 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>