<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
kr = 4410	
ksmps = 10

nchnls = 2

;initialization:
;================
garvb init 0
zakinit 4, 4

;=========================================================================================================================================================================
	instr 1
idur	=	p3
iamp	=	p4
ipch	=	cpspch(p5)
idens	=	p6
iaoff	=	p7
ipoff	=	p8
igdur	=	p9
igfn	=	p11
imdur	=	p10
ifil1	=	p12
ifil2	=	p13
icut1	=	p14
irsn	=	p15
icut2	=	p16
ienv	=	p17
ipan	=	p18
isnd	=	p19

k1		oscil 1, 1/p3, ienv
a1		grain iamp, ipch, idens, iaoff, ipoff, igdur, igfn, 4, imdur

;sending 1 or 0 to ifil1 or ifil2 turns lpf or hpf on/off
amoog		moogvcf a1*ifil1, icut1, irsn, 0dbfs	
ahpf		butterhp a1*ifil2, icut2
aout	=	(amoog+ahpf)*k1		
		
aout1	=	aout*ipan
aout2	=	aout*(1-ipan)

;to global envelope:
zawm		aout1, 1
zawm		aout2, 2

	endin
;=========================================================================================================================================================================

	instr 2
iamp	=	p4
ienv	=	p5
iofst	=	p6
imoog	=	p7
ihpf	=	p8
icut1	=	p9
irsn	=	p10
icut2	=	p11
ipan	=	p12
idst	=	p13
isnd	=	.01
		;interpolates
krand		randi iamp, 10, 1.5, 0, iofst
a1		rand	krand							;amp ranomized by randi 
klfo		line 1, p3, idst

;sending 1 or 0 to ifil1 or ifil2 turns lpf or hpf on/off
amoog		moogvcf a1*imoog, icut1*klfo, irsn, 0dbfs
ahpf		butterhp a1*ihpf, icut2

kenv		oscil 1, 1/p3, ienv
aout	=	(amoog+ahpf)*kenv
		outs aout*ipan, aout*(1-ipan)

zawm aout*isnd, 4


	endin
;=========================================================================================================================================================================
	instr 3
iamp	=	p4
ienv1	=	p5
ienv2	=	p6
iofst	=	p7
imoog	=	p8
ihpf	=	p9
icut1	=	p10
irsn	=	p11
icut2	=	p12
ipan	=	p13
isnd	=	.01
krand		randi iamp, 10, 1.5, 0, iofst
a1		rand	krand							;amp randmized by randi 

;sending 1 or 0 to ifil1 or ifil2 turns lpf or hpf on/off
amoog		moogvcf a1*imoog, icut1, irsn, 0dbfs
ahpf		butterhp a1*ihpf, icut2

kenv		oscil 1, 1/p3, ienv1
kenv2		oscil 1, 1/p3, ienv2
aout	=	((amoog+ahpf)*kenv)*kenv2
		outs aout*ipan, aout*(1-ipan)

zawm aout*isnd, 4


	endin
;=========================================================================================================================================================================	
	instr 4
idur	=	p3
ipch	=	p4
iaoff	=	p5
ipoff	=	p6


;random # generators:
		seed 0 
krden		linrand 50 
krdur		linrand .1
iamp2		linrand 2000
ipra		linrand .5
iran		linrand 700
igaus		gauss .5 ;gauss generates random #s b/w -.5 and .5, and is offset by .5 to generate 0 - 1, giving the inst a stronger tendency to pan towards the center
ipan	=	igaus+.5

iprand	=	ipch*(ipra+.5)

iamp	=	iamp2+5000
a1		grain iamp, iprand, krden, iaoff, ipoff, krdur, 3, 4, .1

icfq	=	iran+800
ares		reson a1, icfq, icfq*.2
abal		balance ares, a1

kenv1		oscil	1, 1/p3, 4
aout	=	abal*kenv1

kenv2		line .5, 65, 1
aout	=	aout*kenv2

		outs aout*ipan, aout*(1-ipan)
		print ipan

		zawm		aout/2, 3

	endin
;=========================================================================================================================================================================
	
	instr 5
