<CsoundSynthesizer>

;
;	oscils: organ derivative
;	Bruce H. McCosar
;
;	$Id: oscils_o.csd 15 2008-05-11 16:13:13Z mccosar $
;

<CsOptions>

; Standard file output, from a numeric score
; ---------------------------------------------------------------------------
; -Wdo test.wav

; Realtime midi & JACK audio output
; ---------------------------------------------------------------------------
-d -+rtaudio=jack -o dac:system:playback_ -+rtmidi=alsa -M hw:1,0,1 -b 256 -B 512

</CsOptions>

<CsInstruments>

; ==================================================================== HEADER

sr	=	44100
kr	=	4410
ksmps	=	10
nchnls	=	2

; ============================================================ MACRO CONTROLS

#define	MSTVOL	#30#

; =============================================================== INSTRUMENTS

	instr	1
	;
	;	oscils instrument
	;	-----------------
	;	As note velocity increases, the phase of the different voices
	;	changes, and the release time grows slightly longer.
	;
ivel	veloc
icps	cpsmidi
	;	iamp,           icps, iphs
a0	oscils	2*ivel*$MSTVOL, icps, 0
a1	oscils	ivel*$MSTVOL,	icps*1.008, 0.0039*ivel
a2	oscils  ivel*$MSTVOL,	icps*0.992, 0.0039*ivel
	;	kamp, irise, idec, iatdec
kenv	linenr	1,    0.01,  0.004*ivel, 0.01
aL	=	(a0 + a1)*kenv
aR	=	(a0 + a2)*kenv
	outs	aL, aR
	;
	endin

</CsInstruments>

<CsScore>

; ================================================================== F-TABLES

; #	time	size	GEN	parameters
f 0	9999

</CsScore>

</CsoundSynthesizer>

