<effect>
  <name>Fluxy</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;FluxyON&gt; == 1) then
    kwet    =   &lt;Fluxy_positionY&gt;                                                            ;mix wet/dry
    kdry    =   1 - kwet

;=========================equalize==============================================

    ain =   (ain1 + ain2)*.5
if &lt;Fluxy_colorON&gt; == 1 then
    ainL eqfil ain, 125,60, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 200,50, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 250,60, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 300,75, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 375,125, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 500,200, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 750,250, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 1000,250, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 1500,500, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 2000,500, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 3000,700, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 4000,2000, 1-&lt;Fluxy_color&gt;
    ainL eqfil ainL, 8000,4000, &lt;Fluxy_color&gt;
    ainL eqfil -(ainL), 16000,8000, 1-&lt;Fluxy_color&gt;

    ainR eqfil ain, 125,60, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 200,50, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 250,60, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 300,75, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 375,125, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 500,200, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 750,250, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 1000,250, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 1500,500, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 2000,500, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 3000,700, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 4000,2000, &lt;Fluxy_color&gt;
    ainR eqfil -(ainR), 8000,4000, 1-&lt;Fluxy_color&gt;
    ainR eqfil ainR, 16000,8000, &lt;Fluxy_color&gt;

    ainLL eqfil ainL, 5000,5000, &lt;Fluxy_treble&gt;
    ainRR eqfil ainR, 5000,5000, &lt;Fluxy_treble&gt; 

    asubL   =   ainL + ainLL
    asubR   =   ainR + ainRR
else
asubL   =   ain
asubR   =   asubL
endif

    kpan   scale    &lt;Fluxy_positionX&gt;, 0.2, .8    
    awetL, awetR   pan2    asubL, 1 - kpan
    awetL, awetR   pan2    asubR, kpan

;==================================================================

    if &lt;Fluxy_preset impulse&gt; == 0 then
        strset  10000, &quot;/media/menno/datae/csounddata/Impulses/preset1.wav&quot;     ; assign number 1000 to IR
    elseif &lt;Fluxy_preset impulse&gt; == 1 then
        strset  10000, &quot;/media/menno/datae/csounddata/Impulses/preset2.wav&quot;
    elseif &lt;Fluxy_preset impulse&gt; == 2 then
        strset  10000, &quot;/media/menno/datae/csounddata/Impulses/preset3.wav&quot;
    else
        strset  10000, &quot;&lt;Fluxy_impulseResponse&gt;&quot; 
    endif

    ivld      filevalid 10000                                                    ; check if valid impilse is imported
    if ivld &gt; 0 then
    iNrChannels filenchnls  10000

    ipartitionsize = &lt;Fluxy_paritionSize&gt;                                             ;for best performance, this parameter needs to be tweaked

    idel    = (ksmps &lt; ipartitionsize ? ipartitionsize + ksmps : ipartitionsize)/sr ;calculate latency of pconvolve opcode
    if (&lt;Fluxy_check delay&gt; == 1) then
        prints &quot;\nConvolving with a latency of %f seconds%\n&quot;, idel
    endif
    awetl1, awetrx1 pconvolve    awetL, 10000, ipartitionsize
    awetlx2, awetr2 pconvolve    awetR, 10000, ipartitionsize

    adry   delay   kdry * ain, idel                                             ;delay dry signal, to align it with the convoled sig
    kdrysource   =   1-&lt;Fluxy_positionY&gt;
    adryl, adryr   pan2    adry * 1.7 * kdrysource, &lt;Fluxy_positionX&gt;                ; compensate for fron &lt;--&gt; rear amplitude

    aout1   ntrpol adryl, awetl1, &lt;Fluxy_positionY&gt; 
    aout2   ntrpol adryr, awetr2, &lt;Fluxy_positionY&gt; 

    else
        prints &quot;\n\n\nNO OR INVALID IMPULSE. PLEASE ENTER ONE!!\nEFFECT IS NOT WORKING, YOU HEAR THE DIRECT SIGNAL ONLY.\n\n\n&quot;
        aout1 = ain1
        aout2 = ain2       
    endif

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

This effect is meant for mono signal input only!!
The goal of this effect is to give a mono sound some width and ambiance. (if the source is stereo, switch it to mono using the Xpan effect, available from BlueShare)

This effect needs some extra impulses to work correctly. As it is, at the moment, impossible to append extra files to effects or instruments and upload these as a package to BlueShare,
 you have to download them seperately: https://github.com/tjingboem/impulses. Preset1, preset2 and preset3.
Download, unzip and change the path in the Fluxy code so that Fluxy will find those files.

Normal usage: 1 or more Mixerstrips, each producing a mono output, must get copies of the same Fluxy effect with the same ambiance but with different pan settings on each effect.
Result: several mono signals appear to be playing together in the same room, instead of staying alone in their respective corners.