iamp	=	p4
ipch	=	cpspch(p5)
icar	=	p6
imod	=	p7
indx	=	p8
icut	=	p9
ipan	=	p10
isnd	=	p11
kenv		oscil	1, 1/p3, 4
a1		foscil iamp*kenv, ipch, icar, imod, indx, 1
ahpf		butterhp a1, icut
alpf		butterlp	ahpf, 10000
klfo1		oscil	.2, 1.8, 1

amix	=	alpf*(klfo1+.8)

kpch		oscil	.5, .1, 1
		outs	amix*kpch, amix*(1-kpch)

		zawm amix*isnd, 4

	endin
;=========================================================================================================================================================================


;Fibonacci instrument: waveform and panning are based on the fibonacci sequence

	instr 6
iamp =	p4
ifrq	=	p5
icut	=	1500
irsn	=	.2
isnd =	.03

a1		oscil iamp, ifrq, 8
a2		oscil iamp, ifrq+.1, 8
a3		oscil iamp, ifrq-.1, 8

;klfo1		oscil iamp/10, 1/p3, 8
;a4		grain iamp/40, ifrq, 50+klfo1, 20, 5, .05, 1, 3, .1, 
;a4		butterhp a4, 700


amix	=	a1+a2+a3

amix		moogvcf amix, icut, irsn, 0dbfs


kenv		oscil 1, 1/p3, 5
;aout	=	(amix+a4)*kenv
aout	=	amix*kenv
kenv1		oscil 1, 1/p3, 8
aout	=	aout*kenv1

aout		dam aout, 3000, 3, 3, .001, .001

kpan		oscil .5, 1/p3, 8
kpan	=	kpan+.5

		outs	aout*kpan, aout*(1-kpan)


		zawm aout*isnd, 4
	endin


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

												;Global Effects





;=====================================
;envelope for instrument 1
;=====================================
	instr 21
a1		zar 1
a2		zar 2

;kenv1		oscili 1, (1/75)*.5, 4
;kenv2		oscili 1, (1/75)*.5, 4


kenv1		oscili 1, 1/75, 4
kenv2		oscili 1, 1/75, 4

a1	=	a1*kenv1
a2	=	a2*kenv2

		outs a1, a2

amix	=	a1+a2

zawm		amix*.1, 4

 		zacl 1, 2
	endin


;=====================================
;comb with hipass filter
;=====================================
	instr 22
a1		zar 3
a2		zar 4

a1	=	a1+a2

imxdl	=	10

krate		line	.3, p3, .5

alfo		oscili  imxdl, krate/p3, 1
adly1		vdelay a1, alfo, 5
adly2		vdelay adly1, alfo, imxdl
adly3		vdelay adly2, alfo, imxdl
adly4		vdelay adly3, alfo, imxdl
amix	=	adly1+adly2+adly3+adly4
amix		butterhp	amix, 2000

		outs amix, amix

		zacl 3, 4

	
	endin

;=====================================
;Reverb
;=====================================
	instr 20


arev		zar 4

itime	=	6
idfs	=	.6
avrb		nreverb arev, itime, idfs
		outs avrb, avrb
		
		zacl 4, 4

	endin


</CsInstruments>
<CsScore>
f1 0 4096 10	1
f2 0 4096 7	1 4096 -1
f3 0 4096 7	1 2048 1 0 -1 2048 -1
f4 0 1024 19	1 .5 270 .5
f5 0 1024 7	0 200 1 100 0.8 274  0.8 450 0
f6 0 1024 7	1 1024 0
f7 0 1024 5	1 1024 .001
f8 0 4096 10	.1 .1 .2 .3 .5 .8 .13	.21 .34 .1 .1 .2 .3 .5 .8 .13 .21 .34;fibonacci waveform - credits: Jinku Kim


a 0 0 0

t 0 80

;global insts.
;========================
i20	0	92	5	1
i21	0	92
i22	0	92


