-
Notifications
You must be signed in to change notification settings - Fork 4
/
megra-supercollider-event-handlers-8ch.lisp
212 lines (200 loc) · 9.74 KB
/
megra-supercollider-event-handlers-8ch.lisp
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
(in-package :megra)
(defmethod handle-grain-event-sc-8ch ((g grain-event-8ch) timestamp &key)
(unless (gethash (grain-8ch-sample-location g) *sc-buffer-directory*)
(register-sample (grain-8ch-sample-location g)))
;; might save a hashtable access here ... later ...
(let ((bufnum (gethash (grain-8ch-sample-location g) *sc-buffer-directory*)))
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_8ch" -1 0 1
"bufnum" bufnum
"lvl" (coerce (event-level g) 'float)
"rate" (coerce (event-rate g) 'float)
"start" (coerce (event-start g) 'float)
"lp_freq" (coerce (event-lp-freq g) 'float)
"lp_q" (coerce (event-lp-q g) 'float)
"lp_dist" (coerce (event-lp-dist g) 'float)
"lp_freq_lfo_freq" (coerce (event-lp-freq-lfo-speed g) 'float)
"lp_freq_lfo_depth" (coerce (event-lp-freq-lfo-depth g) 'float)
"lp_freq_lfo_phase" (coerce (event-lp-freq-lfo-phase g) 'float)
"pf_freq" (coerce (event-pf-freq g) 'float)
"pf_q" (coerce (event-pf-q g) 'float)
"pf_gain" (coerce (event-pf-gain g) 'float)
"hp_freq" (coerce (event-hp-freq g) 'float)
"hp_q" (coerce (event-hp-q g) 'float)
"a" (coerce (* (event-attack g) 0.001) 'float)
"length" (coerce (* (- (event-duration g) (event-attack g) (event-release g)) 0.001) 'float)
"r" (coerce (* (event-release g) 0.001) 'float)
"pos" (coerce (- (event-position g) 1.0) 'float)
"rev" (coerce (event-reverb g) 'float))))
(defmethod handle-sine-event-sc-8ch ((s sine-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsf"
"sine_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float))
(defmethod handle-triangle-event-sc-8ch ((s triangle-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsf"
"tri_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float)))
(defmethod handle-cub-event-sc-8ch ((s cub-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsf"
"cub_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float))))
(defmethod handle-par-event-sc-8ch ((s par-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsf"
"par_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float)))
(defmethod handle-saw-event-sc-8ch ((s saw-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsf"
"saw_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float)))
(defmethod handle-square-event-sc-8ch ((s square-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsfsf"
"sqr_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch s) 'symbol)
(cm::hertz (event-pitch s))
(event-pitch s)) 'float)
"lvl" (coerce (event-level s) 'float)
"lp_freq" (coerce (event-lp-freq s) 'float)
"lp_q" (coerce (event-lp-q s) 'float)
"lp_dist" (coerce (event-lp-dist s) 'float)
"a" (coerce (* (event-attack s) 0.001) 'float)
"length" (coerce (* (- (event-duration s) (event-attack s) (event-release s)) 0.001) 'float)
"r" (coerce (* (event-release s) 0.001) 'float)
"pos" (coerce (- (event-position s) 1.0) 'float)
"rev" (coerce (event-reverb s) 'float)
"pulsewidth" (coerce (event-pulsewidth s) 'float)))
(defmethod handle-buzz-event-sc-8ch ((b buzz-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsfsf"
"buzz_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch b) 'symbol)
(cm::hertz (event-pitch b))
(event-pitch b)) 'float)
"lvl" (coerce (event-level b) 'float)
"lp_freq" (coerce (event-lp-freq b) 'float)
"lp_q" (coerce (event-lp-q b) 'float)
"lp_dist" (coerce (event-lp-dist b) 'float)
"a" (coerce (* (event-attack b) 0.001) 'float)
"length" (coerce (* (- (event-duration b) (event-attack b) (event-release b)) 0.001) 'float)
"r" (coerce (* (event-release b) 0.001) 'float)
"pos" (coerce (- (event-position b) 1.0) 'float)
"rev" (coerce (event-reverb b) 'float)
"harm" (coerce (event-harmonies b) 'float)))
(defmethod handle-pluck-event-sc-8ch ((p pluck-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsf"
"pluck_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch p) 'symbol)
(cm::hertz (event-pitch p))
(event-pitch p)) 'float)
"lvl" (coerce (event-level p) 'float)
"lp_freq" (coerce (event-lp-freq p) 'float)
"lp_q" (coerce (event-lp-q p) 'float)
"lp_dist" (coerce (event-lp-dist p) 'float)
"length" (coerce (* (event-duration p) 0.001) 'float)
"pos" (coerce (- (event-position p) 1.0) 'float)
"rev" (coerce (event-reverb p) 'float)))
(defmethod handle-risset-event-sc-8ch ((r risset-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsfsfsf"
"risset_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch r) 'symbol)
(cm::hertz (event-pitch r))
(event-pitch r)) 'float)
"lvl" (coerce (event-level r) 'float)
"lp_freq" (coerce (event-lp-freq r) 'float)
"lp_q" (coerce (event-lp-q r) 'float)
"lp_dist" (coerce (event-lp-dist r) 'float)
"a" (coerce (* (event-attack r) 0.001) 'float)
"d" (coerce (* (event-decay r) 0.001) 'float)
"s" (coerce (* (event-sustain r) 0.001) 'float)
"r" (coerce (* (event-release r) 0.001) 'float)
"pos" (coerce (- (event-position r) 1.0) 'float)
"rev" (coerce (event-reverb r) 'float)))
(defmethod handle-dx-rhodes-event-sc-8ch ((d dx-rhodes-event-8ch) timestamp &key)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisfsfsfsfsfsfsfsfsf"
"rhodey_sc_8ch" -1 0 1
"freq" (coerce (if (typep (event-pitch d) 'symbol)
(cm::hertz (event-pitch d))
(event-pitch d)) 'float)
"lvl" (coerce (event-level d) 'float)
"mix" (coerce (event-mix d) 'float)
"lfoSpeed" (coerce (event-level-lfo-speed d) 'float)
"lfoDepth" (coerce (event-level-lfo-depth d) 'float)
"modIndex" (coerce (event-mod-index d) 'float)
"vel" (coerce (event-velocity d) 'float)
"pos" (coerce (- (event-position d) 0.5) 'float)
"rev" (coerce (event-reverb d) 'float)))