;
; ""
; by 
;
; 
;
; Generated by blue 2.0.9 (http://blue.kunstmusik.com)
;

<CsoundSynthesizer>

<CsInstruments>
sr=44100
ksmps=1
nchnls=2


ga_bluemix_1_0	init	0
ga_bluemix_1_1	init	0
ga_bluesub_Master_0	init	0
ga_bluesub_Master_1	init	0


gk_blue_auto0 init 0.6120871305
gk_blue_auto1 init 0.5623676181
gk_blue_auto2 init 0.6202820539
gk_blue_auto3 init 0
gk_blue_auto4 init 0


gi_sine_1	ftgenonce 0,0,65536,10,1


	opcode blueEffect0,aa,aa

ain1,ain2	xin
arev1,arev2 freeverb ain1,ain2,gk_blue_auto2,gk_blue_auto0
aout1 = (arev1*gk_blue_auto1)+(ain1*(1-gk_blue_auto1))/2
aout2 = (arev2*gk_blue_auto1)+(ain2*(1-gk_blue_auto1))/2

xout	aout1,aout2


	endop


	instr 1	;FMbot-00
ifn = gi_sine_1
seed 0
irnd random 1,5
irnd = round(irnd)*2
ibeat = p3/irnd
iter = 1
start:    timout    0, ibeat, continue    ; BRANCH TO CONTINUE FOR ibeat seconds, THEN...
          reinit    start               ; REINIT ALL, BEGINNING WITH THE TIMOUT
continue:           
iamp random 7000,9500				; random amplitude
imf random 1,7					
imf = round(imf)				; random modulation frequency (harmonics 1 to 7)	
imi random 2,5					; random modulation index
invat random ibeat*.05,ibeat*.5			; random amplitude envelope value
invac random -3,3				; random amplitude envelope value
inva random .001,1				; random amplitude envelope value
invb random .001,1				; random amplitude envelope value
invc random -5,5				; random amplitude envelope value
invd random -3,3				; random amplitude envelope value
inve random .1,.4				; random amplitude envelope value
knv transeg .0001,invat,invac,inva,ibeat*.1,invc,invb,ibeat*inve,invd,.0001 ; amplitude envelope
kmi = imi*knv					; Modulation Index = amplitude envelope (for horn-like sounds)
ifq random 1,13					; random root note = harmonic 1 to 13 of base frequency
ifq = round(ifq)*32				; set base frequency = 32Hz
ipan random -1,1				; random panning
a0 foscili knv,ifq,1,imf,kmi,ifn      		; FM signal generator
a0 = (a0/(1+(iter*.1)))*iamp			; amplitude scale and envelope
a0 dcblock a0					; dcblock filter
kL = sqrt(2) / 2 * cos(ipan) + sin(ipan) 	; CONSTANT POWER PANNING
kR = sqrt(2) / 2 * cos(ipan) - sin(ipan)	; FROM C.ROADS "CM TUTORIAL" pp460
aL = a0 * kL					; assign left channel
aR = a0 * kR					; assign right channel
ga_bluemix_1_0 = ga_bluemix_1_0 +  aL
ga_bluemix_1_1 = ga_bluemix_1_1 + aR	       			; OUTPUT
iter = iter + 1					; iteration counter

	endin

	instr 2	;Blue Mixer Instrument
ktempdb = ampdb(gk_blue_auto3)
ga_bluemix_1_0 = ga_bluemix_1_0 * ktempdb
ga_bluemix_1_1 = ga_bluemix_1_1 * ktempdb
ga_bluemix_1_0, ga_bluemix_1_1	blueEffect0	ga_bluemix_1_0, ga_bluemix_1_1
ga_bluesub_Master_0	sum	ga_bluesub_Master_0, ga_bluemix_1_0
ga_bluesub_Master_1	sum	ga_bluesub_Master_1, ga_bluemix_1_1
ktempdb = ampdb(gk_blue_auto4)
ga_bluesub_Master_0 = ga_bluesub_Master_0 * ktempdb
ga_bluesub_Master_1 = ga_bluesub_Master_1 * ktempdb
outc ga_bluesub_Master_0, ga_bluesub_Master_1
ga_bluemix_1_0 = 0
ga_bluemix_1_1 = 0
ga_bluesub_Master_0 = 0
ga_bluesub_Master_1 = 0

	endin

	instr 3	;Param: hfdamp
if (p4 == p5) then
gk_blue_auto0 init p4
turnoff
else
gk_blue_auto0 line p4, p3, p5
endif
	endin

	instr 4	;Param: level
if (p4 == p5) then
gk_blue_auto1 init p4
turnoff
else
gk_blue_auto1 line p4, p3, p5
endif
	endin

	instr 5	;Param: rsize
if (p4 == p5) then
gk_blue_auto2 init p4
turnoff
else
gk_blue_auto2 line p4, p3, p5
endif
	endin

	instr 6	;Param: Volume
if (p4 == p5) then
gk_blue_auto3 init p4
turnoff
else
gk_blue_auto3 line p4, p3, p5
endif
	endin

	instr 7	;Param: Volume
if (p4 == p5) then
gk_blue_auto4 init p4
turnoff
else
gk_blue_auto4 line p4, p3, p5
endif
	endin


</CsInstruments>

<CsScore>

                     







i1	0.0	20	
i1	0.0	20	
i1	0.0	20	
i1	20.0	10	
i1	20.0	10	
i1	20.0	10	
i1	30.0	5	
i1	30.0	5	
i1	30.0	5	
i1	30.0	10	
i1	30.0	10	
i1	35.0	5	
i1	35.0	5	
i1	35.0	5	
i1	40.0	10	
i1	40.0	10	
i1	45.0	5	
i1	45.0	5	
i1	45.0	5	
i1	50.0	20	
i1	50.0	20	
i1	50.0	20	
i1	50.0	20	
i1	70.0	10	
i1	70.0	10	
i1	70.0	10	
i1	70.0	10	
i1	80.0	20	
i1	80.0	10	
i1	80.0	10	
i1	80.0	10	
i1	80.0	10	
i1	80.0	5	
i1	80.0	5	
i1	85.0	5	
i1	85.0	5	
i1	90.0	20	
i1	90.0	20	
i1	90.0	10	
i1	90.0	10	
i1	90.0	10	
i1	90.0	10	
i1	90.0	5	
i1	90.0	5	
i1	95.0	5	
i1	95.0	5	
i1	95.0	5	
i1	100.0	20	
i1	100.0	20	
i1	100.0	20	
i1	100.0	10	
i1	100.0	10	
i1	100.0	10	
i1	100.0	10	
i1	100.0	10	
i1	100.0	5	
i1	100.0	5	
i1	100.0	5	
i1	105.0	5	
i1	105.0	5	
i1	105.0	5	
i1	110.0	10	
i1	110.0	10	
i1	110.0	10	
i1	110.0	10	
i1	110.0	10	
i1	110.0	10	
i1	110.0	5	
i1	110.0	5	
i1	110.0	5	
i1	110.0	5	
i1	115.0	5	
i1	115.0	5	
i1	115.0	5	
i1	115.0	5	
i2	0	122	
e

</CsScore>

</CsoundSynthesizer>