;ins1 w/ moog...didn't use the hpf
;ins	st	dur	amp	pch	dens	aoff	poff	gdur	mdur	gfn	fil1	fil2	cut1	rsn	cut2	env	pan	snd
;======================================================================================================
i1	0 	6	800	6.07	100	100	2	.6	1	2	1	0	1500	.1	0	5	.25	0.4	
i1	0 	.	.	7.10	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	5 	.	.	6.10	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	5 	.	.	8.02	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	10 	.	.	6.09	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	10 	.	.	8.00	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	15 	.	.	7.00	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	15 	.	.	8.03	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	20 	.	.	6.10	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	20 	.	.	8.02	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	25 	.	.	6.11	.	.	.	.	.	.	.	.	.	.	.	.	.25	.		
i1	25 	.	.	8.05	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	30 	.	.	7.00	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	30 	.	.	8.03	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	35 	.	.	7.03	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	35 	.	.	8.00	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	40 	.	.	7.02	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	40 	.	.	7.10	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	45 	.	.	7.03	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	45 	.	.	8.00	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	50 	.	.	7.00	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	50 	.	.	7.09	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	55 	.	.	6.10	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	55 	.	.	8.02	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	60 	.	.	6.09	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	60 	.	.	8.00	.	.	.	.	.	.	.	.	.	.	.	.	.75	.
i1	65 	.	.	6.06	.	.	.	.	.	.	.	.	.	.	.	.	.25	.	
i1	65 	.	.	7.09	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	70.5	.	400	6.07	.	.	.	.	.	.	.	.	.	.	.	.	.25	.6	
i1	70.5	.	.	7.10	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	
i1	75.5	7	500	5.07	.	.	.	.	.	.	.	.	.	.	.	.	.25	.8	
i1	75.5	.	100	7.07	.	.	.	.	.	.	.	.	.	.	.	.	.75	.	


;ins2 w/moog
;ins	st	dur	amp	env	ofst	moog	hpf	cut1	rsn	cut2	pan	dst
;=====================================================================
i2	2	3	12000	6	4410	1	0	1500	.7	0	1	1
i.	+	.	.	.	.	.	.	1600	.	.	0	.
i.	.	.	.	.	.	.	.	1500	.	.	1	.
i.	.	.	.	.	.	.	.	1700	.	.	0	.
i.	15	3	6000	.	.	.	.	1500	.6	.	1	.
i.	.	.	.	.	.	.	.	1800	.	.	0	.
i.	19	3	12000	.	.	.	.	1500	.7	.	0	.
i.	+	.	.	.	.	.	.	1900	.	.	1	.
i.	.	.	.	.	.	.	.	1500	.	.	0	.
i.	.	.	.	.	.	.	.	2000	.	.	1	.

i.	31	3	6000	.	.	.	.	2100	.	.	0	.
i.	.	.	.	.	.	.	.	2100	.	.	1	.

i.	34	3	.	.	.	.	.	2200	.	.	1	.
i.	.	.	.	.	.	.	.	.	.	.	0	.

i.	38	3	10000	.	.	.	.	2300	.	.	1	.
i.	+	.	.	.	.	.	.	2400	.	.	0	.
i.	.	.	.	.	.	.	.	2500	.	.	1	.
i.	.	.	.	.	.	.	.	2600	.	.	0	.

i.	50	3	5000	.	.	.	.	2700	.6	.	1	.
i.	.	.	.	.	.	.	.	.	.	.	0	.

i.	53	.	.	.	.	.	.	2800	.	.	1	.
i.	.	.	.	.	.	.	.	.	.	.	0	.

i.	57	3	10000	.	.	.	.	2900	.64	.	0	.
i.	+	.	8000	.	.	.	.	3000	.	.	1	.
i.	.	.	10000	.	.	.	.	3100	.	.	0	.
i.	.	.	.	.	.	.	.	3200	.	.	1	.

i.	69	3	3500	.	.	.	.	3300	.6	.	1	.
i.	.	.	.	.	.	.	.	.	.	.	0	.

i.	72	3.5	.	5	.	.	.	3400	.	.	1	.6
i.	.	.	.	.	.	.	.	.	.	.	0	.
	
i.	75.5	10	.	.	.	.	.	3000	.	.	1	.2
i.	.	.	.	.	.	.	.	.	.	.	0	.
	
i.	80.5	3	12000	6	4410	1	0	1500	.7	0	1	1
i.	+	.	<	.	.	.	.	1600	.	.	0	.
i.	.	.	.	.	.	.	.	1300	.	.	.75	.
i.	.	.	.	.	.	.	.	1400	.	.	.25	.
i.	.	.	.	.	.	.	.	1000	.	.	.6	.
i.	.	.	100	.	.	.	.	1100	.	.	.4	.
i.	.	8	50	.	.	.	.	783.991	.	.	.5	.49999
*/


