-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheffects_combined.csd
executable file
·145 lines (112 loc) · 2.56 KB
/
effects_combined.csd
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<CsoundSynthesizer>
<CsOptions>
-odac -W -d
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 100
nchnls = 2
0dbfs = 1
; Sound generating instruments
instr 1
; File management
Sfile = "./local/soundfile"
iNumChannels filenchnls Sfile
iAmplitudeScaling = 0.4
prints "NUMBER OF CHANNELS: "
print iNumChannels
; Get potmeter value(s)
kAmp chnget "targetAmplitude"
if iNumChannels == 1 then
aDryL diskin2 Sfile, 1, 0, 1
aDryR = aDryL
elseif iNumChannels == 2 then
aDryL, aDryR diskin2 Sfile, 1, 0, 1
endif
aDryL *= kAmp
aDryR *= kAmp
aDryL *= iAmplitudeScaling
aDryR *= iAmplitudeScaling
chnset aDryL, "target_effect_left"
chnset aDryR, "target_effect_right"
endin
instr 2
; File management
Sfile = "./local/soundfile"
iNumChannels filenchnls Sfile
iAmplitudeScaling = 0.4
prints "NUMBER OF CHANNELS: "
print iNumChannels
; Get potmeter value(s)
kParam1 chnget "param1"
kParam2 chnget "param2"
kAmp chnget "userAmplitude"
if iNumChannels == 1 then
aDryL diskin2 Sfile, 1, 0, 1
aDryR = aDryL
elseif iNumChannels == 2 then
aDryL, aDryR diskin2 Sfile, 1, 0, 1
endif
aDryL *= kAmp
aDryR *= kAmp
aDryL *= iAmplitudeScaling
aDryR *= iAmplitudeScaling
chnset aDryL, "reverbL"
chnset aDryR, "reverbR"
endin
; Target effects
instr 10
a1 chnget "target_effect_left"
a2 chnget "target_effect_right"
;**************** effect: reverbsc ********************************
kfblvl = 0.772482674384
kfco = 4905.79466643
kmix = 0.807089803209
; FDN reverb
ar1,ar2 reverbsc a1, a2, kfblvl, kfco
a1 = (ar1*kmix) + (a1*(1-kmix))
a2 = (ar2*kmix) + (a2*(1-kmix))
chnmix a1, "masterL"
chnmix a2, "masterR"
chnclear "target_effect_left"
chnclear "target_effect_right"
endin
; User effects
instr 90
aDryL chnget "reverbL"
aDryR chnget "reverbR"
kParam1 chnget "param1"
kParam2 chnget "param2"
kParam3 chnget "param3"
kParam4 chnget "param4" ; Mix
; Predelay
kParam3 *= 0.001
aDummyL delayr 2
aDelayedL deltapi kParam3
delayw aDryL
aDummyR delayr 2
aDelayedR deltapi kParam3
delayw aDryR
aWetL, aWetR reverbsc aDelayedL, aDelayedR, kParam1, kParam2
chnmix aDryL * sqrt(1 - kParam4), "masterL"
chnmix aDryR * sqrt(1 - kParam4), "masterR"
chnmix aWetL * sqrt(kParam4), "masterL"
chnmix aWetR * sqrt(kParam4), "masterR"
chnclear "reverbL"
chnclear "reverbR"
endin
; Master channel
instr 99
aL chnget "masterL"
aR chnget "masterR"
outs aL, aR
chnclear "masterL"
chnclear "masterR"
endin
</CsInstruments>
<CsScore>
i10 0 9999999
i90 0 9999999
i99 0 9999999
</CsScore>
</CsoundSynthesizer>