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

    kjitter jitter  &lt;Grate_jitter depth&gt;, &lt;Grate_jitter min&gt;, &lt;Grate_jitter max&gt;
    if (&lt;stereoize&gt; == 1) then
        kpanl   =   sin(-kjitter)                                               ; create stereo effect if mono
    else
        kpanl   =   sin(kjitter)                                                ; on stereo input
    endif
    kpanr   =   sin(kjitter)
    aout1   =   ain1 * kpanl
    aout2   =   ain2 * kpanr
    aout1   ntrpol    ain1, aout1 * 2, &lt;Grate_wetdry&gt;                           ; create a dry/wet mix
    aout2   ntrpol    ain2, aout2 * 2, &lt;Grate_wetdry&gt; 

else
    aout1   =   ain1
    aout2   =   ain2
endif</code>
  <comments>
DESCRIPTION:

Grate &apos;scrapes&apos; the incoming sound and applies irregular small amplitude changes to it.
With low min and max frequency settings, it creates a wide stereo sound, with higher settings the scraping begins.


CONTROLLERS:

see the help balloon when hovering over the controllers in the instrument. Help can be turned off by pressing the &apos;I&apos; button next to the play bar.


---

version 1.1, December 2020
- added stereoizer, that creates stereo image for mono sound

version 1.0, December 2020
- initial version
</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.BSBCheckBox'>
        <objectName>GrateON</objectName>
        <x>0</x>
        <y>0</y>
        <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>ReverbSC</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>170</width>
        <height>20</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>Grate_jitter max</objectName>
          <x>110</x>
          <y>10</y>
          <comment>maximum limit of jitter frequency</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>100.0</maximum>
          <value>100.0</value>
          <knobWidth>35</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
          <label>max</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>Grate_wetdry</objectName>
          <x>200</x>
          <y>25</y>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.01</bdresolution>
          <value>0.56</value>
          <sliderHeight>50</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>Grate_jitter min</objectName>
          <x>65</x>
          <y>10</y>
          <comment>minimum limit of jitter frequency</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>100.0</maximum>
          <value>69.0</value>
          <knobWidth>35</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
          <label>min</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>Grate_jitter depth</objectName>
          <x>10</x>
          <y>10</y>
          <comment>depth of jitter</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <value>0.53</value>
          <knobWidth>35</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
          <label>jitteramp</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>205</x>
          <y>10</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>150</x>
          <y>60</y>
          <label>stereoize</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
          <objectName>stereoize</objectName>
          <x>165</x>
          <y>40</y>
          <comment>adds stereo amplitude variancies so a mono sound gets a wider stereo image</comment>
          <automationAllowed>true</automationAllowed>
          <label/>
          <selected>true</selected>
          <randomizable>true</randomizable>
        </bsbObject>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='752290367' name='Grate_jitter max' label='' min='0.0' max='100.0' bdresolution='-1' automationEnabled='false' value='100.0'>
      <line name='' version='2' max='100.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='100.0'/>
      </line>
    </parameter>
    <parameter uniqueId='752290371' name='Grate_jitter min' label='' min='0.0' max='100.0' bdresolution='-1' automationEnabled='false' value='69.0'>
      <line name='' version='2' max='100.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='69.0'/>
      </line>
    </parameter>
    <parameter uniqueId='752290373' name='Grate_jitter depth' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.53'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.53'/>
      </line>
    </parameter>
    <parameter uniqueId='752290375' name='GrateON' 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='752301129' name='Grate_wetdry' label='' min='0.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.56'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.01' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.56'/>
      </line>
    </parameter>
    <parameter uniqueId='879387062' name='stereoize' 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>