;Written by Iain McCurdy

<CsoundSynthesizer>

<CsOptions>
-odevaudio -M0 -b100 -m0
</CsOptions>

<CsInstruments>

sr 		= 	44100
ksmps 		= 	1
nchnls 		= 	2
0dbfs		=	1	;MAXIMUM AMPLITUDE REGARDLESS OF BIT DEPTH

;FLTK INTERFACE CODE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FLcolor	255, 255, 255, 0, 0, 0
		FLpanel	"Polyphonic Synth", 1000, 700, 0, 0

;BORDERS				TYPE | FONT | SIZE | WIDTH | HEIGHT | X | Y
ih		 	FLbox  	" ", 	6,       9,    15,    475,    110,    5, 240	;PITCH ENVELOPE
ih		 	FLbox  	" ", 	6,       9,    15,    475,    110,    5, 360	;FILTER ENVELOPE
ih		 	FLbox  	" ", 	6,       9,    15,    415,    110,    5, 480	;AMPLITUDE ENVELOPE
ih		 	FLbox  	" ", 	6,       9,    15,    190,    110,  290, 100	;BUZZ PARAMETERS
ih		 	FLbox  	" ", 	6,       9,    15,    186,    110,  102, 100	;VCO PARAMETERS

;TEXT BOXES						TYPE | FONT | SIZE | WIDTH | HEIGHT | X |  Y
ih		 	FLbox  	"Pitch Envelope",	1,      12,    16,    120,     25,   10,  242
ih		 	FLbox  	"Filter Envelope",	1,      12,    16,    120,     25,   10,  362
ih		 	FLbox  	"Amplitude Envelope",	1,      12,    16,    140,     25,   15,  482
ih		 	FLbox  	"Buzz Parameters",	1,      12,    14,    120,     22,  292,  102
ih		 	FLbox  	"VCO Parameters",	1,      12,    14,    120,     22,  104,  102

;					WIDTH | HEIGHT | X  | Y
idgliss			FLvalue	" ",	 60,      20,     5,  60
idamp			FLvalue	" ",	 60,      20,    65,  60
idtrmdep		FLvalue	" ",	 60,      20,   125,  60
idvibdep		FLvalue	" ",	 60,      20,   185,  60
idmodfreq		FLvalue	" ",	 60,      20,   245,  60
idpw			FLvalue	" ",	 60,      20,   105, 180
idleak			FLvalue	" ",	 60,      20,   165, 180
idnyx			FLvalue	" ",	 60,      20,   225, 180
idmul			FLvalue	" ",	 60,      20,   295, 180

idPStrLev		FLvalue	" ",	 60,      20,    30, 320
idPAttTim		FLvalue	" ",	 60,      20,    90, 320
idPAttLev		FLvalue	" ",	 60,      20,   150, 320
idPDecTim		FLvalue	" ",	 60,      20,   210, 320
idPRelTim		FLvalue	" ",	 60,      20,   270, 320
idPRelLev		FLvalue	" ",	 60,      20,   330, 320

idFAttTim		FLvalue	" ",	 60,      20,    30, 440
idFAttLev		FLvalue	" ",	 60,      20,    90, 440
idFDecTim		FLvalue	" ",	 60,      20,   150, 440
idFSusLev		FLvalue	" ",	 60,      20,   210, 440
idFRelTim		FLvalue	" ",	 60,      20,   270, 440
idFRelLev		FLvalue	" ",	 60,      20,   330, 440
idFEnvAmt		FLvalue	" ",	 60,      20,   390, 440

idAAttTim		FLvalue	" ",	 60,      20,    30, 560
idAAttLev		FLvalue	" ",	 60,      20,    90, 560
idADecTim		FLvalue	" ",	 60,      20,   150, 560
idASusLev		FLvalue	" ",	 60,      20,   210, 560
idARelTim		FLvalue	" ",	 60,      20,   270, 560
idARelLev		FLvalue	" ",	 60,      20,   330, 560

