<effect>
  <name>CrossX</name>
  <enabled>true</enabled>
  <numIns>2</numIns>
  <numOuts>2</numOuts>
  <code>if (&lt;CrossXON&gt; == 1) then
    kfreq_low   =   &lt;CrossX_freq lowX&gt;
    kfreq_high  =   &lt;CrossX_freq highX&gt;
    kfreq_mid   =   (&lt;CrossX_freq highX&gt; - &lt;CrossX_freq lowX&gt;) * .5
    kfreq_width =   kfreq_mid -  kfreq_low  
;    printk2 kfreq_width
;-------------------
    if (&lt;CrossX_filterband&gt; == 1) then 
    asiglpL ButtLP ain1, kfreq_low, &lt;CrossX_filterdepth&gt;
    asiglpL   *=  &lt;CrossX_freq lowY&gt;
    asiglpR ButtLP ain2, kfreq_low, &lt;CrossX_filterdepth&gt;
    asiglpR   *=  &lt;CrossX_freq lowY&gt;
    else
    asiglpL    =   0
    asiglpR    =   0
    endif
;--------------------------------
    if (&lt;CrossX_filterband&gt; == 2) then 
    asighpL ButtHP ain1, &lt;CrossX_freq highX&gt;, &lt;CrossX_filterdepth&gt;
    asighpL  *=  &lt;CrossX_freq highY&gt;
    asighpR ButtHP ain2, &lt;CrossX_freq highX&gt;, &lt;CrossX_filterdepth&gt;
    asighpR   *=  &lt;CrossX_freq highY&gt;
    else
    asighpL    =   0
    asighpR    =   0
    endif
;--------------------
    if(&lt;CrossX_filterband&gt; == 3) then 
    asigbpL ButtBP ain1, kfreq_mid, kfreq_width,4
    asigbpR ButtBP ain2, kfreq_mid, kfreq_width,4
    else
    asigbpL    =   0
    asigbpR    =   0
    endif
;---------------------------------------
    aout1   =   asigbpL + asighpL + asiglpL                                           ;add them
    aout2   =   asigbpR + asighpR + asiglpR

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

CrossX is a somewhat strange Blue effect, as all Blue effects have 2 signal inputs and 2 signal outputs. CrossX does have this of course, but if you want to divide an incoming signal 
into 3 frequencybands, one should have 2 inputs and 6 outputs (= 2 x 3). This is not how the Blue mixer is set up.
A workaround is to divide the incoming signal into 3 Subchannels, each with its own CrossX effect. One Subchannel for the Lowpass, one for the Mid, one for the Highpass. Disadvantage is that 
when you want to change the frequencybands of one of the Crossx effects, you should copy this behaviour so all they all match...

The CrossX divides the signal in 3 band spectra: low, mid, high.
In the pre-fade of a Blue mixer strip, add 3 sends to 3 different Subchannels. In each Subchannel, put the CrossX and set the checkbox to active for the LOWpass, BANDpass and HIGHpass.

The Y axis represnts the amplitude of each band, and the X axis of the 2 windows LOW and HIGH determine the LOWpass frequency cutoff and HIGHpass frequency cutoff.

On each of the Subchannel (= spectrumband) it is now possible to add effects or adjust the volume. You can mix the 3 outputs of the Subchannels and its effects together again
, for example in a 4th Subchannel, to create different sound textures from one sound source.


CONTROLLERS:

ON/OFF                  -       bypass
LOW/HIGH/BANDpass       -       frequency band of filter(s)
filterdepth             -       set steep slope of filter(s)
XY controllers          -       set frequency and gain 

---

version 1.21, May 2020
- added comments on controllers

version 1.2, 2019
- XY controller improvements

version 1.1, februari 2018
- added filter depth
- used modified buttpass UDO from Victor Lazarinni

version 1.0 , January 2018
- initial version by Menno Knevel
- 3 band spectrum divider
- checkbox on/off

</comments>
  <opcodeList>
    <udo>
      <opcodeName>ButtLP</opcodeName>
      <outTypes>a</outTypes>
      <inTypes>akio</inTypes>
      <codeBody>asig,kf,iN,icnt xin
if icnt &gt;= iN goto cont
asig ButtLP asig,kf,iN,icnt+1
cont:
xout butterlp(asig,kf)</codeBody>
      <comments></comments>
    </udo>
    <udo>
      <opcodeName>ButtHP</opcodeName>
      <outTypes>a</outTypes>
      <inTypes>akio</inTypes>
      <codeBody>asig,kf,iN,icnt xin
if icnt &gt;= iN goto cont
asig ButtHP asig,kf,iN,icnt+1
cont:
xout butterhp(asig,kf)</codeBody>
      <comments></comments>
    </udo>
    <udo>
      <opcodeName>ButtBP</opcodeName>
      <outTypes>a</outTypes>
      <inTypes>akkio</inTypes>
      <codeBody>asig,kf,kbw,iN,icnt xin
