Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 5fcfcb7517038d1f44ab4e478e6e61fa > files > 517

csound-doc-6.10.0-1.mga7.noarch.rpm

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


giSine		ftgen 0, 0, 8192, 10, 1						; sine table
giCosEnv	ftgen 0, 0, 8192, -19, 1, .5, 270, .5		; inverted cosine envelope



; Parameters:
;
;	p3	duration
;	p4	amplitude
;	p5	frequency

instr 1

	idur	= p3
	iamp	= p4
	ifreq	= p5
	
	ifnum	= giSine									; table number constants
	ienvnum	= giCosEnv
	ilen	= ftlen(ifnum)
	ienvlen	= ftlen(ienvnum)
	
	aenvph	phasor	1/idur								; envelope oscillator
	aenv	tablei	aenvph*ienvlen, ienvnum
	aphase	phasor	ifreq								; waveform oscillator
	asig	tablei	aphase*ilen, ifnum
	
			out		iamp*aenv*asig
			
endin