idRes			FLvalue	" ",	 80,      20,     5, 625
idBaseFrq		FLvalue	" ",	 80,      20,     5, 675
idDlyAmt		FLvalue	" ",	 80,      20,   505,  25
idDlyTim		FLvalue	" ",	 80,      20,   505,  75
idDlyFB			FLvalue	" ",	 80,      20,   505, 125

;					     			MIN   |  MAX  | EXP | TYPE |  DISP  |  WIDTH | HEIGHT | X  | Y
gkRes, gihRes		FLslider	"Filter Resonance CC#4",0,          1,   0,    23,  idRes,      490,     25,     5, 600
gkBaseFrq, gihBaseFrq	FLslider	"Filter Base Freq CC#3",4,         14,   0,    23,  idBaseFrq,  490,     25,     5, 650
gkDlyAmt, ihDlyAmt	FLslider	"Delay Send Level",	0,          1,   0,    23,  idDlyAmt,   490,     25,   505,   0
gkDlyTim, ihDlyTim	FLslider	"Delay Time",		.01,        2,   0,    23,  idDlyTim,   490,     25,   505,  50
gkDlyFB, ihDlyFB	FLslider	"Delay Feedback",	0,          1,   0,    23,  idDlyFB,    490,     25,   505, 100

;KNOBS								MIN    |   MAX | EXP|  TYPE |  DISP    | WIDTH | X | Y
gkgliss, ihgliss	FLknob		"Port.Tim.",		0,          1,    0,    1,   idgliss,      40,  15,   5
gkamp, ihamp		FLknob		"Amp.",			0,          1,    0,    1,   idamp,        40,  75,   5
gktrmdep, ihtrmdep	FLknob		"Trem.Amt.",		0,          1,    0,    1,   idtrmdep,     40, 135,   5
gkvibdep, ihvibdep	FLknob		"Vib.Amt.",		0,          1,    0,    1,   idvibdep,     40, 195,   5
gkmodfreq, gihmodfreq	FLknob		"Mod.Frq.",		0,         20,    0,    1,   idmodfreq,    40, 255,   5
gkpw, ihpw		FLknob		"P.W.",    		0,          1,    0,    1,   idpw,         40, 115, 125
gkleak, ihleak		FLknob		"Leak",			0,          1,    0,    1,   idleak,       40, 175, 125
gknyx, ihnyx		FLknob		"Harms",		0,          1,    0,    1,   idnyx,        40, 235, 125
gkmul, ihmul		FLknob		"Mul.",			0,          2,    0,    1,   idmul,        40, 305, 125

gkPStrLev, ihPStrLev	FLknob 		"Str.Lev.", 		.125,       2,    0,    1,   idPStrLev,    40,  40, 265
gkPAttTim, ihPAttTim	FLknob 		"Att.Tim.", 		.00001,     1,    0,    1,   idPAttTim,    40, 100, 265
gkPAttLev, ihPAttLev	FLknob 		"Att.Lev.", 		.125,       2,    0,    1,   idPAttLev,    40, 160, 265
gkPDecTim, ihPDecTim	FLknob 		"Dec.Tim.", 		.00001,     1,    0,    1,   idPDecTim,    40, 220, 265
gkPRelTim, ihPRelTim	FLknob 		"Rel.Tim.", 		.00001,     5,    0,    1,   idPRelTim,    40, 280, 265
gkPRelLev, ihPRelLev	FLknob 		"Rel.Lev.", 		.125,       2,    0,    1,   idPRelLev,    40, 340, 265

