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

    aout1, aout2 solina_chorus_stereo ain1, ain2, &lt;Solina_freq1&gt;, &lt;Solina_amp1&gt;, &lt;Solina_freq2&gt;, &lt;Solina_amp2&gt;, &lt;Solina_stereo&gt;
    aout1   ntrpol    ain1, aout1*1.4, &lt;Solina_mix&gt;                             ; create a dry/wet mix
    aout2   ntrpol    ain2, aout2*1.4, &lt;Solina_mix&gt; 

else

    aout1   =   ain1
    aout2   =   ain2

endif
</code>
  <comments>
DESCRIPTION:

Solina Chorus, based on Solina String Ensemble Chorus Module
  
   based on:
   J. Haible: Triple Chorus
   http://jhaible.com/legacy/triple_chorus/triple_chorus.html
   Hugo Portillo: Solina-V String Ensemble
   http://www.native-instruments.com/en/reaktor-community/reaktor-user-library/entry/show/4525/ 
   Parabola tabled shape borrowed from Iain McCurdy delayStereoChorus.csd:
   http://iainmccurdy.org/CsoundRealtimeExamples/Delays/delayStereoChorus.csd
   Author: Steven Yi
   Date: 2016.05.22


CONTROLLERS:

ON/OFF          -       bypass
freq1/2         -       frequency 1 and 2 of LFOs
amp1/2          -       amount of gain of the LFOs
stereo          -       switch to mono or stereo
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 from UDOs by Steven Yi (2016) and tgrey (2016). tgrey added a stereo option.</comments>
  <opcodeList>
    <udo>
      <opcodeName>sol_lfo_3</opcodeName>
      <outTypes>aaa</outTypes>
      <inTypes>kkk</inTypes>
      <codeBody>kfreq, kamp, ksplit xin

isolina_parabola ftgen 0, 0, 65537, 19, 0.5, 1, 180, 1 

  aphs1 phasor kfreq
  aphs2 phasor kfreq, .5

  ksplit port ksplit, .0825                                                       ; smooth switch of ksplit to avoid clicks
  asplit interp ksplit
  aphs = (aphs2 * asplit)+(aphs1 * (1 - asplit))

  a0   tablei   aphs, isolina_parabola, 1, 0, 1
  a120 tablei   aphs, isolina_parabola, 1, 0.333, 1
  a240 tablei   aphs, isolina_parabola, 1, -0.333, 1

  xout (a0 * kamp), (a120 * kamp), (a240 * kamp)
</codeBody>
      <comments></comments>
    </udo>
    <udo>
      <opcodeName>solina_chorus_stereo</opcodeName>
      <outTypes>aa</outTypes>
      <inTypes>aakkkkk</inTypes>
      <codeBody>  aLeft, aRight, klfo_freq1, klfo_amp1, klfo_freq2, klfo_amp2, ksplit xin

  imax = 100

  ;; slow lfo
  as1, as2, as3 sol_lfo_3 klfo_freq1, klfo_amp1, 0
  ;; fast lfo
  af1, af2, af3  sol_lfo_3 klfo_freq2, klfo_amp2, 0
;;; slow lfo
  asr1, asr2, asr3 sol_lfo_3 klfo_freq1, klfo_amp1, ksplit
;  ;; fast lfo
  afr1, afr2, afr3  sol_lfo_3 klfo_freq2, klfo_amp2, ksplit

  at1 = limit(as1 + af1 + 5, 0.0, imax)
  at2 = limit(as2 + af2 + 5, 0.0, imax)
  at3 = limit(as3 + af3 + 5, 0.0, imax)

  atr1 = limit(asr1 + afr1 + 5, 0.0, imax)
  atr2 = limit(asr2 + afr2 + 5, 0.0, imax)
  atr3 = limit(asr3 + afr3 + 5, 0.0, imax)

  aL1 vdelay3 aLeft, at1, imax 
  aL2 vdelay3 aLeft, at2, imax 
  aL3 vdelay3 aLeft, at3, imax 

  aR1 vdelay3 aRight, atr1, imax 
  aR2 vdelay3 aRight, atr2, imax 
  aR3 vdelay3 aRight, atr3, imax 

