File: vaget.csd

package info (click to toggle)
csound-manual 1%3A6.08.0~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 34,580 kB
  • sloc: xml: 193,471; python: 1,332; makefile: 783
file content (66 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
; Audio out   Audio in    No messages
-odac           -iadc     -d     ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o avarget.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>
sr=44100
ksmps=16
nchnls=2

	instr 1	; Sqrt Signal
ifreq = (p4 > 15 ? p4 : cpspch(p4))
iamp = ampdb(p5)

aout init 0
ksampnum init 0

kenv	linseg 0, p3 * .5, 1, p3 * .5, 0

aout1	vco2	1, ifreq
aout2	vco2	.5, ifreq * 2
aout3	vco2	.2, ifreq * 4

aout	sum 	aout1, aout2, aout3

;Take Sqrt of signal, checking for negatives
kcount = 0

loopStart:

	kval vaget kcount,aout

	if (kval > .0) then
		kval = sqrt(kval)
	elseif (kval < 0) then
		kval = sqrt(-kval) * -1
	else
		kval = 0
	endif

	vaset kval, kcount,aout

loop_lt kcount, 1, ksmps, loopStart

aout = aout * kenv

aout	moogladder aout, 8000, .1

aout = aout * iamp

outs aout, aout
	endin

</CsInstruments>

<CsScore>

i1	0.0	2 440 80
e

</CsScore>

</CsoundSynthesizer>