if icnt &gt;= iN-1 goto cont
asig ButtBP asig,kf,kbw,iN,icnt+1
cont:
xout butterbp(asig,kf,kbw)
</codeBody>
      <comments></comments>
    </udo>
  </opcodeList>
  <graphicInterface editEnabled='false'>
    <gridSettings>
      <width>2</width>
      <height>2</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>CrossXON</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>12</x>
        <y>14</y>
        <groupName>Group</groupName>
        <backgroundColor>0x4d8080ff</backgroundColor>
        <borderColor>0x000000ff</borderColor>
        <labelTextColor>0xffffffff</labelTextColor>
        <titleEnabled>false</titleEnabled>
        <width>20</width>
        <height>20</height>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBDropdown' version='2'>
          <objectName>CrossX_filterband</objectName>
          <x>20</x>
          <y>10</y>
          <automationAllowed>false</automationAllowed>
          <selectedIndex>0</selectedIndex>
          <fontSize>12</fontSize>
          <randomizable>true</randomizable>
          <bsbDropdownItemList>
            <bsbDropdownItem uniqueId='-751684113'>
              <name>LOWpass</name>
              <value>1</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='-751684112'>
              <name>HIGHpass</name>
              <value>2</value>
            </bsbDropdownItem>
            <bsbDropdownItem uniqueId='-751684111'>
              <name>BANDpass</name>
              <value>3</value>
            </bsbDropdownItem>
          </bsbDropdownItemList>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBHSlider' version='2'>
          <objectName>CrossX_filterdepth</objectName>
          <x>290</x>
          <y>10</y>
          <automationAllowed>false</automationAllowed>
          <minimum>1.0</minimum>
          <maximum>4.0</maximum>
          <bdresolution>1</bdresolution>
          <value>4.0</value>
          <sliderWidth>50</sliderWidth>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBXYController' version='2'>
          <objectName>CrossX_freq high</objectName>
          <x>220</x>
          <y>40</y>
          <automationAllowed>true</automationAllowed>
          <width>170</width>
          <height>80</height>
          <xMin>5000.0</xMin>
          <xMax>10000.0</xMax>
          <yMin>0.0</yMin>
          <yMax>1.0</yMax>
          <xValue>5000.0</xValue>
          <yValue>1.0</yValue>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>355</x>
          <y>120</y>
          <label>HIGH</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>190</x>
          <y>121</y>
          <label>MID</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel' version='2'>
          <objectName></objectName>
          <x>220</x>
          <y>16</y>
          <label>filterdepth</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>120</y>
          <label>LOW</label>
          <font>
            <name>System Regular</name>
            <size>12.0</size>
          </font>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBXYController' version='2'>
          <objectName>CrossX_freq low</objectName>
          <x>10</x>
          <y>40</y>
          <automationAllowed>true</automationAllowed>
          <width>170</width>
          <height>80</height>
          <xMin>1.0</xMin>
          <xMax>250.0</xMax>
          <yMin>0.0</yMin>
          <yMax>1.0</yMax>
          <xValue>118.17647058823529</xValue>
          <yValue>0.44999999999999996</yValue>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>true</valueDisplayEnabled>
        </bsbObject>
        <bsbObject type='blue.orchestra.blueSynthBuilder.BSBVSlider' version='2'>
          <objectName>CrossX_freq band</objectName>
          <x>184</x>
          <y>37</y>
          <automationAllowed>true</automationAllowed>
          <minimum>0.0</minimum>
          <maximum>1.0</maximum>
          <bdresolution>0.1</bdresolution>
          <value>1.0</value>
          <sliderHeight>90</sliderHeight>
          <randomizable>true</randomizable>
          <valueDisplayEnabled>false</valueDisplayEnabled>
        </bsbObject>
      </bsbObject>
    </bsbObject>
  </graphicInterface>
  <parameterList>
    <parameter uniqueId='1872190075' name='CrossX_freq band' label='' min='0.0' max='1.0' bdresolution='0.1' automationEnabled='false' value='1.0'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='0.1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='1.0'/>
      </line>
    </parameter>
    <parameter uniqueId='1872190077' name='CrossX_freq highX' label='' min='5000.0' max='10000.0' bdresolution='-1' automationEnabled='false' value='5000.0'>
      <line name='' version='2' max='10000.0' min='5000.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='5000.0'/>
      </line>
    </parameter>
    <parameter uniqueId='1872190079' name='CrossX_freq highY' 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='1872190083' name='CrossX_freq lowX' label='' min='1.0' max='250.0' bdresolution='-1' automationEnabled='false' value='118.17647058823529'>
      <line name='' version='2' max='250.0' min='1.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='118.17647058823529'/>
      </line>
    </parameter>
    <parameter uniqueId='1872190085' name='CrossX_freq lowY' label='' min='0.0' max='1.0' bdresolution='-1' automationEnabled='false' value='0.44999999999999996'>
      <line name='' version='2' max='1.0' min='0.0' bdresolution='-1' color='-8355712' rightBound='false' endPointsLinked='false'>
        <linePoint x='0.0' y='0.44999999999999996'/>
      </line>
    </parameter>
    <parameter uniqueId='-104104221' name='CrossXON' 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>