gkFAttTim, ihFAttTim	FLknob 		"Att.Tim.", 		.00001,     5,    0,    1,   idFAttTim,    40,  40, 385
gkFAttLev, ihFAttLev	FLknob 		"Att.Lev.", 		0,          1,    0,    1,   idFAttLev,    40, 100, 385
gkFDecTim, ihFDecTim	FLknob 		"Dec.Tim.", 		.00001,     5,    0,    1,   idFDecTim,    40, 160, 385
gkFSusLev, ihFSusLev	FLknob 		"Sus.Lev.", 		0,          1,    0,    1,   idFSusLev,    40, 220, 385
gkFRelTim, ihFRelTim	FLknob 		"Rel.Tim.", 		.00001,     5,    0,    1,   idFRelTim,    40, 280, 385
gkFRelLev, ihFRelLev	FLknob 		"Rel.Lev.", 		0,          1,    0,    1,   idFRelLev,    40, 340, 385
gkFEnvAmt, ihFEnvAmt	FLknob 		"Env.Amt.", 		0,         10,    0,    1,   idFEnvAmt,    40, 400, 385

gkAAttTim, ihAAttTim	FLknob 		"Att.Tim.", 		.00001,     5,    0,    1,   idAAttTim,    40,  40, 505
gkAAttLev, ihAAttLev	FLknob 		"Att.Lev.", 		0,          1,    0,    1,   idAAttLev,    40, 100, 505
gkADecTim, ihADecTim	FLknob 		"Dec.Tim.", 		.00001,     5,    0,    1,   idADecTim,    40, 160, 505
gkASusLev, ihASusLev	FLknob 		"Sus.Lev.", 		0,          1,    0,    1,   idASusLev,    40, 220, 505
gkARelTim, ihARelTim	FLknob 		"Rel.Tim.", 		.00001,     5,    0,    1,   idARelTim,    40, 280, 505
gkARelLev, ihARelLev	FLknob 		"Rel.Lev.", 		0,          1,    0,    1,   idARelLev,    40, 340, 505

;											MIN | MAX | STEP1 | STEP2 | TYPE | WIDTH | HEIGHT | X | Y | OPCODE
gkBendRnge, ihBendRnge 	FLcount  "Bend Range",	       	        	        	0,     24,    1,      1,      2,     60,     30,  330,   5,   -1
gkwave,ihwave 		FLcount  "Waveform: 1-Saw 2-PW/Sq. 3-Tri/Saw/Ramp 4-Buzz", 	1,      4,    1,      1,      2,    100,     30,    0, 105,   -1
gkharm, ihharm 		FLcount  "Number of Harms.",        	               		-1,   100,    1,      1,      2,     60,     30,  355, 125,   -1
gklh, ihlh 		FLcount  "Lowest Harm.",		      	        	1,    100,    1,      1,      2,     60,     30,  415, 125,   -1

;INITIALISE VALUATORS		VALUE | HANDLE
		FLsetVal_i	.005, 	ihgliss
		FLsetVal_i	2, 	ihBendRnge
		FLsetVal_i	.5, 	ihpw
		FLsetVal_i	1, 	ihwave
		FLsetVal_i	0, 	ihleak
		FLsetVal_i	.5, 	ihnyx
		FLsetVal_i	1, 	ihmul
		FLsetVal_i	30, 	ihharm
		FLsetVal_i	0, 	ihlh
		FLsetVal_i	0.2, 	ihamp
		FLsetVal_i	0, 	ihtrmdep
		FLsetVal_i	.1, 	ihvibdep
		FLsetVal_i	5, 	gihmodfreq

		FLsetVal_i	1, 	ihPStrLev
		FLsetVal_i	.00001,	ihPAttTim
		FLsetVal_i	1, 	ihPAttLev
		FLsetVal_i	.00001,	ihPDecTim
		FLsetVal_i	.00001,	ihPRelTim
		FLsetVal_i	1, 	ihPRelLev

		FLsetVal_i	.00001, ihFAttTim
		FLsetVal_i	1, 	ihFAttLev
		FLsetVal_i	.00001, ihFDecTim
		FLsetVal_i	1, 	ihFSusLev
		FLsetVal_i	.1, 	ihFRelTim
		FLsetVal_i	0, 	ihFRelLev
		FLsetVal_i	4, 	ihFEnvAmt
		
		FLsetVal_i	.00001, ihAAttTim
		FLsetVal_i	1, 	ihAAttLev
		FLsetVal_i	.00001, ihADecTim
		FLsetVal_i	1, 	ihASusLev
		FLsetVal_i	.00001, ihARelTim
		FLsetVal_i	.001, 	ihARelLev
		FLsetVal_i	.5, 	gihRes
		FLsetVal_i	2, 	gihBaseFrq
		FLsetVal_i	.2, 	ihDlyAmt
		FLsetVal_i	.9, 	ihDlyTim
		FLsetVal_i	.2, 	ihDlyFB

