forked from byulparan/livecoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path240318.csd
More file actions
156 lines (124 loc) · 2.92 KB
/
240318.csd
File metadata and controls
156 lines (124 loc) · 2.92 KB
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
146
147
148
149
150
151
152
153
154
155
156
<CsoundSynthesizer>
<CsOptions>
-odac -m4
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 256
nchnls = 2
0dbfs = 1.0
seed 0
gkTempo init 60
gkResolution init 48
#define METRO(N) # (i(gkResolution) / (1 / ($N))) #
gaRevL init 0
gaRevR init 0
gaDelL init 0
gaDelR init 0
gkRain init .6
schedule "reverb", 0, -1
schedule "delay", 0, -1
schedule "clock", 0, -1
schedule "rain", 0, -1
instr rain
kenv lag gkRain, 8.0
al, ar diskin "samples/rain1.ogg", 1, 0, 1
outs al*kenv, ar*kenv
endin
instr clock
ktrig metro gkTempo / 60 * gkResolution
kcount init 0
if ktrig == 1 then
schedulek "schedule", .0, .1, kcount
kcount += 1
endif
endin
instr schedule
icount = p4
iscale[] fillarray 0, 2, 4, 6, 7, 9, 11
if icount % $METRO(4) == 0 then
schedule "sawPad", 0, 6, 48
schedule "sawPad", 0, 6, 67
schedule "sawPad", 0, 6, 71
schedule "ambient", 0, 6, 48
schedule "ambient", 0, 6, 55
schedule "ambient", 0, 6, iscale[random(0, lenarray(iscale))] + 60
schedule "ambient", 0, 6, iscale[random(0, lenarray(iscale))] + 72
endif
if icount % $METRO(1) == 0 && rnd(1.0) > .3 then
schedule "bell", 0, 4, iscale[random(0, lenarray(iscale))] + 72
endif
if icount % $METRO(8) == 0 then
schedule "pulse", 0, .1, 67
schedule "pulse", 4, .1, 67
imax = floor(random(3, 8))
icnt = 0
while icnt < imax do
schedule "pulse", 7 + ((1/imax)*icnt), .1, iscale[random(0, lenarray(iscale))] + 72
icnt = icnt + 1
od
endif
endin
instr pulse
kenv line .1, p3, .0
asig vco2 kenv, cpsmidinn(p4), 2, .5
outs asig, asig
gaRevL += asig*.3
gaRevR += asig*.3
gaDelL += asig*.3
gaDelR += asig*.3
endin
instr bell
kenv line .036, p3, .0
ifreq = cpsmidinn(p4)
a1 foscil kenv, ifreq, 1, 1, .7
a2 foscil kenv, ifreq, 1, 7, .7
a3 foscil kenv, ifreq, 1, 14, .7
asig = (a1 + a2 + a3) * .7
outs asig, asig
gaRevL += asig*.3
gaRevR += asig*.3
gaDelL += asig*.3
gaDelR += asig*.3
endin
instr sawPad
kenv linseg .0, p3*.2, .02, p3*.6, .02, p3*.2, .0
ifreq = cpsmidinn(p4)
al vco2 kenv*2, ifreq
ar vco2 kenv*2, ifreq + 2
outs butterlp(al, 1000), butterlp(ar, 1000)
endin
instr ambient
kenv linseg .0, p3*.2, .02, p3*.6, .02, p3*.2, .0
ifreq = cpsmidinn(p4)
a1 foscil kenv, ifreq, 1, 1, 1
a2 foscil kenv, ifreq, 1, 2, .7
a3 foscil kenv, ifreq, 1, 7, .4
klfo randi .3, .4
klfo = abs(klfo) + .3
a4 foscil kenv*klfo, ifreq, 1, 14, .3
amod oscil 1000, 4000
a5 oscil kenv, ifreq + amod
asig = (a1 + a2 + a3 + a4 + a5) * 1.4
al, ar pan2 asig, oscil:k(.3, .4) + .5
outs al, ar
gaRevL += al*.3
gaRevR += ar*.3
endin
instr reverb
al, ar reverbsc gaRevL, gaRevR, .9, 12000
outs al, ar
gaRevL = 0
gaRevR = 0
endin
instr delay
al vdelay gaDelL, 60/gkTempo * (1000/2), 4000
ar vdelay gaDelR, 60/gkTempo * (1000/3), 4000
outs al, ar
gaDelL = al * .3
gaDelR = ar * .3
endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>