<effect>
  <name>ladspa harmonic gen</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;ladspa_harmonicgenON&gt; == 1) then
    ihandle dssiinit &quot;&lt;ladspa_harmonicgen_ladspa&gt;&quot;, 0, 0
    ain =   (ain1 + ain2)*.5
    dssiactivate ihandle, 1
;	
    dssictls ihandle, 0, &lt;ladspa_harmonicgen_Fundamental&gt;, 1                                       ; (-1 to 1)
    dssictls ihandle, 1, &lt;ladspa_harmonicgen_2nd harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 2, &lt;ladspa_harmonicgen_3rd harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 3, &lt;ladspa_harmonicgen_4th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 4, &lt;ladspa_harmonicgen_5th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 5, &lt;ladspa_harmonicgen_6th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 6, &lt;ladspa_harmonicgen_7th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 7, &lt;ladspa_harmonicgen_8th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 8, &lt;ladspa_harmonicgen_9th harmonic&gt;, 1                                      ; (-1 to 1)
    dssictls ihandle, 9, &lt;ladspa_harmonicgen_10th harmonic&gt;, 1                                     ; (-1 to 1)

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

</code>
  <comments>a wrapper of ladspa plugin 1220 called Harmonic generator, created by Steve Harris. Copyright: The GNU General Public Licence.
plugin has mono inputs, mono outputs.

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:

Allows you to add harmonics and remove the fundamental from any audio signal.


CONTROLLERS:

ON/OFF              -       bypass
File Selector       -       set path for harmonic_gen_1220.so
Fundamental         -       The amplitude of the fundamental of the signal, reduce it to 0 to remove the base signal altogether, or -1 to phase invert it
2/3...10th harmonic -       The 2/3...10th harmonic, its frequency is 2/3...10 times the frequency of the fundamental

---

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='true'>
    <gridSettings>
      <width>5</width>
      <height>10</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_harmonicgenON</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>90</y>
          <label>2nd harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_2nd harmonic</objectName>
          <x>10</x>
          <y>80</y>
          <comment>2 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>270</y>
          <label>8th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBFileSelector'>
          <objectName>ladspa_harmonicgen_ladspa</objectName>
          <x>10</x>
          <y>10</y>
          <comment>set path for harmonic_gen_1220.so</comment>
          <fileName>/usr/lib/ladspa/harmonic_gen_1220.so</fileName>
          <textFieldWidth>280</textFieldWidth>
          <stringChannelEnabled>false</stringChannelEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_5th harmonic</objectName>
          <x>10</x>
          <y>170</y>
          <comment>5 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>150</y>
          <label>4th harmonic</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>60</y>
          <label>Fundamental</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>240</y>
          <label>7th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_8th harmonic</objectName>
          <x>10</x>
          <y>260</y>
          <comment>8 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>180</y>
          <label>5th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_3rd harmonic</objectName>
          <x>10</x>
          <y>110</y>
          <comment>3 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.0</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_7th harmonic</objectName>
          <x>10</x>
          <y>230</y>
          <comment>7 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>330</y>
          <label>10th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_10th harmonic</objectName>
          <x>10</x>
          <y>320</y>
          <comment>10 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>300</y>
          <label>9th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_9th harmonic</objectName>
          <x>10</x>
          <y>290</y>
          <comment>9 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>210</y>
          <label>6th harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_4th harmonic</objectName>
          <x>10</x>
          <y>140</y>
          <comment>4 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.0</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_Fundamental</objectName>
          <x>10</x>
          <y>50</y>
          <comment>The amplitude of the fundamental of the signal, reduce it to 0 to remove the base signal altogether, or -1 to phase invert it</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.0</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>ladspa_harmonicgen_6th harmonic</objectName>
          <x>10</x>
          <y>200</y>
          <comment>6 times the frequency of the fundamental</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>-1.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.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>120</y>
          <label>3rd harmonic</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='-1879271817' name='ladspa_harmonicgen_9th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271815' name='ladspa_harmonicgen_5th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271813' name='ladspa_harmonicgen_7th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271811' name='ladspa_harmonicgen_2nd harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271809' name='ladspa_harmonicgen_Fundamental' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271807' name='ladspa_harmonicgen_4th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271805' name='ladspa_harmonicgen_8th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271803' name='ladspa_harmonicgen_3rd harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271801' name='ladspa_harmonicgen_10th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271799' name='ladspa_harmonicgen_6th harmonic' label='' min='-1.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='-1.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='-1879271797' name='ladspa_harmonicgenON' 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>