-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathganspacesynth_noz.pd
167 lines (167 loc) · 6.66 KB
/
ganspacesynth_noz.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
#N canvas 131 30 1299 667 10;
#X obj 8 483 cnv 15 640 150 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 8 90 cnv 15 640 110 empty empty empty 20 12 0 14 -233017 -66577
0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array \$0-sound 64000 float 0;
#X coords 0 1 63999 -1 120 60 1 0 0;
#X restore 371 561 graph;
#X obj 1099 201 dac~;
#X obj 1099 144 vline~;
#X msg 1099 125 1 \, 63998 4000;
#X obj 1099 163 tabread4~ \$0-sound;
#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 829 107 pd print_input;
#X obj 875 170 print gansynth output;
#X obj 1099 182 *~ 0.5;
#X obj 72 549 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576 -1
-1;
#X obj 72 571 f \$0;
#N canvas 501 282 450 300 loaded 0;
#X obj 102 102 tgl 15 0 empty empty loaded 17 7 0 10 -262144 -1 -1
0 1;
#X obj 103 68 f 1;
#X obj 101 43 route loaded unloaded;
#X obj 127 68 f 0;
#X obj 101 25 r \$0-gansynth_out;
#X connect 1 0 0 0;
#X connect 2 0 1 0;
#X connect 2 1 3 0;
#X connect 3 0 0 0;
#X connect 4 0 2 0;
#X coords 0 -1 1 1 60 20 2 100 100;
#X restore 403 159 pd loaded;
#X obj 847 148 list trim;
#X obj 1099 74 route synthesized;
#X obj 767 170 s \$0-gansynth_out;
#X obj 1099 56 r \$0-gansynth_out;
#X obj 8 211 cnv 15 640 180 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 53 277 bng 20 250 50 0 empty empty empty 17 7 0 10 -232576 -1
-1;
#X obj 53 301 f \$0;
#N canvas 0 22 450 300 (subpatch) 0;
#X array \$0-amplitudes 8192 float 2;
#X coords 0 -10 8192 10 120 60 1 0 0;
#X restore 458 311 graph;
#X obj 733 129 pyext. sopimagenta.gansynth.pyext gansynth @detach 1
;
#X obj 8 9 cnv 15 640 70 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 13 33 We apply the GANSpace technique by Härkönen et al.
to a GANSynth model \, allowing us to discover directions of significant
change in the latent space using Principal Component Analysis (PCA).
The found directions can be used to navigate the latent space in a
more controlled manner., f 104;
#X obj 829 79 r \$0-in;
#X text 13 94 1 - Load a saved checkpoint., f 104;
#X text 13 114 The "load <ckpt>" message loads a trained model from
checkpoint folder <ckpt>. If the checkpoint folder is in the same folder
as this patch \, you can simply give its name., f 104;
#X obj 153 172 s \$0-in;
#X text 13 212 2 - Load GANSpace PCA components., f 104;
#X text 13 232 The PCA components are computed by the gansynth_ganspace
script \, which produces a .pickle file. The "load_ganspace_components
<pca_file> <edits_array>" message loads the components from <pca_file>
and registers the array <edits_array> to hold coefficients for each
component., f 104;
#X obj 53 364 s \$0-in;
#X obj 8 402 cnv 15 650 70 empty empty empty 20 12 0 14 -233017 -66577
0;
#X obj 72 610 s \$0-in;
#X obj 659 282 cnv 15 620 190 empty empty empty 20 12 0 14 -233017
-66577 0;
#X obj 666 292 array-slider \$0-amplitudes 0;
#X obj 869 292 array-slider \$0-amplitudes 1;
#X obj 1072 292 array-slider \$0-amplitudes 2;
#X obj 666 336 array-slider \$0-amplitudes 3;
#X obj 869 336 array-slider \$0-amplitudes 4;
#X obj 1072 336 array-slider \$0-amplitudes 5;
#X obj 666 379 array-slider \$0-amplitudes 6;
#X obj 869 379 array-slider \$0-amplitudes 7;
#X obj 1072 379 array-slider \$0-amplitudes 8;
#X obj 666 422 array-slider \$0-amplitudes 9;
#X obj 869 422 array-slider \$0-amplitudes 10;
#X obj 501 569 bng 20 250 50 0 empty empty play 22 10 0 10 -232576
-1 -1;
#X obj 501 594 s \$0-play-in;
#X obj 1117 104 r \$0-play-in;
#X obj 1099 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 153 151 load pruu;
#X msg 53 321 load_ganspace_components pruu/pruu_conv0_ipca_4194304.pickle
\$1-amplitudes, f 48;
#X text 13 425 Use the sliders to edit the coefficients for each component
and move in the latent space. The first few ones will produce the most
audible changes. The movement is relative to the to the "center" of
the space \, defined as the mean value along each component., f 104
;
#X text 13 405 3 - Move along the PCA directions., f 104;
#X text 13 13 ---- GANSpaceSynth without the random latent vector ----
, f 104;
#X text 13 487 4 - Synthesize., f 104;
#X text 13 507 The "synthesize_noz <out_array> <pitch>" message synthesizes
an audio segment using pitch <pitch> and writes it to <out_array>.
Coefficients are read from the array registered in step 2 \, causing
a corresponding movement in the latent space., f 104;
#X msg 72 589 synthesize_noz \$1-sound 32 \$1-amplitudes;
#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 1199 564 pd license;
#X text 814 580 We make use of the following open source projects:
, f 59;
#X text 814 600 - pyext/flext (GPL v2), f 59;
#X text 814 639 Copyright (C) 2021 SOPI Research Group \, Aalto University
, f 59;
#X text 814 620 - Magenta (Apache 2.0), f 59;
#X text 814 483 ganspacesynth_noz.pd \, a template to generate audio
samples from a trained GANSynth model using dimensionality reduction
(PCA) results without random latent input vectors \, 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).
, f 59;
#X connect 4 0 6 0;
#X connect 5 0 4 0;
#X connect 6 0 9 0;
#X connect 7 0 21 1;
#X connect 9 0 3 0;
#X connect 9 0 3 1;
#X connect 10 0 11 0;
#X connect 11 0 56 0;
#X connect 13 0 8 0;
#X connect 13 0 15 0;
#X connect 14 0 48 0;
#X connect 16 0 14 0;
#X connect 18 0 19 0;
#X connect 19 0 50 0;
#X connect 21 0 13 0;
#X connect 24 0 7 0;
#X connect 45 0 46 0;
#X connect 47 0 5 0;
#X connect 48 0 5 0;
#X connect 49 0 27 0;
#X connect 50 0 30 0;
#X connect 56 0 32 0;
#X coords 0 667 1 666 0 0 0;