;TEXT BOXES												TYPE | FONT | SIZE | WIDTH | HEIGHT | X | Y
ih		 	FLbox  	"                    Polyphonic MIDI synth.                   ", 	1,      5,     14,    490,    20,     505, 160
ih		 	FLbox  	"-------------------------------------------------------------", 	1,      5,     14,    490,    20,     505, 180
ih		 	FLbox  	"This example is merely a polyphonic version of the monophonic", 	1,      5,     14,    490,    20,     505, 200
ih		 	FLbox  	"synthe of the previous example.                              ", 	1,      5,     14,    490,    20,     505, 220
ih		 	FLbox  	"Additional MIDI controllers are:                             ", 	1,      5,     14,    490,    20,     505, 240
ih		 	FLbox  	"CC#2 - Low frequency modulation frequency                    ", 	1,      5,     14,    490,    20,     505, 260
ih		 	FLbox  	"CC#3 - Lowpass filter cutoff frequency                       ", 	1,      5,     14,    490,    20,     505, 280
ih		 	FLbox  	"CC#4 - Resonance of the filter                               ", 	1,      5,     14,    490,    20,     505, 300
ih		 	FLbox  	"Additionally the signal is passed through a stereo ping-pong ", 	1,      5,     14,    490,    20,     505, 320
ih		 	FLbox  	"delay.                                                       ", 	1,      5,     14,    490,    20,     505, 340
ih		 	FLbox  	"Pitch bend is implemented, the depth of which can be set by  ", 	1,      5,     14,    490,    20,     505, 360
ih		 	FLbox  	"the user in the interface.                                   ", 	1,      5,     14,    490,    20,     505, 380

		FLpanel_end	;END OF PANEL CONTENTS
		FLrun		;RUN THE WIDGET THREAD

gkamp		init	0	;INITIALISE GLOBAL VARIABLES
gkcps		init	0       ;INITIALISE GLOBAL VARIABLES
gkNumInstr1	init	0       ;INITIALISE GLOBAL VARIABLES
gkvib		init	0       ;INITIALISE GLOBAL VARIABLES
gaSend		init	0	;INITIALISE GLOBAL VARIABLES
gkamp		init	0.2	;INITIALISE GLOBAL VARIABLES

;INITIALISE MIDI CONTROLLERS
;			CH | CC | VAL
		initc7	1,    1,   0		;VIBRATO AMPLITUDE
		initc7	1,    2,   .25		;VIBRATO FREQUENCY
		initc7	1,    3,   .5		;FILTER BASE FREQUENCY
		initc7	1,    4,   .5/.9	;FILTER RESONANCE

instr	99	;UPDATING DUAL MODE MIDI/FLTK VALUATORS
#define	NAME	#modfreq#					;TEXT MACRO IS DEFINED
	k$NAME		ctrl7		1,2,0,20			;READ MIDI CONTROLLER
	ktrig$NAME	changed		k$NAME				;CREATE A TRIGGER PULSE IF MIDI CONTROLLER IS MOVED
			FLsetVal	ktrig$NAME, k$NAME, gih$NAME	;UPDATE FLTK VALUATOR IF MIDI CONTROLLER HAS BEEN MOVED
	
	;PROCEDURE IS REPEATED FOR OTHER DUAL MIDI/FLTK VALUATORS 