;ins3 2/ butterhp
;ins	st	dur	amp	env	env2	ofst	moog	hpf	cut1	rsn	cut2	pan	dst
;===========================================================================
i3	31	3	1	6	6	0	0	1	0	0	100	.5
i.	+	.	<	.	.	.	.	.	.	.	<	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	.	.	.	.	.	.	.	.	.	.
i.	.	.	1000	.	.	.	.	.	.	.	600	.

i.	62	.	1000	.	.	.	.	.	.	.	700	.
i.	65	.	1200	.	.	.	.	.	.	.	800	.
i.	70.5	5	.	5	.	.	.	.	.	.	850	.
i.	75.5	10	.	5	.	.	.	.	.	.	900	.



;ins4 - randomized grain 
;ins	st	dur	pch		aoff	poff
;====================================
i4	10	1	391.995	10	2	
i.	11	1	.		.	.	
i.	12	2	.		.	.	
i.	13	3	.		.	.		
i.	15	5	.		.	.		
i.	18	8	.		.	.	
i.	23	13	.		.	.
i.	31	21	.		.	.
i.	44	31	.		.	.
i.	65	17	.		.	.

;ins5 - high frequency noise
;ins	st	dur	amp	pch	car	mod	indx	cut	pan	snd
;=====================================================
i5	15	5	60	8.07	5.37	7.23	5.15	1000	.5	.08
i.	25	8	.	.	.	.	.	.	.	.
i.	35	13	.	.	.	.	.	.	.	.
i.	45	21	100	.	.	.	.	.	.	.
i.	55	27	.	.	.	.	.	.	.	.


;ins6 - fibonacci inspired 
;ins	st	dur	amp	frq	
;============================
;i6	0	6	30000	195.998 	
;i6	.	.	30000	466.164	

i6	30	6	30000	195.998 	
i6	.	.	30000	466.164	

i6	45	6	30000	195.998 	
i6	.	.	.	466.164	

i6	61	6	35000	195.998
i.	.	.	.	233.082 	
i6	.	.	.	587.330	
i.	.	.	.	932.328

i6	70	2	35000	195.998
i.	.	.	.	233.082 	
i6	.	.	.	587.330	
i.	.	.	.	932.328
e


</CsScore>
</CsoundSynthesizer>
.
<MacOptions>
Version: 3
Render: Real
Ask: Yes
Functions: ioObject
Listing: Window
WindowBounds: 982 63 458 548
CurrentView: io
IOViewEdit: On
Options: -b128 -A -s -m167 -R
</MacOptions>
<MacGUI>
ioView background {32125, 41634, 41120}
ioSlider {266, 7} {20, 98} 0.000000 1.000000 0.122449 amp
ioSlider {10, 29} {239, 22} 100.000000 1000.000000 258.158996 freq
ioGraph {8, 112} {265, 116} table 0.000000 1.000000 
ioListing {279, 112} {266, 266}
ioText {293, 44} {41, 24} label 0.000000 0.00100 "" left "Lucida Grande" 8 {0, 0, 0} {65280, 65280, 65280} background noborder Amp:
ioText {333, 44} {70, 24} display 0.000000 0.00100 "amp" left "Lucida Grande" 8 {0, 0, 0} {65280, 65280, 65280} background noborder 0.1837
ioText {66, 57} {41, 24} label 0.000000 0.00100 "" left "Lucida Grande" 8 {0, 0, 0} {65280, 65280, 65280} background noborder Freq:
ioText {106, 57} {69, 24} display 0.000000 0.00100 "freq" left "Lucida Grande" 8 {0, 0, 0} {65280, 65280, 65280} background noborder 261.9247
ioText {425, 6} {120, 100} label 0.000000 0.00100 "" left "Lucida Grande" 8 {0, 0, 0} {65280, 65280, 65280} nobackground border 
ioText {449, 68} {78, 24} display 0.000000 0.00100 "freqsweep" center "DejaVu Sans" 8 {0, 0, 0} {14080, 31232, 29696} background border 999.6769
ioButton {435, 24} {100, 30} event 1.000000 "Button 1" "Sweep" "/" i1 0 10
ioGraph {8, 233} {266, 147} scope 2.000000 -1.000000 
</MacGUI>

