<CsoundSynthesizer>
<CsOptions>
-odac  
</CsOptions>
<CsInstruments>
0dbfs = 1

;;channels
chn_k "vert",3
chn_k "horz",3
chn_k "freq",3
chn_k "amp",3

gifn[ ] init 4
ihar[ ] init 40
ii = 0
while ii < 4 do 
 ik = 1
 while ik < 40 do
   irnd = abs(rnd31(1,0,0)) 
   ihar[ik-1] = irnd < 0.8 ? 0 : irnd/ik
   ik += 1  
 od
 gifn[ii] ftgen 0,0,8192,10,ihar
 ii += 1
od

instr 1   
  asig[] init 4 
  kamp chnget "amp"     // controls from host
  kfreq chnget "freq"
  kh chnget "horz"
  kv chnget "vert"
  
  kfreq port kfreq, 0.01
  
  aph phasor kfreq
  asig[0] tablei aph, gifn[0], 1
  asig[1] tablei aph, gifn[1], 1
  asig[2] tablei aph, gifn[2], 1
  asig[3] tablei aph, gifn[3], 1
  amix = (asig[0]*(1-kh) + asig[1]*kh)*(1-kv) +  (asig[2]*(1-kh) + asig[3]*kh)*kv

  aenv linenr  amix*kamp, 0.1, 0.1, 0.01

  out aenv*kamp
endin

schedule(1, 0, 10000)
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>




<bsbPanel>
 <label>Widgets</label>
 <objectName/>
 <x>0</x>
 <y>0</y>
 <width>686</width>
 <height>331</height>
 <visible>true</visible>
 <uuid/>
 <bgcolor mode="nobackground">
  <r>255</r>
  <g>255</g>
  <b>255</b>
 </bgcolor>
 <bsbObject type="BSBKnob" version="2">
  <objectName>amp</objectName>
  <x>62</x>
  <y>99</y>
  <width>80</width>
  <height>80</height>
  <uuid>{8f868e2e-225c-4369-b240-9c6e890c226b}</uuid>
  <visible>true</visible>
  <midichan>0</midichan>
  <midicc>0</midicc>
  <description/>
  <minimum>0.00000000</minimum>
  <maximum>1.00000000</maximum>
  <value>0.21250000</value>
  <mode>lin</mode>
  <mouseControl act="">continuous</mouseControl>
  <resolution>0.01000000</resolution>
  <randomizable group="0">false</randomizable>
  <color>
   <r>245</r>
   <g>124</g>
   <b>0</b>
  </color>
  <textcolor>#512900</textcolor>
  <border>0</border>
  <borderColor>#512900</borderColor>
  <showvalue>true</showvalue>
  <flatstyle>true</flatstyle>
  <integerMode>false</integerMode>
 </bsbObject>
 <bsbObject type="BSBKnob" version="2">
  <objectName>freq</objectName>
  <x>152</x>
  <y>99</y>
  <width>80</width>
  <height>80</height>
  <uuid>{ccbc15c4-3711-4550-b69e-d488e0f99e64}</uuid>
  <visible>true</visible>
  <midichan>0</midichan>
  <midicc>0</midicc>
  <description/>
  <minimum>55.00000000</minimum>
  <maximum>220.00000000</maximum>
  <value>162.25000000</value>
  <mode>lin</mode>
  <mouseControl act="">continuous</mouseControl>
  <resolution>0.01000000</resolution>
  <randomizable group="0">false</randomizable>
  <color>
   <r>245</r>
   <g>124</g>
   <b>0</b>
  </color>
  <textcolor>#512900</textcolor>
  <border>0</border>
  <borderColor>#512900</borderColor>
  <showvalue>true</showvalue>
  <flatstyle>true</flatstyle>
  <integerMode>false</integerMode>
 </bsbObject>
 <bsbObject type="BSBController" version="2">
  <objectName>horz</objectName>
  <x>241</x>
  <y>98</y>
  <width>353</width>
  <height>233</height>
  <uuid>{1ecb3530-5745-4261-8e67-43f0e0e7d05f}</uuid>
  <visible>true</visible>
  <midichan>1</midichan>
  <midicc>7</midicc>
  <description/>
  <objectName2>vert</objectName2>
  <xMin>0.00000000</xMin>
  <xMax>1.00000000</xMax>
  <yMin>0.00000000</yMin>
  <yMax>1.00000000</yMax>
  <xValue>0.41643059</xValue>
  <yValue>0.51072961</yValue>
  <type>point</type>
  <pointsize>30</pointsize>
  <fadeSpeed>0.00000000</fadeSpeed>
  <mouseControl act="press">jump</mouseControl>
  <bordermode>noborder</bordermode>
  <borderColor>#00ff00</borderColor>
  <color>
   <r>0</r>
   <g>234</g>
   <b>0</b>
  </color>
  <randomizable mode="both" group="0">false</randomizable>
  <bgcolor>
   <r>30</r>
   <g>30</g>
   <b>30</b>
  </bgcolor>
  <bgcolormode>true</bgcolormode>
 </bsbObject>
</bsbPanel>
<bsbPresets>
</bsbPresets>