CONTROLLERS:

ON/OFF              -       bypass
Impulse             -       3 presets and 1 impulse of choice. (The 3 preset impulses are included)
paritionSize        -       tweak for balance in speed and CPU load
treble              -       boosts the treble. Compensates for sounds that are positioned in the rear.
position mono signal -      left/right panning and front/rear positioning

---
version 1.1, January 2022
- changed panorama and distance sliders to XY position

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='false'>
    <gridSettings>
      <width>2</width>
      <height>2</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>
      <font>
        <name>Roboto</name>
        <size>12.0</size>
        <style>0</style>
      </font>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
        <objectName></objectName>
        <x>10</x>
        <y>10</y>
        <groupName>Group</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>20</width>
        <height>20</height>
        <font>
          <name>Roboto</name>
          <size>12.0</size>
          <style>0</style>
        </font>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
          <objectName></objectName>
          <x>10</x>
          <y>10</y>
          <groupName>impulse</groupName>
          <backgroundColor>0x4d8080ff</backgroundColor>
          <borderColor>0x000000ff</borderColor>
          <labelTextColor>0xffffffff</labelTextColor>
          <titleEnabled>true</titleEnabled>
          <width>20</width>
          <height>146</height>
          <font>
            <name>Roboto</name>
            <size>12.0</size>
            <style>0</style>
          </font>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
            <objectName>Fluxy_treble</objectName>
            <x>238</x>
            <y>70</y>
            <comment>boosts the treble. Compensates for sounds that are positioned in the rear.</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>1.0</minimum>
            <maximum>5.0</maximum>
            <bdresolution>0.1</bdresolution>
            <value>1.0</value>
            <sliderWidth>150</sliderWidth>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>false</valueDisplayEnabled>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
            <objectName></objectName>
            <x>248</x>
            <y>12</y>
            <label>partition size:</label>
            <font>
              <name>Roboto</name>
              <size>12.0</size>
              <style>0</style>
            </font>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
            <objectName>Fluxy_colorON</objectName>
            <x>12</x>
            <y>75</y>
            <comment>activate filter</comment>
            <automationAllowed>true</automationAllowed>
            <label/>
            <selected>false</selected>
            <randomizable>true</randomizable>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown' version='2'>
            <objectName>Fluxy_paritionSize</objectName>
            <x>325</x>
            <y>10</y>
            <comment>tweak for balance in speed and CPU load</comment>
            <automationAllowed>false</automationAllowed>
            <selectedIndex>10</selectedIndex>
            <fontSize>12</fontSize>
            <randomizable>true</randomizable>
            <bsbDropdownItemList>
              <bsbDropdownItem uniqueId='-184334209'>
                <name>1</name>
                <value>1</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334208'>
                <name>2</name>
                <value>2</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334207'>
                <name>4</name>
                <value>4</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334206'>
                <name>8</name>
                <value>8</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334205'>
                <name>16</name>
                <value>16</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334204'>
                <name>32</name>
                <value>32</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334203'>
                <name>64</name>
                <value>64</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334202'>
                <name>128</name>
                <value>128</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334201'>
                <name>256</name>
                <value>256</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334200'>
                <name>512</name>
                <value>512</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334199'>
                <name>1024</name>
                <value>1024</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334198'>
                <name>2048</name>
                <value>2048</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334197'>
                <name>4096</name>
                <value>4096</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334196'>
                <name>8192</name>
                <value>8192</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='-184334195'>
                <name>16384</name>
                <value>16384</value>
              </bsbDropdownItem>
            </bsbDropdownItemList>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBGroup'>
            <objectName></objectName>
            <x>12</x>
            <y>105</y>
            <groupName>position mono signal</groupName>
            <backgroundColor>0x4d8080ff</backgroundColor>
            <borderColor>0x1a4d4dff</borderColor>
            <labelTextColor>0xffffffff</labelTextColor>
            <titleEnabled>true</titleEnabled>
            <width>382</width>
            <height>20</height>
            <font>
              <name>Roboto</name>
              <size>12.0</size>
              <style>0</style>
            </font>
            <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
              <objectName></objectName>
              <x>170</x>
              <y>2</y>
              <label>rear</label>
              <font>
                <name>Roboto</name>
                <size>12.0</size>
                <style>0</style>
              </font>
            </bsbObject>
            <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
              <objectName></objectName>
              <x>166</x>
              <y>94</y>
              <label>front</label>
              <font>
                <name>Roboto</name>
                <size>12.0</size>
                <style>0</style>
              </font>
            </bsbObject>
            <bsbObject type='blue.orchestra.blueSynthBuilder.BSBXYController' version='2'>
              <objectName>Fluxy_position</objectName>
              <x>34</x>
              <y>17</y>
              <comment>choose stereo placement</comment>
              <automationAllowed>true</automationAllowed>
              <width>298</width>
              <height>90</height>
              <xMin>0.0</xMin>
              <xMax>1.0</xMax>
              <yMin>0.01</yMin>
              <yMax>0.2</yMax>
              <xValue>0.5637583892617449</xValue>
              <yValue>0.11857142857142856</yValue>
              <randomizable>true</randomizable>
              <valueDisplayEnabled>false</valueDisplayEnabled>
            </bsbObject>
            <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
              <objectName></objectName>
              <x>2</x>
              <y>46</y>
              <label>LEFT</label>
              <font>
                <name>Roboto</name>
                <size>12.0</size>
                <style>0</style>
              </font>
            </bsbObject>
            <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
              <objectName></objectName>
              <x>338</x>
              <y>50</y>
              <label>RIGHT</label>
              <font>
                <name>Roboto</name>
                <size>12.0</size>
                <style>0</style>
              </font>
            </bsbObject>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBFileSelector'>
            <objectName>Fluxy_impulseResponse</objectName>
            <x>10</x>
            <y>35</y>
            <fileName>use short stereo impulse file without much coloration</fileName>
            <textFieldWidth>350</textFieldWidth>
            <stringChannelEnabled>false</stringChannelEnabled>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
            <objectName></objectName>
            <x>298</x>
            <y>70</y>
            <label>treble</label>
            <font>
              <name>Roboto</name>
              <size>12.0</size>
              <style>0</style>
            </font>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
            <objectName></objectName>
            <x>106</x>
            <y>70</y>
            <label>color</label>
            <font>
              <name>Roboto</name>
              <size>12.0</size>
              <style>0</style>
            </font>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
            <objectName>Fluxy_check delay</objectName>
            <x>138</x>
            <y>12</y>
            <automationAllowed>true</automationAllowed>
            <label>check delay</label>
            <selected>false</selected>
            <randomizable>true</randomizable>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown' version='2'>
            <objectName>Fluxy_preset impulse</objectName>
            <x>10</x>
            <y>10</y>
            <comment>3 presets and 1 impulse of choice. (The 3 preset impulses are included)</comment>
            <automationAllowed>false</automationAllowed>
            <selectedIndex>2</selectedIndex>
            <fontSize>12</fontSize>
            <randomizable>true</randomizable>
            <bsbDropdownItemList>
              <bsbDropdownItem uniqueId='836333516'>
                <name>ambiance 1</name>
                <value>0</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='836333517'>
                <name>ambiance 2</name>
                <value>1</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='836333518'>
                <name>ambiance 3</name>
                <value>2</value>
              </bsbDropdownItem>
              <bsbDropdownItem uniqueId='836333519'>
                <name>your impulse</name>
                <value>3</value>
              </bsbDropdownItem>
            </bsbDropdownItemList>
          </bsbObject>
          <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
            <objectName>Fluxy_color</objectName>
            <x>36</x>
            <y>70</y>
            <comment>add filter</comment>
            <automationAllowed>true</automationAllowed>
            <minimum>0.1</minimum>
            <maximum>0.7</maximum>
            <bdresolution>0.1</bdresolution>
            <value>0.30000000000000004</value>
            <sliderWidth>180</sliderWidth>
            <randomizable>true</randomizable>
            <valueDisplayEnabled>false</valueDisplayEnabled>
          </bsbObject>
        </bsbObject>
      </bsbObject>
      <bsbObject type='blue.orchestra.blueSynthBuilder.BSBCheckBox'>
        <objectName>FluxyON</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='836333538' name='FluxyON' 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='836333544' name='Fluxy_treble' label='' min='1.0' max='5.0' bdresolution='0.1' automationEnabled='false' value='1.0'>
      <line name='' version='2' max='5.0' min='1.0' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
    <parameter uniqueId='836333546' name='Fluxy_color' label='' min='0.1' max='0.7' bdresolution='0.1' automationEnabled='false' value='0.30000000000000004'>
      <line name='' version='2' max='0.7' min='0.1' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.30000000000000004'/>
      </line>
    </parameter>
    <parameter uniqueId='836333548' name='Fluxy_colorON' label='' min='0.0' max='1.0' bdresolution='1' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='805994432' name='Fluxy_check delay' label='' min='0.0' max='1.0' bdresolution='1' automationEnabled='false' value='0.0'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.0'/>
      </line>
    </parameter>
    <parameter uniqueId='2078631097' name='Fluxy_positionX' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.5637583892617449'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.5637583892617449'/>
      </line>
    </parameter>
    <parameter uniqueId='2078631099' name='Fluxy_positionY' label='' min='0.01' max='0.2' bdresolution='-1' automationEnabled='false' value='0.11857142857142856'>
      <line name='' version='2' max='0.2' min='0.01' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.11857142857142856'/>
      </line>
    </parameter>
  </parameterList>
</effect>