#define	NAME	#BaseFrq#
	k$NAME		ctrl7		 1,3,0,14
	ktrig$NAME	changed		k$NAME
			FLsetVal	ktrig$NAME, k$NAME, gih$NAME
			
#define	NAME	#Res#
	k$NAME		ctrl7		1,4,0,1
	ktrig$NAME	changed		k$NAME
			FLsetVal	ktrig$NAME, k$NAME, gih$NAME		
endin
	
instr	1	;RECEIVES MIDI NOTE INPUT - TRIGGERS ONE NOTE AT A TIME
	;READ VALUES FOR FREQUENCY FROM A MIDI KEYBOARD 
	icps		cpsmidi
	
	;PITCH BEND INFORMATION IS READ
	iSemitoneBendRange 	init	i(gkBendRnge)			;PITCH BEND RANGE IN SEMITONES (WILL BE DEFINED FURTHER LATER) - SUGGESTION - THIS COULD BE CONTROLLED BY AN FLTK COUNTER
	imin 			= 	0				;EQUILIBRIUM POSITION
	imax 			= 	iSemitoneBendRange * .0833333	;MAX PITCH DISPLACEMENT (IN oct FORMAT)
	kbend			pchbend	imin, imax			;PITCH BEND VARIABLE (IN oct FORMAT)
	gkbendmlt		=	cpsoct(8+kbend)/cpsoct(8.00)	;CREATE A MULTIPLIER THAT WHEN MULTIPLIED TO THE FREQUENCY OF AN OSCILLATOR WILL IMPLEMENT PITCH BEND
	
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	iporttime	=	.03					;VALUE USED AS PORTAMENTO TIME FOR OTHER VALUATORS
	kporttime	linseg	0,(.001),iporttime,(1),iporttime	;RAMPING UP VARIABLE IS CREATED THAT WILL BE USED AT PORTAMENTO TIME
	kpw	portk	gkpw, kporttime					;PORTAMENTO IS APPLIED TO gkpw VARIABLE
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	kmodwhl		ctrl7	1,1,0,1
	imodwave	=	1
	kmod		oscil	1, gkmodfreq, imodwave
	gkvib		=	(kmod * kmodwhl * gkvibdep) + 1
	gktrm		=	1 - (kmod * .5 * gktrmdep * kmodwhl) - (gktrmdep * .5 * kmodwhl)
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		
	;AMPLITUDE ENVELOPE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	aAEnv		linsegr	0, i(gkAAttTim), i(gkAAttLev), i(gkADecTim), i(gkASusLev), i(gkARelTim), i(gkARelLev)
	
	;PITCH MULTIPLIER ENVELOPE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	kPEnv		linsegr	i(gkPStrLev), i(gkPAttTim), i(gkPAttLev), i(gkPDecTim), 1, i(gkPRelTim), i(gkPRelLev)
	
	if	gkwave==4	goto	SKIP1	;IF gkwave=4 (I.E. 'BUZZ') JUMP TO LABEL 'SKIP1'
	
	;VCO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	ifn	=	1						;FUNCTION TABLE FOR A SINE WAVE THAT WILL BE USED BY VCO
	imaxd	=	1						;MAXIMUM DELAY TIME				
	asig	vco 	gkamp*gktrm*0.3, icps*gkvib*kPEnv*gkbendmlt, i(gkwave), kpw, ifn, imaxd, i(gkleak), i(gknyx);, 0, 0
	goto	ESCAPE1		;JUMP TO LABEL 'ESCAPE1'
	
	;GBUZZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	SKIP1:			;LABEL 'SKIP1'
	;OUTPUT	OPCODE	AMPLITUDE     |         FREQUENCY         | NO.OF_HARMONICS | LOWEST_HARMONIC | POWER | FUNCTION_TABLE
	asig	gbuzz 	gkamp*gktrm,    icps*gkvib*kPEnv*gkbendmlt,      gkharm,            gklh,        gkmul,       2
	;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	ESCAPE1:		;LABEL 'ESCAPE1'
	
	;FILTER ENVELOPE - ALL LEVELS ARE GIVEN IN OCT FORMAT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	kFEnv		linsegr	0, i(gkFAttTim), i(gkFAttLev), i(gkFDecTim), i(gkFSusLev), i(gkFRelTim), i(gkFRelLev)
	
	kBaseFrq	lineto	gkBaseFrq, kporttime	;APPLY LINETO SMOOTHING TO gkBaseFrq (CUTOFF FREQUENCY) VARIABLE
	kCFoct		=	(kFEnv*gkFEnvAmt) + kBaseFrq	;FINAL FILTER CUTOFF VALUE (IN CPS) INCORPORATING THE FILTER ENVELOPE AND THE FILTER BASE LEVEL
	kCFoct		limit	kCFoct, 4, 14	;LIMIT FILTER CUTOFF RANGE - THIS PREVENTS THE POSSIBILITY OF CRASHES OR NASTY NOISES DUE TO MASSIVELY OUT OF RANGE CUTOFF RANGES
	kCFcps		=	cpsoct(kCFoct)	;CONVERT CUTOFF VALUE FROM AN OCT FORMAT VALUE INTO A CPS VALUE
	
	;CREATE A FILTERED VERSION OF THE OSCILLATOR SIGNAL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	aFilt		moogladder asig, kCFcps, gkRes
	
	aFilt	=	aFilt * aAEnv	;APPLY AMPLITUDE ENVELOPE
	
	;SEND FILTERED SIGNAL TO OUTPUT
			outs	aFilt, aFilt
	gaSend		=	gaSend+(aFilt*gkDlyAmt)	;CREATE AN EFFECTS SEND AUDIO SIGNAL WHICH IS SENT TO THE DELAY EFFECT INSTRUMENT
			endin
	
			instr	3	; PING PONG DELAY
	imaxdelay	=	2		;MAXIMUM DELAY TIME
	
	;LEFT CHANNEL OFFSETTING DELAY (NO FEEDBACK!)
	aBuffer		delayr	imaxdelay*.5
	aLeftOffset	deltap3	gkDlyTim*.5
			delayw	gaSend
			
	;LEFT CHANNEL DELAY WITH FEEDBACK
	aFBsigL		init	0
	aBuffer		delayr	imaxdelay
	aDlySigL	deltap3	gkDlyTim
			delayw	aLeftOffset+aFBsigL
	aFBsigL		=	aDlySigL * gkDlyFB
	
	;RIGHT CHANNEL DELAY WITH FEEDBACK
	aFBsigR		init	0
	aBuffer		delayr	imaxdelay
	aDlySigR	deltap3	gkDlyTim
			delayw	gaSend+aFBsigR
	aFBsigR		=	aDlySigR * gkDlyFB
	
			outs	aDlySigL+aLeftOffset, aDlySigR	;SEND DELAY OUTPUT SIGNALS TO THE SPEAKERS
	gaSend		=	0		;RESET EFFECTS SEND GLOBAL AUDIO VARIABLE TO PREVENT STUCK VALUES WHEN INSTR 1 STOPS PLAYING
endin
	
</CsInstruments>

<CsScore>
f1 0 131072 10 1  ;A SINE WAVE - USED BY BOTH THE VIBRATO AND THE vco
f2 0 65536 9 1 1 90  	;COSINE WAVE (USED BY GBUZZ)

i 3 0 3600	;INSTRUMENT 3 PLAYS FOR 1 HOUR
i99 0 3600	;INSTRUMENT 99 PLAYS FOR 1 HOUR
</CsScore>

</CsoundSynthesizer>