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

    krate   =   &lt;StChorus_rate&gt;
    krate	expcurve	krate,20					;CREATE AN EXPONENTIAL REMAPPING OF krate
    krate	scale           krate,7,0.001                                   ;RESCALE VALUE
    ilfoshape	ftgentmp	0, 0, 131072, 19, 1, 0.5, 0,  0.5               ;POSITIVE DOMAIN ONLY SINE WAVE	
    kporttime	linseg          0,0.001,0.02                                    ;RAMPING UP PORTAMENTO VARIABLE
    kChoDepth	portk           &lt;StChorus_depth&gt;*0.01, kporttime                ;SMOOTH VARIABLE CHANGES WITH PORTK
    aChoDepth	interp          kChoDepth                                       ;INTERPOLATE TO CREATE A-RATE VERSION OF K-RATE VARIABLE
    amodL 	osciliktp 	krate, ilfoshape, 0                             ;LEFT CHANNEL LFO
    amodR 	osciliktp 	krate, ilfoshape, &lt;StChorus_width&gt;*0.5          ;THE PHASE OF THE RIGHT CHANNEL LFO IS ADJUSTABLE
    amodL	=		(amodL*aChoDepth)+.01                           ;RESCALE AND OFFSET LFO (LEFT CHANNEL)
    amodR	=		(amodR*aChoDepth)+.01                           ;RESCALE AND OFFSET LFO (RIGHT CHANNEL)
    aChoL	vdelay          ain1, amodL*1000, 1.2*1000                      ;CREATE VARYING DELAYED / CHORUSED SIGNAL (LEFT CHANNEL) 
    aChoR	vdelay          ain2, amodR*1000, 1.2*1000                      ;CREATE VARYING DELAYED / CHORUSED SIGNAL (RIGHT CHANNEL)

    aout1       ntrpol          ain1, aChoL, &lt;StChorus_mix&gt;                     ; create a dry/wet mix
    aout2       ntrpol          ain2, aChoR, &lt;StChorus_mix&gt; 

else

    aout1   =   ain1
    aout2   =   ain2

endif</code>
  <comments>
DESCRIPTION:

A stereo chorus effect


CONTROLLERS:

ON/OFF          -       bypass
rate            -       rate control of the lfo of the effect *NOT IN HERTZ* (range 0 to 1)
depth           -       depth of the lfo of the effect (range 0 to 1)
width           -       width of stereo widening (range 0 to 1)
mix             -       mix direct signal with effect

---

version 1.01, July 2020
- added BSB information comments

version 1.0, Juin 2020
- initial version by Menno Knevel
- slightly adapted code using a UDO by Iain McCurdy (2012, http://iainmccurdy.org/csound.html)</comments>
  <opcodeList/>
  <graphicInterface editEnabled='false'>
    <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>StChorusON</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>StChorus</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>149</width>
        <height>20</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>StChorus_rate</objectName>
          <x>10</x>
          <y>10</y>
          <comment>rate control of the lfo of the effect *NOT IN HERTZ*</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <value>0.19</value>
          <knobWidth>40</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
          <label>rate</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>StChorus_width</objectName>
          <x>10</x>
          <y>65</y>
          <comment>width of stereo widening</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.001</bdresolution>
          <value>0.558</value>
          <sliderWidth>100</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>45</x>
          <y>60</y>
          <label>width</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
          <objectName>StChorus_depth</objectName>
          <x>60</x>
          <y>10</y>
          <comment>depth of the lfo of the effect</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <value>0.51</value>
          <knobWidth>40</knobWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
          <label>depth</label>
          <labelEnabled>true</labelEnabled>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>StChorus_mix</objectName>
          <x>110</x>
          <y>20</y>
          <comment>mix direct signal with effect</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.001</bdresolution>
          <value>0.518</value>
          <sliderHeight>65</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>115</x>
          <y>10</y>
          <label>mix</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='1946956475' name='StChorusON' 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='1946956477' name='StChorus_rate' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.19'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.19'/>
      </line>
    </parameter>
    <parameter uniqueId='1946956479' name='StChorus_depth' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.51'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.51'/>
      </line>
    </parameter>
    <parameter uniqueId='1946956481' name='StChorus_width' label='' min='0.0' max='1.0' bdresolution='0.001' automationEnabled='false' value='0.558'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.001' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.558'/>
      </line>
    </parameter>
    <parameter uniqueId='1946956483' name='StChorus_mix' label='' min='0.0' max='1.0' bdresolution='0.001' automationEnabled='false' value='0.518'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.001' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.518'/>
      </line>
    </parameter>
  </parameterList>
</effect>