<effect>
  <name>Chopper</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;ChopperON&gt; == 1) then
    kgoto perform
    iDcsize	= 256
    iDcAtk  = i(&lt;Chopper_Attack&gt;)

    iTable  ftgentmp	0,0,iDcsize,-7,0
    iDeclick ftgentmp	0,0,iDcsize,7,0, iDcAtk,1, iDcsize -  2*iDcAtk,1, iDcAtk, 0
    iGate = &lt;Chopper_Pattern1&gt; * 16 + &lt;Chopper_Pattern2&gt;
    iMask = 128
    iIdx = 0
    iFill = iDcsize / 8

    loop:
	iVal = iGate &amp; iMask
	iVal = (iVal &gt; 0) ? 1 : i(&lt;Chopper_Smooth&gt;)
	iIdx fillTableI iTable, iIdx, 32, iVal
	iMask = iMask / 2
    if iIdx &lt; iDcsize igoto loop

    perform:
    kTempo miditempo
    kTempo = 60 / kTempo * &lt;Chopper_Time&gt; * 4
    kDc = kTempo/8
    kp phasor 1/kTempo
    kc phasor 1/kDc

    kAmp table kp,iTable,1
    kenv table kc,iDeclick,1

    aout1 = ain1 * kAmp * kenv
    aout2 = ain2 * kAmp * kenv

else
    aout1   =   ain1
    aout2   =   ain2
endif</code>
  <comments>EFFECT TO BE USED WITH COMMANDLINE -t x (where x = bpm)!!

DESCRIPTION:

chops up the incoming signal, creating a pulsating effect.


CONTROLLERS:

ON/OFF          -       bypass
Nr. Bars        -       length of bar
Pattern 1/2     -       patterns in gates
Smooth          -       
Declick         -       change attack time
---

version 1.11, May 20202
- added comments on controllers

version 1.1, 2017
- new GUI and small code adaptations by Menno Knevel

version 1.0, ?
- initial version by ?</comments>
  <opcodeList>
    <udo>
      <opcodeName>fillTableI</opcodeName>
      <outTypes>i</outTypes>
      <inTypes>iiii</inTypes>
      <codeBody>iTable, iStart, iTimes, iVal xin

loop:
tableiw iVal, iStart, iTable
iStart = iStart + 1
loop_gt iTimes, 1, 0, loop

xout iStart
</codeBody>
      <comments></comments>
    </udo>
  </opcodeList>
  <graphicInterface editEnabled='false'>
    <gridSettings>
      <width>2</width>
      <height>5</height>
      <gridStyle>LINE</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/>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>220</width>
        <height>89</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>70</x>
          <y>5</y>
          <label>Nr Bars</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>Chopper_Smooth</objectName>
          <x>220</x>
          <y>10</y>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <value>0.5042247</value>
          <knobWidth>40</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
          <label>Smooth</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>30</x>
          <y>40</y>
          <label>Pattern1</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>100</x>
          <y>40</y>
          <label>Pattern2</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>Chopper_Attack</objectName>
          <x>285</x>
          <y>10</y>
          <automationAllowed>true</automationAllowed>
          <minimum>5.0</minimum>
          <maximum>64.0</maximum>
          <value>26.92003</value>
          <knobWidth>40</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
          <label>Declick</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown' version='2'>
          <objectName>Chopper_Pattern1</objectName>
          <x>28</x>
          <y>55</y>
          <automationAllowed>false</automationAllowed>
          <selectedIndex>5</selectedIndex>
          <fontSize>12</fontSize>
          <randomizable>true</randomizable>
          <bsbDropdownItemList>
            <bsbDropdownItem uniqueId='566589852'>
              <name>0000</name>
              <value>0</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589853'>
              <name>0001</name>
              <value>1</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589854'>
              <name>0010</name>
              <value>2</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589855'>
              <name>0011</name>
              <value>3</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589856'>
              <name>0100</name>
              <value>4</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589857'>
              <name>0101</name>
              <value>5</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589858'>
              <name>0110</name>
              <value>6</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589859'>
              <name>0111</name>
              <value>7</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589860'>
              <name>1000</name>
              <value>8</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589861'>
              <name>1001</name>
              <value>9</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589862'>
              <name>1010</name>
              <value>10</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589863'>
              <name>1011</name>
              <value>11</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589864'>
              <name>1100</name>
              <value>12</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589865'>
              <name>1101</name>
              <value>13</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589866'>
              <name>1110</name>
              <value>14</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589867'>
              <name>1111</name>
              <value>15</value>
            </bsbDropdownItem>
          </bsbDropdownItemList>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown' version='2'>
          <objectName>Chopper_Pattern2</objectName>
          <x>99</x>
          <y>55</y>
          <automationAllowed>false</automationAllowed>
          <selectedIndex>2</selectedIndex>
          <fontSize>12</fontSize>
          <randomizable>true</randomizable>
          <bsbDropdownItemList>
            <bsbDropdownItem uniqueId='566589868'>
              <name>0000</name>
              <value>0</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589869'>
              <name>0001</name>
              <value>1</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589870'>
              <name>0010</name>
              <value>2</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589871'>
              <name>0011</name>
              <value>3</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589872'>
              <name>0100</name>
              <value>4</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589873'>
              <name>0101</name>
              <value>5</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589874'>
              <name>0110</name>
              <value>6</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589875'>
              <name>0111</name>
              <value>7</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589876'>
              <name>1000</name>
              <value>8</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589877'>
              <name>1001</name>
              <value>9</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589878'>
              <name>1010</name>
              <value>10</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589879'>
              <name>1011</name>
              <value>11</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589880'>
              <name>1100</name>
              <value>12</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589881'>
              <name>1101</name>
              <value>13</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589882'>
              <name>1110</name>
              <value>14</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='566589883'>
              <name>1111</name>
              <value>15</value>
            </bsbDropdownItem>
          </bsbDropdownItemList>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>Chopper_Time</objectName>
          <x>10</x>
          <y>10</y>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>4.0</maximum>
          <bdresolution>0.125</bdresolution>
          <value>0.75</value>
          <sliderWidth>150</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>ChopperON</objectName>
        <x>0</x>
        <y>0</y>
        <automationAllowed>true</automationAllowed>
        <label/>
        <selected>true</selected>
        <randomizable>true</randomizable>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='566589885' name='Chopper_Smooth' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.5042247'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.5042247'/>
      </line>
    </parameter>
    <parameter uniqueId='566589887' name='Chopper_Time' label='' min='0.0' max='4.0' bdresolution='0.125' automationEnabled='false' value='0.75'>
      <line name='' version='2' max='4.0' min='0.0' bdresolution='0.125' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.75'/>
      </line>
    </parameter>
    <parameter uniqueId='566589889' name='Chopper_Attack' label='' min='5.0' max='64.0' bdresolution='-1' automationEnabled='false' value='26.92003'>
      <line name='' version='2' max='64.0' min='5.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='26.92003'/>
      </line>
    </parameter>
    <parameter uniqueId='566589891' name='ChopperON' 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>