-
Notifications
You must be signed in to change notification settings - Fork 2
/
zirkonium_server.pd
334 lines (334 loc) · 9.02 KB
/
zirkonium_server.pd
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
#N canvas 554 111 357 220 10;
#X declare -path . -path rendering_algorithm/vbap -path ../externals
;
#N canvas 781 75 345 172 inputs 0;
#X obj 33 78 r \$0-input;
#X text 27 18 Hardware input channels;
#X text 27 38 Audio signal sent to receive~ name "zirk_inputID";
#X obj 33 108 clone -s 1 zirk_input 64;
#X connect 0 0 3 0;
#X restore 28 110 pd inputs;
#N canvas 0 23 382 196 declare 0;
#X obj 30 49 declare -path . -path rendering_algorithm/vbap -path ../externals
;
#X text 23 15 add local paths so included externals will load;
#X restore 194 42 pd declare;
#N canvas 567 204 390 185 sourcefiles 0;
#X obj 79 96 r \$0-sourcefile;
#X text 21 18 Source file players;
#X text 21 39 You can play up to 64 files at the same time. Per-channel
audio signals to receive~ name: "zirk_sfID-CHANNEL";
#X obj 79 130 clone -s 1 zirk_sourcefile 64;
#X connect 0 0 3 0;
#X restore 93 110 pd sourcefiles;
#X text 191 156 virtual speaker layer;
#X text 191 179 hardware output layer;
#N canvas 826 237 428 339 ids 0;
#X obj 251 219 list prepend level id;
#X obj 32 93 r \$0-id;
#N canvas 346 373 536 254 test 0;
#X obj 67 117 noise~;
#X obj 42 178 *~ 0.1;
#X obj 148 58 inlet;
#X obj 211 150 zirk_id 0 64;
#X obj 280 205 outlet;
#X obj 42 206 zirk_source 0test;
#X text 22 12 Test white noise \, id 0;
#X msg 280 177 0 \$1;
#X obj 253 58 loadbang;
#X msg 253 85 input zirk_source0test \, report current 1;
#X obj 42 85 lib/pinknoise~;
#N canvas 397 140 428 426 demux~ 0;
#X obj 108 67 inlet~;
#X obj 178 67 inlet~;
#X obj 258 66 inlet;
#X obj 108 373 outlet~;
#X obj 108 309 *~ 1;
#X obj 178 314 *~ 0;
#X msg 258 122 1 0;
#X msg 286 151 0 1;
#X obj 258 90 select 0 1;
#X obj 258 275 unpack 0 0;
#X connect 0 0 4 0;
#X connect 1 0 5 0;
#X connect 2 0 8 0;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 6 0 9 0;
#X connect 7 0 9 0;
#X connect 8 0 6 0;
#X connect 8 1 7 0;
#X connect 9 0 4 1;
#X connect 9 1 5 1;
#X restore 42 148 pd demux~;
#X obj 148 85 route noise;
#X connect 0 0 11 1;
#X connect 1 0 5 0;
#X connect 2 0 12 0;
#X connect 3 1 7 0;
#X connect 7 0 4 0;
#X connect 8 0 9 0;
#X connect 9 0 3 0;
#X connect 10 0 11 0;
#X connect 11 0 1 0;
#X connect 12 0 11 2;
#X connect 12 1 3 0;
#X restore 32 180 pd test id 0;
#X obj 32 267 list trim;
#X obj 32 120 route 0;
#X obj 71 152 route all;
#X text 31 47 Receives audio signal from a receive~ name and sends
to zirk_speakers. zirk_id 0 is a test white noise source.;
#X obj 32 219 list prepend vbap current;
#X obj 32 295 s #zirk-out;
#X text 31 17 Sound object \, maps & spatializes inputs to outputs
;
#X obj 251 180 clone -s 1 zirk_id 64 64;
#X connect 0 0 3 0;
#X connect 1 0 4 0;
#X connect 2 0 7 0;
#X connect 3 0 8 0;
#X connect 4 0 2 0;
#X connect 4 1 5 0;
#X connect 4 1 10 0;
#X connect 5 0 2 0;
#X connect 7 0 3 0;
#X connect 10 0 0 0;
#X connect 10 1 7 0;
#X restore 28 133 pd ids;
#N canvas 424 327 394 278 speakers 0;
#X obj 123 173 list prepend level speaker;
#X obj 123 121 r \$0-speaker;
#X obj 123 201 list trim;
#X text 15 8 Virtual speakers;
#X text 15 52 The connection of speaker and hardware output channels
can be configurable \, thus the speaker IDs are NOT hardware out channels.
;
#X text 15 30 Audio signals are received by catch~ name: "zirk_speakerID"
;
#X obj 123 230 s #zirk-out;
#X obj 123 147 clone -s 1 zirk_speaker 64;
#X connect 0 0 2 0;
#X connect 1 0 7 0;
#X connect 2 0 6 0;
#X connect 7 0 0 0;
#X restore 28 156 pd speakers;
#N canvas 757 320 390 165 outputs 0;
#X obj 42 71 r \$0-output;
#X text 26 16 Hardware output channels;
#X text 26 38 Audio signal received by catch~ name "zirk_outputID"
;
#X obj 42 123 clone -s 1 zirk_output 64;
#X connect 0 0 3 0;
#X restore 28 179 pd outputs;
#X obj 29 12 r #zirk-in;
#X text 191 110 input & source layer;
#N canvas 720 159 323 182 hrtf 0;
#X obj 102 121 zirk_output_hrtf;
#X obj 102 95 route all;
#X obj 102 68 r \$0-output;
#X text 32 13 Stereo HRTF channel receivers: dac~ 1 2;
#X obj 34 68 r \$0-hrtf;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 4 0 0 0;
#X restore 99 179 pd hrtf;
#N canvas 521 428 485 272 commands 0;
#X obj 27 28 inlet;
#N canvas 267 73 366 342 layers 0;
#X obj 32 31 inlet;
#X obj 32 59 route input sourcefile id speaker output hrtf;
#X obj 76 250 s \$0-sourcefile;
#N canvas 0 23 360 238 hrtf 0;
#X obj 39 31 inlet;
#X obj 39 169 list trim;
#X obj 39 197 s \$0-id;
#X obj 39 141 list prepend all hrtf;
#X obj 84 84 s \$0-hrtf;
#X obj 39 60 route on;
#X obj 39 109 list prepend on;
#X text 118 171 forward on bool to ids;
#X connect 0 0 5 0;
#X connect 1 0 2 0;
#X connect 3 0 1 0;
#X connect 5 0 6 0;
#X connect 5 1 4 0;
#X connect 6 0 3 0;
#X restore 254 109 pd hrtf;
#X obj 299 84 outlet;
#X obj 32 287 s \$0-input;
#X obj 210 145 s \$0-output;
#X obj 121 219 s \$0-id;
#X obj 165 187 s \$0-speaker;
#X connect 0 0 1 0;
#X connect 1 0 5 0;
#X connect 1 1 2 0;
#X connect 1 2 7 0;
#X connect 1 3 8 0;
#X connect 1 4 6 0;
#X connect 1 5 3 0;
#X connect 1 6 4 0;
#X restore 27 63 pd layers;
#X obj 222 124 print zirkonium_server: unknown command;
#X obj 157 154 s \$0-layout;
#X obj 92 182 s \$0-samplerate;
#X obj 27 214 s \$0-transport;
#X text 83 28 command routing;
#X obj 27 95 route transport samplerate layout;
#X connect 0 0 1 0;
#X connect 1 0 7 0;
#X connect 7 0 5 0;
#X connect 7 1 4 0;
#X connect 7 2 3 0;
#X connect 7 3 2 0;
#X restore 29 43 pd commands;
#X text 191 133 id (sound object) layer;
#X text 108 10 Zirkonium ZKM | Hertz-Labor 2015-2018;
#N canvas 521 162 443 405 speaker 0;
#X obj 43 191 zirk_layout_vbap;
#X obj 136 253 list trim;
#X obj 136 280 s #zirk-out;
#X obj 43 333 list trim;
#X obj 43 362 s \$0-id;
#X obj 43 305 list prepend all vbap;
#X obj 290 191 zirk_layout_hoa;
#X obj 43 150 t l l;
#X obj 290 305 list prepend all hoa;
#X obj 43 84 r \$0-layout;
#N canvas 674 82 711 629 transform 0;
#X obj 196 27 inlet;
#X obj 85 586 outlet;
#X obj 439 275 until;
#X obj 439 304 list append;
#X obj 531 287 bang;
#X obj 439 330 list split 2;
#X obj 439 355 unpack 0 0;
#X obj 439 448 pack 0 0;
#X obj 422 513 list append;
#X obj 534 495 t l;
#X obj 439 474 list prepend;
#X obj 422 235 t b b l b;
#X obj 127 275 until;
#X obj 127 304 list append;
#X obj 212 287 bang;
#X obj 110 513 list append;
#X obj 214 495 t l;
#X obj 127 474 list prepend;
#X obj 110 240 t b b l b;
#X obj 127 330 list split 1;
#X obj 439 379 * -1;
#X obj 439 400 + 90;
#X obj 127 379 * -1;
#X obj 127 400 + 90;
#X obj 110 175 route 2 3;
#X obj 422 546 list prepend 3;
#X obj 110 546 list prepend 2;
#X obj 127 426 lib/circlewrap;
#X obj 439 426 lib/circlewrap;
#X obj 85 145 route 0 1;
#X obj 196 60 route transform rotate flip;
#X obj 249 351 t f f;
#X obj 302 324 t f f;
#X text 262 22 transform: optionally rotate azimuth in degrees and/or
flip vertically, f 36;
#X text 492 236 3D;
#X text 176 240 2D;
#X obj 302 266 sel 0 1;
#X msg 302 293 1;
#X msg 338 293 - 1;
#X text 393 61 default: transform 0 \, rotate 90 \, flip 1;
#X obj 421 207 print zirkonium_server: unknown layout;
#X obj 85 111 list prepend 0;
#X connect 0 0 30 0;
#X connect 2 0 3 0;
#X connect 3 0 5 0;
#X connect 4 0 2 1;
#X connect 5 0 6 0;
#X connect 5 1 3 1;
#X connect 5 2 4 0;
#X connect 6 0 20 0;
#X connect 6 1 7 1;
#X connect 7 0 10 0;
#X connect 8 0 25 0;
#X connect 9 0 10 1;
#X connect 10 0 9 0;
#X connect 10 0 8 1;
#X connect 11 0 8 0;
#X connect 11 1 2 0;
#X connect 11 2 3 1;
#X connect 11 3 10 1;
#X connect 12 0 13 0;
#X connect 13 0 19 0;
#X connect 14 0 12 1;
#X connect 15 0 26 0;
#X connect 16 0 17 1;
#X connect 17 0 16 0;
#X connect 17 0 15 1;
#X connect 18 0 15 0;
#X connect 18 1 12 0;
#X connect 18 2 13 1;
#X connect 18 3 17 1;
#X connect 19 0 22 0;
#X connect 19 1 13 1;
#X connect 19 2 14 0;
#X connect 20 0 21 0;
#X connect 21 0 28 0;
#X connect 22 0 23 0;
#X connect 23 0 27 0;
#X connect 24 0 18 0;
#X connect 24 1 11 0;
#X connect 24 2 40 0;
#X connect 25 0 1 0;
#X connect 26 0 1 0;
#X connect 27 0 17 0;
#X connect 28 0 7 0;
#X connect 29 0 1 0;
#X connect 29 1 24 0;
#X connect 29 2 40 0;
#X connect 30 0 41 1;
#X connect 30 1 31 0;
#X connect 30 2 36 0;
#X connect 30 3 41 0;
#X connect 31 0 23 1;
#X connect 31 1 21 1;
#X connect 32 0 22 1;
#X connect 32 1 20 1;
#X connect 36 0 37 0;
#X connect 36 1 38 0;
#X connect 37 0 32 0;
#X connect 38 0 32 0;
#X connect 41 0 29 0;
#X restore 43 120 pd transform;
#X text 24 14 Speaker layout handling;
#X text 127 120 <- rotate and/or flip around origin?;
#X obj 136 224 list prepend vbap set;
#X text 24 38 Converts polar (azimuth & elevation) positions to format
required by the spatialization algorithms.;
#X connect 0 0 5 0;
#X connect 0 1 13 0;
#X connect 1 0 2 0;
#X connect 3 0 4 0;
#X connect 5 0 3 0;
#X connect 6 0 8 0;
#X connect 7 0 0 0;
#X connect 7 1 6 0;
#X connect 8 0 3 0;
#X connect 9 0 10 0;
#X connect 10 0 7 0;
#X connect 13 0 1 0;
#X restore 29 70 pd speaker layout;
#N canvas 131 236 409 242 transport 0;
#X obj 93 180 s #zirk-out;
#X obj 93 87 r \$0-transport;
#X obj 93 150 zirk_transport;
#X text 16 13 Time transport;
#X text 19 36 Calculates elapsed time using audio block size & samplerate
;
#X obj 210 88 r \$0-samplerate;
#X msg 210 113 samplerate \$1;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X restore 194 70 pd transport;
#X connect 8 0 11 0;