-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmegra-supercollider-event-handlers-ambi.lisp
162 lines (158 loc) · 8.24 KB
/
megra-supercollider-event-handlers-ambi.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
(in-package :megra)
(defmethod handle-grain-event-sc-ambi ((g grain-event-ambi) timestamp &key)
(unless (gethash (grain-ambi-sample-location g) *sc-buffer-directory*)
(register-sample (grain-ambi-sample-location g)))
;; might save a hashtable access here ... later ...
(let ((bufnum (gethash (grain-ambi-sample-location g) *sc-buffer-directory*)))
(if (> (event-reverb g) 0)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi_rev" -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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)
"radius" (coerce (* (event-distance g) 0.001) 'float)
"rev" (coerce (event-reverb g) 'float))
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi" -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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)
"radius" (coerce (* (event-distance g) 0.001) 'float)))))
(defmethod handle-grain-event-sc-nores-ambi ((g grain-event-nores-ambi) timestamp &key)
(unless (gethash (nores-ambi-sample-location g) *sc-buffer-directory*)
(register-sample (nores-ambi-sample-location g)))
;; might save a hashtable access here ... later ...
(let ((bufnum (gethash (nores-ambi-sample-location g) *sc-buffer-directory*)))
(if (> (event-reverb g) 0)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi_rev_nores" -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_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)
"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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)
"rev" (coerce (event-reverb g) 'float))
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi_nores" -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_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)
"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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)))))
(defmethod handle-grain-event-sc-24db-ambi ((g grain-event-24db-ambi) timestamp &key)
(unless (gethash (twofourdb-ambi-sample-location g) *sc-buffer-directory*)
(register-sample (twofourdb-ambi-sample-location g)))
;; might save a hashtable access here ... later ...
(let ((bufnum (gethash (twofourdb-ambi-sample-location g) *sc-buffer-directory*)))
(if (> (event-reverb g) 0)
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi_rev_24db" -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_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)
"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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)
"rev" (coerce (event-reverb g) 'float))
(osc:simple-bundle cm::*oscout* timestamp
"/s_new"
"siiisisfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsfsf"
"grain_ambi_24db" -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_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)
"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)
"azi" (coerce (* (event-azimuth g) 3.14159) 'float)
"ele" (coerce (* (event-elevation g) (* 3.14159 0.5)) 'float)))))