Debian Codegraph @

examples/ftconv.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 ; Audio out Audio in
5 -odac -iadc ;;;RT audio I/O
6 ; For Non-realtime ouput leave only the line below:
7 ; -o ftconv.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10 sr = 48000
11 ksmps = 32
12 nchnls = 2
13 0dbfs = 1
14
15 garvb init 0
16 gaW init 0
17 gaX init 0
18 gaY init 0
19
20 itmp ftgen 1, 0, 64, -2, 2, 40, -1, -1, -1, 123, \
21 1, 13.000, 0.05, 0.85, 20000.0, 0.0, 0.50, 2, \
22 1, 2.000, 0.05, 0.85, 20000.0, 0.0, 0.25, 2, \
23 1, 16.000, 0.05, 0.85, 20000.0, 0.0, 0.35, 2, \
24 1, 9.000, 0.05, 0.85, 20000.0, 0.0, 0.35, 2, \
25 1, 12.000, 0.05, 0.85, 20000.0, 0.0, 0.35, 2, \
26 1, 8.000, 0.05, 0.85, 20000.0, 0.0, 0.35, 2
27
28 itmp ftgen 2, 0, 262144, -2, 0
29 spat3dt 2, -0.2, 1, 0, 1, 1, 2, 0.005
30
31 itmp ftgen 3, 0, 262144, -52, 3, 2, 0, 4, 2, 1, 4, 2, 2, 4
32
33 instr 1
34
35 a1 vco2 1, 440, 10
36 kfrq port 100, 0.008, 20000
37 a1 butterlp a1, kfrq
38 a2 linseg 0, 0.003, 1, 0.01, 0.7, 0.005, 0, 1, 0
39 a1 = a1 * a2 * 2
40 denorm a1
41 vincr garvb, a1
42 aw, ax, ay, az spat3di a1, p4, p5, p6, 1, 1, 2
43 vincr gaW, aw
44 vincr gaX, ax
45 vincr gaY, ay
46
47 endin
48
49 instr 2
50
51 denorm garvb
52 ; skip as many samples as possible without truncating the IR
53 arW, arX, arY ftconv garvb, 3, 2048, 2048, (65536 - 2048)
54 aW = gaW + arW
55 aX = gaX + arX
56 aY = gaY + arY
57 garvb = 0
58 gaW = 0
59 gaX = 0
60 gaY = 0
61
62 aWre, aWim hilbert aW
63 aXre, aXim hilbert aX
64 aYre, aYim hilbert aY
65 aWXr = 0.0928*aXre + 0.4699*aWre
66 aWXiYr = 0.2550*aXim - 0.1710*aWim + 0.3277*aYre
67 aL = aWXr + aWXiYr
68 aR = aWXr - aWXiYr
69
70 outs aL, aR
71
72 endin
73
74 </CsInstruments>
75 <CsScore>
76
77 i 1 0 0.5 0.0 2.0 -0.8
78 i 1 1 0.5 1.4 1.4 -0.6
79 i 1 2 0.5 2.0 0.0 -0.4
80 i 1 3 0.5 1.4 -1.4 -0.2
81 i 1 4 0.5 0.0 -2.0 0.0
82 i 1 5 0.5 -1.4 -1.4 0.2
83 i 1 6 0.5 -2.0 0.0 0.4
84 i 1 7 0.5 -1.4 1.4 0.6
85 i 1 8 0.5 0.0 2.0 0.8
86 i 2 0 10
87 e
88
89 </CsScore>
90 </CsoundSynthesizer>