xout (aL1 + aL2 + aL3) * .3, (aR1 + aR2 + aR3) * .3
</codeBody>
      <comments></comments>
    </udo>
  </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.BSBGroup'>
        <objectName></objectName>
        <x>10</x>
        <y>10</y>
        <groupName>SolinaStereo</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>251</width>
        <height>119</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>Solina_mix</objectName>
          <x>10</x>
          <y>95</y>
          <comment>mix direct signal with effect</comment>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>0.9</value>
          <sliderWidth>240</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>215</x>
          <y>15</y>
          <label>stereo</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
          <objectName>Solina_stereo</objectName>
          <x>225</x>
          <y>35</y>
          <comment>switch to mono or stereo</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>0x00000033</backgroundColor>
          <borderColor>0x000000ff</borderColor>
          <labelTextColor>0xffffffff</labelTextColor>
          <titleEnabled>false</titleEnabled>
          <width>20</width>
          <height>20</height>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
            <objectName>Solina_freq1</objectName>
            <x>5</x>
            <y>5</y>
            <comment>frequency 1 of LFOs</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>0.0</minimum>
            <maximum>10.0</maximum>
            <value>0.18</value>
            <knobWidth>40</knobWidth>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>true</valueDisplayEnabled>
            <label>freq 1</label>
            <labelEnabled>true</labelEnabled>
            <font>
              <name>System Regular</name>
              <size>12.0</size>
            </font>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
            <objectName>Solina_amp1</objectName>
            <x>55</x>
            <y>15</y>
            <comment>amount of gain of the LFO 1</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>0.0</minimum>
            <maximum>1.0</maximum>
            <bdresolution>0.01</bdresolution>
            <value>0.72</value>
            <sliderHeight>60</sliderHeight>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>false</valueDisplayEnabled>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
            <objectName></objectName>
            <x>155</x>
            <y>5</y>
            <label>amp 2</label>
            <font>
              <name>System Regular</name>
              <size>12.0</size>
            </font>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
            <objectName>Solina_amp2</objectName>
            <x>155</x>
            <y>15</y>
            <comment>amount of gain of the LFO 2</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>0.0</minimum>
            <maximum>1.0</maximum>
            <bdresolution>0.01</bdresolution>
            <value>0.6</value>
            <sliderHeight>60</sliderHeight>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>false</valueDisplayEnabled>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
            <objectName>Solina_freq2</objectName>
            <x>105</x>
            <y>5</y>
            <comment>frequency 2 of LFOs</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>0.0</minimum>
            <maximum>10.0</maximum>
            <value>1.7000000000000002</value>
            <knobWidth>40</knobWidth>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>true</valueDisplayEnabled>
            <label>freq 2</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>55</x>
            <y>5</y>
            <label>amp 1</label>
            <font>
              <name>System Regular</name>
              <size>12.0</size>
            </font>
          </bsbObject>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>220</x>
          <y>90</y>
          <label>mix</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>SolinaON</objectName>
        <x>0</x>
        <y>0</y>
        <comment>bypass</comment>
        <automationAllowed>true</automationAllowed>
        <label/>
        <selected>true</selected>
        <randomizable>true</randomizable>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='1983022423' name='Solina_mix' label='' min='0.0' max='1.0' bdresolution='0.1' automationEnabled='false' value='0.9'>
      <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.9'/>
      </line>
    </parameter>
    <parameter uniqueId='1983022429' name='Solina_stereo' 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='-1702103412' name='Solina_amp1' label='' min='0.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.72'>
      <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.72'/>
      </line>
    </parameter>
    <parameter uniqueId='-1702103410' name='Solina_freq2' label='' min='0.0' max='10.0' bdresolution='-1' automationEnabled='false' value='1.7000000000000002'>
      <line name='' version='2' max='10.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.7000000000000002'/>
      </line>
    </parameter>
    <parameter uniqueId='-1702103408' name='Solina_freq1' label='' min='0.0' max='10.0' bdresolution='-1' automationEnabled='false' value='0.18'>
      <line name='' version='2' max='10.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.18'/>
      </line>
    </parameter>
    <parameter uniqueId='-1702103406' name='Solina_amp2' label='' min='0.0' max='1.0' bdresolution='0.01' automationEnabled='false' value='0.6'>
      <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.6'/>
      </line>
    </parameter>
    <parameter uniqueId='-2045773747' name='SolinaON' 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>