<instrument type='blue.orchestra.BlueSynthBuilder' editEnabled='true'>
  <name>LotkaVolterra</name>
  <comment>As originally coded by Ignasi Alvarez Garriga (I think...)</comment>
  <globalOrc/>
  <globalSco/>
  <instrumentText>; Lotka Volterra model for predator-prey relations dynamics
;
;	dx/dt = Ax-Bxy
;	dy/dt= -Cy+Dxy
;
;	parameters : A, B, C, D
;
;	Ignasi Alvarez, 1998
;	Rev. 2005

izoom		=	p4
iamp		=	p5
ipanL		=	sqrt(p6)
ipanR		=	sqrt(1-p6)
iparammod	=	p7

ka = &lt;paramA&gt;
kb = &lt;paramB&gt;
kc = &lt;paramC&gt;
kd = &lt;paramD&gt;

kdt = &lt;dt&gt;
kdt2 = &lt;dt&gt;/2
kgainx = &lt;gainX&gt;
kgainy = &lt;gainY&gt;

ky init 1
kx init 1

kxo init 0
kyo init 0

kynew init 0
kxnew init 0

kynewo init 0
kxnewo init 0


kcont init 0

ka = ka+iparammod
kb = kb+iparammod
kc = kc+iparammod
kd = kd+iparammod


loop:

;sistema d&apos;equacions


kxnew=ka*kx-kb*kx*ky
kynew=(-1)*kc*ky+kd*kx*ky


kxo=kx
kyo=ky

kxnewo=kxnew
kynewo=kynew

kx=kxo+kxnewo*kdt
ky=kyo+kynewo*kdt

;sistema d&apos;equacions
kxnew=ka*kx-kb*kx*ky
kynew=(-1)*kc*ky+kd*kx*ky


kx=kxo+kdt2*(kxnew+kxnewo)
ky=kyo+kdt2*(kynew+kynewo)

kcont=kcont+1

if kcont!=izoom kgoto loop
kcont=0

asig2 = kx*kgainx+ky*kgainy
asig1 dcblock asig2*iamp

; Optionally output to a Display object:

;outvalue &quot;kdisplax&quot;, 0.25+kx*kx/25
;outvalue &quot;kdisplay&quot;, 0.25+ky/25


blueMixerOut asig1*ipanL,asig1*ipanR
</instrumentText>
  <graphicInterface editEnabled='false'>
    <uniqueNameManager nameIndex='3' defaultPrefix='bsbObj'/>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>paramA</objectName>
      <x>61</x>
      <y>34</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.01</minimum>
      <maximum>10.0</maximum>
      <value>1.1089</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>79</x>
      <y>135</y>
      <label>Param A</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>paramB</objectName>
      <x>154</x>
      <y>34</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.01</minimum>
      <maximum>10.0</maximum>
      <value>0.55945</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>172</x>
      <y>135</y>
      <label>Param B</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>paramC</objectName>
      <x>245</x>
      <y>34</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.01</minimum>
      <maximum>10.0</maximum>
      <value>1.154854</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>263</x>
      <y>135</y>
      <label>Param C</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>paramD</objectName>
      <x>334</x>
      <y>34</y>
      <automationAllowed>true</automationAllowed>
      <minimum>0.01</minimum>
      <maximum>10.0</maximum>
      <value>3.675331</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>352</x>
      <y>135</y>
      <label>Param D</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>dt</objectName>
      <x>61</x>
      <y>164</y>
      <automationAllowed>true</automationAllowed>
      <minimum>2.0E-4</minimum>
      <maximum>0.36</maximum>
      <value>0.193269</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>93</x>
      <y>266</y>
      <label>dT</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gainX</objectName>
      <x>152</x>
      <y>164</y>
      <automationAllowed>true</automationAllowed>
      <minimum>-2000.0</minimum>
      <maximum>2000.0</maximum>
      <value>1164.8</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>173</x>
      <y>264</y>
      <label>Gain X</label>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBKnob' version='2'>
      <objectName>gainY</objectName>
      <x>242</x>
      <y>164</y>
      <automationAllowed>true</automationAllowed>
      <minimum>-2000.0</minimum>
      <maximum>2000.0</maximum>
      <value>521.60004</value>
      <knobWidth>80</knobWidth>
      <randomizable>true</randomizable>
    </bsbObject>
    <bsbObject type='blue.orchestra.blueSynthBuilder.BSBLabel'>
      <objectName></objectName>
      <x>263</x>
      <y>264</y>
      <label>Gain Y</label>
    </bsbObject>
  </graphicInterface>
  <bsbParameterList>
    <parameter uniqueId='-1365000820' name='dt' label='' min='2.0E-4' max='0.36' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='0.36' min='2.0E-4' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.193269'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000818' name='gainX' label='' min='-2000.0' max='2000.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='2000.0' min='-2000.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='1164.8'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000816' name='gainY' label='' min='-2000.0' max='2000.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='2000.0' min='-2000.0' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='521.60004'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000828' name='paramA' label='' min='0.01' max='10.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='10.0' min='0.01' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='1.1089'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000826' name='paramB' label='' min='0.01' max='10.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='10.0' min='0.01' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='0.55945'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000824' name='paramC' label='' min='0.01' max='10.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='10.0' min='0.01' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='1.154854'/>
      </line>
    </parameter>
    <parameter uniqueId='-1365000822' name='paramD' label='' min='0.01' max='10.0' resolution='-1.0' automationEnabled='false'>
      <line name='' version='2' max='10.0' min='0.01' resolution='-1.0' color='-8355712' rightBound='false'>
        <linePoint x='0.0' y='3.675331'/>
      </line>
    </parameter>
  </bsbParameterList>
  <presetGroup name='Presets'/>
  <opcodeList/>
</instrument>