-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhallu.pd
356 lines (356 loc) · 11.4 KB
/
hallu.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
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
#N canvas 0 63 1440 743 10;
#N canvas 257 23 1179 831 controls 0;
#X obj 501 154 tgl 15 0 empty empty loaded 17 7 0 10 -262144 -1 -1
0 1;
#X obj 355 -3 f 1;
#X obj 379 -3 f 0;
#X obj 206 -96 r \$0-gansynth_out;
#X obj 111 131 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 135 134 select directory...;
#X text 108 108 checkpoint;
#X obj -104 106 openpanel 1;
#X symbolatom 111 154 64 0 0 0 - - -;
#X obj 121 20 symbol;
#X obj 121 2 loadbang;
#X obj 355 -22 route on off;
#X obj 111 260 cnv 15 440 470 empty empty empty 20 12 0 14 -233017
-66577 0;
#X text 290 312 step;
#X floatatom 266 296 5 0 0 0 - - -;
#X text 300 296 /;
#X floatatom 310 296 5 0 0 0 - - -;
#X obj 203 293 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 199 313 next;
#X obj 148 293 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 133 313 previous;
#X obj 381 292 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 380 312 add;
#X obj 436 292 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 426 312 remove;
#X obj -126 23 + 1;
#X msg -132 355 prev_step;
#X msg -114 375 next_step;
#X msg -97 394 add_step;
#X msg -67 432 rand_step;
#X obj -129 746 s \$0-gansynth_in;
#X msg -80 413 remove_step;
#X text 119 267 steps;
#N canvas 0 23 450 300 (subpatch) 0;
#X array \$0-preview_audio 64000 float 0;
#X coords 0 1 63999 -1 200 100 1 0 0;
#X restore -127 930 graph;
#X obj 494 292 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 481 312 preview;
#X obj -108 180 expr \$0;
#X obj -126 207 pack s f;
#X obj -126 2 route index count;
#N canvas 0 23 450 300 (subpatch) 0;
#X array \$0-out_audio 800000 float 0;
#X coords 0 1 799999 -1 200 100 1 0 0;
#X restore 567 572 graph;
#X obj -64 519 expr round($f1);
#X text 600 160 interpolation steps;
#X text 564 109 settings;
#X obj 653 449 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 637 469 generate;
#X obj 624 684 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X obj 687 684 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X text 620 705 play;
#X text 683 705 save;
#X text 565 538 output;
#X msg -65 539 interp_steps \$1;
#X msg 95 -33 send_state;
#X obj 34 -52 loadbang;
#X msg -14 183 set \$1;
#X msg 35 183 set \$1;
#N canvas 0 22 450 278 (subpatch) 0;
#X array \$0-edits 8192 float 2;
#X coords 0 1 8192 -1 200 100 1 0 0;
#X restore -127 801 graph;
#X obj 576 132 hallu/numberslider2way 0 32;
#X obj 125 337 hallu/edit_sliders \$0-edits;
#X obj 169 -33 bang;
#X obj 111 204 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576
-1 -1;
#X symbolatom 111 227 64 0 0 0 - - -;
#X text 108 181 PCA;
#X text 135 207 select file...;
#X obj -11 222 openpanel 0;
#X msg -139 243 load \$1;
#X msg -127 293 load_ganspace_components \$1;
#X obj 662 -7 bang;
#X obj 662 31 vline~;
#X msg 662 12 1 \, 63998 4000;
#X obj 662 50 tabread4~ \$0-preview_audio;
#X obj 793 -57 bang;
#X obj 830 31 vline~;
#X obj 830 50 tabread4~ \$0-out_audio;
#X obj 605 757 savepanel;
#X obj 605 845 soundfiler;
#X obj 627 778 expr \$0;
#X obj 604 800 pack s f;
#X text 618 208 sample spacing;
#X text 629 256 start trim;
#X text 641 304 attack;
#X text 639 352 sustain;
#X msg -56 568 sample_spacing \$1;
#X msg -51 591 start_trim \$1;
#X msg -43 614 attack \$1;
#X msg -34 634 sustain \$1;
#X obj -130 463 expr \$0;
#X obj -98 690 expr \$0;
#X text 639 400 release;
#X msg -22 654 release \$1;
#X obj -42 61 route interp_steps sample_spacing start_trim attack sustain
release;
#X msg -98 710 hallucinate_noz \$1-out_audio;
#X msg 605 823 write -wave -rate 16000 -bytes 3 \$1 \$2-out_audio;
#X obj 576 180 hallu/numberslider2way 0 4;
#X obj 576 228 hallu/numberslider2way 0 4;
#X obj 576 276 hallu/numberslider2way 0 4;
#X obj 576 324 hallu/numberslider2way 0 4;
#X obj 576 373 hallu/numberslider2way 0 4;
#X obj 170 -74 route step settings worker updated synthesized hallucinated
;
#X obj 898 -66 expr $f1-2 \; $f1/16000*1000;
#X obj -129 -94 inlet;
#X obj -128 -74 route init;
#X obj -128 -52 unpack s s;
#X obj 261 13 symbol;
#X obj 324 -3 bang;
#X obj 188 38 spigot 0;
#X msg 253 -10 1;
#X msg 214 -11 0;
#X obj 891 -31 f;
#X obj 954 -30 f;
#X obj 830 -8 pack f f;
#X obj 793 -36 t b b;
#N canvas 760 492 450 300 print_input 0;
#X obj 139 24 inlet;
#X obj 147 97 outlet;
#X obj 201 65 print gansynth input;
#X connect 0 0 1 0;
#X connect 0 0 2 0;
#X restore 351 784 pd print_input;
#X obj 404 866 print gansynth output;
#X obj 373 842 list trim;
#X obj 351 762 r \$0-gansynth_in;
#X obj 293 866 s \$0-gansynth_out;
#X obj 928 858 outlet~;
#X msg 830 11 1 \, \$1 \$2;
#X obj 225 807 pyext. sopimagenta.ganspacesynth.pyext halluseq \$0-edits
@detach 1;
#X msg -125 484 synthesize_noz \$1-preview_audio 32 \$1-edits, f 30
;
#X text 566 486 to avoid crashes \, turn dsp off when generating!,
f 33;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 97 0;
#X connect 4 0 7 0;
#X connect 7 0 8 0;
#X connect 7 0 36 0;
#X connect 7 0 37 0;
#X connect 9 0 8 0;
#X connect 9 0 60 0;
#X connect 10 0 9 0;
#X connect 11 0 1 0;
#X connect 11 0 103 0;
#X connect 11 1 2 0;
#X connect 14 0 51 0;
#X connect 16 0 51 0;
#X connect 17 0 27 0;
#X connect 19 0 26 0;
#X connect 21 0 28 0;
#X connect 23 0 31 0;
#X connect 25 0 53 0;
#X connect 26 0 30 0;
#X connect 27 0 30 0;
#X connect 28 0 30 0;
#X connect 29 0 30 0;
#X connect 31 0 30 0;
#X connect 34 0 85 0;
#X connect 36 0 37 1;
#X connect 37 0 64 0;
#X connect 38 0 25 0;
#X connect 38 1 54 0;
#X connect 40 0 50 0;
#X connect 43 0 86 0;
#X connect 45 0 70 0;
#X connect 46 0 73 0;
#X connect 50 0 30 0;
#X connect 51 0 30 0;
#X connect 52 0 51 0;
#X connect 53 0 14 0;
#X connect 54 0 16 0;
#X connect 56 0 40 0;
#X connect 58 0 57 0;
#X connect 59 0 63 0;
#X connect 63 0 60 0;
#X connect 63 0 65 0;
#X connect 64 0 30 0;
#X connect 65 0 30 0;
#X connect 66 0 68 0;
#X connect 67 0 69 0;
#X connect 68 0 67 0;
#X connect 69 0 116 0;
#X connect 70 0 110 0;
#X connect 71 0 72 0;
#X connect 72 0 116 0;
#X connect 73 0 75 0;
#X connect 73 0 76 0;
#X connect 75 0 76 1;
#X connect 76 0 91 0;
#X connect 81 0 30 0;
#X connect 82 0 30 0;
#X connect 83 0 30 0;
#X connect 84 0 30 0;
#X connect 85 0 119 0;
#X connect 86 0 90 0;
#X connect 88 0 30 0;
#X connect 89 0 56 0;
#X connect 89 1 92 0;
#X connect 89 2 93 0;
#X connect 89 3 94 0;
#X connect 89 4 95 0;
#X connect 89 5 96 0;
#X connect 90 0 30 0;
#X connect 91 0 74 0;
#X connect 92 0 81 0;
#X connect 93 0 82 0;
#X connect 94 0 83 0;
#X connect 95 0 84 0;
#X connect 96 0 88 0;
#X connect 97 0 38 0;
#X connect 97 1 89 0;
#X connect 97 2 11 0;
#X connect 97 3 51 0;
#X connect 97 3 58 0;
#X connect 97 4 66 0;
#X connect 97 5 98 0;
#X connect 98 0 107 1;
#X connect 98 1 108 1;
#X connect 99 0 100 0;
#X connect 100 0 101 0;
#X connect 100 0 105 0;
#X connect 101 0 8 0;
#X connect 101 0 37 0;
#X connect 101 0 36 0;
#X connect 101 1 102 1;
#X connect 102 0 104 0;
#X connect 103 0 102 0;
#X connect 104 0 65 0;
#X connect 104 0 60 0;
#X connect 104 0 106 0;
#X connect 105 0 104 1;
#X connect 106 0 104 1;
#X connect 107 0 109 0;
#X connect 108 0 109 1;
#X connect 109 0 117 0;
#X connect 110 0 107 0;
#X connect 110 1 108 0;
#X connect 111 0 118 1;
#X connect 113 0 112 0;
#X connect 113 0 115 0;
#X connect 114 0 111 0;
#X connect 117 0 71 0;
#X connect 118 0 113 0;
#X connect 119 0 30 0;
#X coords 0 0 1 1 680 640 2 100 100;
#X restore 374 41 pd controls;
#X obj 374 713 dac~;
#X obj 374 694 *~ 0.5;
#X msg 374 11 init pruu pruu/pruu_conv0_ipca_4194304.pickle;
#X obj 11 11 cnv 15 350 70 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 19 17 ---- HALLU - GANSpaceSynth hallucination sequencer ----
;
#X text 19 37 Using GANSpaceSynth \, we can make more controlled hallucinations
by defining specific points in the latent space to move through.,
f 55;
#X obj 11 92 cnv 15 350 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 19 178 init <checkpoint dir> <pca file>, f 55;
#X text 19 98 1 - Load a GANSynth checkpoint and a PCA file., f 55
;
#X text 19 118 Use the "select directory/file" buttons to browse for
a checkpoint folder and a PCA file.;
#X text 19 148 You can also automate this by sending into the inlet
a message like:, f 55;
#X obj 11 213 cnv 15 350 200 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 19 238 in the steps area \, create the principal steps through
which the hallucination will move., f 55;
#X text 19 268 previous/next - switch between steps, f 55;
#X text 19 288 add - add a new step after the existing ones, f 55
;
#X text 19 308 remove - remove the current step, f 55;
#X text 19 328 preview - generate and play the audio at the current
step, f 55;
#X text 19 358 sliders - set the current step's latent space position
along the axis corresponding to each principal component (often only
the 2-3 first ones will have an audible effect), f 55;
#X text 19 218 2 - Edit steps., f 55;
#X obj 11 424 cnv 15 350 180 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 19 430 3 - Edit settings., f 55;
#X text 19 450 In the settings area \, define how to build the hallucination
out of the principal steps., f 55;
#X text 19 480 Interpolation steps - how many intermediate steps to
synthesize between each principal step, f 55;
#X text 19 510 Sample spacing - time in seconds between starting playback
of each step, f 55;
#X text 19 540 Start trim - time in seconds to trim from the start
of each step, f 55;
#X text 19 570 Attack/Sustain/Release - duration in seconds of each
part of the amplitude envelope applied to each step, f 55;
#X obj 11 615 cnv 15 350 70 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 19 620 4 - Generate!, f 55;
#X text 19 639 After generating \, we resize the output array to fit
the generated audio. This can cause Pd to crash if DSP is on \, so
we recommend turning it off when generating!, f 55;
#X text 1072 567 We make use of the following open source projects:
, f 59;
#X text 1072 587 - pyext/flext (GPL v2), f 59;
#X text 1072 626 Copyright (C) 2021 SOPI Research Group \, Aalto University
, f 59;
#X text 1072 607 - Magenta (Apache 2.0), f 59;
#N canvas 343 233 386 293 license 0;
#X text 9 227 For further information please contact to Koray Tahiroglu
\; email: [email protected] \, mail: Aalto University School
of Arts \, Design and Architecture \, Department of Media \, room J101
\, Väre Otaniementie 14 \, 2150 Espoo \, Finland;
#X text 11 12 This program is free software \; you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation \; either version 2 of
the License \, or (at your option) any later version.;
#X text 11 89 This program is distributed in the hope that it will
be useful \, but WITHOUT ANY WARRANTY \; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.;
#X text 10 161 You should have received a copy of the GNU General Public
License along with this program \; if not \, write to the Free Software
Foundation \, Inc. \, 51 Franklin Street \, Fifth Floor \, Boston \,
MA 02110-1301 \, USA.;
#X restore 1216 656 pd license;
#X text 1072 481 hallu.pd \, a tool for composing
audio hallucinations with GANSpaceSynth \, is provided by SOPI research
group (https://sopi.aalto.fi) Aalto University \, School of Arts \,
Design and Architecture 2021 \, under the GPL license GNU General Public
License version 2 | Open Source Initiative (https://opensource.org/licenses/gpl-2.0.php).
;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 2 0 1 1;
#X connect 3 0 0 0;
#X coords 0 743 1 742 0 0 0;