-
Notifications
You must be signed in to change notification settings - Fork 0
/
sinusoidality~-help.pd
executable file
·311 lines (311 loc) · 14.4 KB
/
sinusoidality~-help.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
#N canvas 217 82 962 682 10;
#X obj 58 144 readsf~;
#X obj 83 702 output~;
#X obj 144 376 noise~;
#X floatatom 318 361 5 0 0 0 - - -, f 5;
#X obj 249 160 s~ origSig;
#X obj 617 540 r~ origSig;
#X obj 105 173 s bang2;
#N canvas 1 82 734 682 stuff90000000 0;
#X obj 23 57 inlet~;
#X obj 92 58 inlet;
#X obj 142 64 inlet~;
#X obj 209 60 inlet;
#X obj 260 62 inlet~;
#X obj 329 63 inlet;
#X obj 379 64 inlet~;
#X obj 448 65 inlet;
#X obj 178 278 outlet~;
#X obj 101 273 outlet~;
#X obj 375 276 outlet~;
#X obj 298 271 outlet~;
#X obj 39 220 *~;
#X obj 148 220 *~;
#X obj 311 219 *~;
#X msg 68 156 1 10;
#X obj 76 222 line;
#X msg 79 189 0 10;
#X msg 174 154 1 10;
#X obj 181 220 line;
#X msg 185 187 0 10;
#X msg 344 146 1 10;
#X obj 353 221 line;
#X msg 355 179 0 10;
#X obj 68 109 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 173 110 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 345 104 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 446 221 *~;
#X msg 479 148 1 10;
#X obj 488 223 line;
#X msg 490 181 0 10;
#X obj 480 106 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 345 124 t b b b b;
#X obj 174 132 t b b b b;
#X obj 68 129 t b b b b;
#X obj 480 126 t b b b b;
#X connect 0 0 12 0;
#X connect 1 0 24 0;
#X connect 2 0 13 0;
#X connect 3 0 25 0;
#X connect 4 0 14 0;
#X connect 5 0 26 0;
#X connect 6 0 27 0;
#X connect 7 0 31 0;
#X connect 12 0 9 0;
#X connect 13 0 8 0;
#X connect 14 0 11 0;
#X connect 15 0 16 0;
#X connect 16 0 12 1;
#X connect 17 0 16 0;
#X connect 18 0 19 0;
#X connect 19 0 13 1;
#X connect 20 0 19 0;
#X connect 21 0 22 0;
#X connect 22 0 14 1;
#X connect 23 0 22 0;
#X connect 24 0 34 0;
#X connect 25 0 33 0;
#X connect 26 0 32 0;
#X connect 27 0 10 0;
#X connect 28 0 29 0;
#X connect 29 0 27 1;
#X connect 30 0 29 0;
#X connect 31 0 35 0;
#X connect 32 0 21 0;
#X connect 32 1 17 0;
#X connect 32 2 20 0;
#X connect 32 3 30 0;
#X connect 33 0 18 0;
#X connect 33 1 17 0;
#X connect 33 2 23 0;
#X connect 33 3 30 0;
#X connect 34 0 15 0;
#X connect 34 1 20 0;
#X connect 34 2 23 0;
#X connect 34 3 30 0;
#X connect 35 0 28 0;
#X connect 35 1 17 0;
#X connect 35 2 20 0;
#X connect 35 3 23 0;
#X restore 83 634 pd stuff90000000;
#X obj 628 573 r bang1;
#X obj 624 605 bng 15 250 50 0 empty empty you_get_the_idea 17 7 0
10 -262144 -1 -1;
#X obj 79 462 bng 15 250 50 0 empty empty bangon 17 7 0 10 -262144
-1 -1;
#X obj 158 464 bng 15 250 50 0 empty empty bangon 17 7 0 10 -262144
-1 -1;
#X obj 243 473 bng 15 250 50 0 empty empty bangon 17 7 0 10 -262144
-1 -1;
#X obj 319 308 loadbang;
#X text 311 472 <-first outlet is resynthesized noise+sine components
\, second is the noise alone \, third is 'sinusoidal' components. hit
the bangs to listen;
#X obj 58 425 sinusoidality~ -amp power;
#X msg 318 337 990;
#X obj 318 379 * 0.001;
#X msg 68 234 table thresh;
#N canvas 1 82 598 348 intro 0;
#X text 44 174 the basic idea is this: you look at an STFT and evaluate
the potential 'sinusoidality' of each bin. this number is a coefficient
between 0 and 1 If it is above a specified threshold \, then the bin
is sinusoidal \, otherwise it is noise. right now (because I was working
on this originally as a way to improve my phasevocoder) the noise content
is resynthesized by scaling whitenoise (hence the input to the second
inlet). I will probably change this setup \, but I can see interesting
possiblities for synthesis the way it is now.;
#X text 45 23 sinusoidality attempts to separate noisey parts of a
signal from the rest. there are a variety of algorithms for determining
which bins of an STFT contain sinusoidal as opposed to noisey content
\, some based on the amplitude spctrum and some based on the power
spectrum. I got them all from Ted Apel's PhD thesis \, in which many
such techniques are outlined and evaluated. for now \, the only working
algorithm is based on the plain 'ol power spectrum \, hence the creation
arguments being what they are (no creation args yields the same effect)
\, but I will fold other algorithms in as time goes on.;
#X restore 492 30 pd intro;
#X text 554 30 <-read this;
#N canvas 1 82 746 352 tables 0;
#N canvas 0 50 450 300 (subpatch) 0;
#X array thresh 1024 float 3;
#A 0 0.871998 0.867998 0.863998 0.863998 0.863998 0.862998 0.861998
0.860998 0.923999 0.923999 0.923999 0.923999 0.923999 0.919999 0.919999
0.919999 0.919999 0.919999 0.919999 0.919999 0.919999 0.919999 0.919999
0.919999 0.919999 0.919999 0.919999 0.919999 0.919999 0.919999 0.919999
0.919999 0.919999 0.919999 0.919999 0.919428 0.918856 0.918285 0.917714
0.917142 0.916571 0.915999 0.915999 0.915999 0.915999 0.915999 0.915999
0.915999 0.915999 0.915999 0.915999 0.915999 0.915999 0.915999 0.915999
0.915999 0.914999 0.913999 0.912999 0.911999 0.911999 0.911999 0.911999
0.911999 0.911999 0.911999 0.911999 0.911999 0.911999 0.911999 0.911332
0.910666 0.909999 0.909332 0.908666 0.907999 0.906999 0.905999 0.904999
0.903999 0.903999 0.903999 0.902666 0.901332 0.899999 0.898999 0.897999
0.896999 0.895999 0.895999 0.895999 0.893999 0.891999 0.890999 0.889999
0.888999 0.887999 0.886999 0.885999 0.884999 0.883999 0.879999 0.875998
0.875998 0.875998 0.873998 0.871998 0.871998 0.871998 0.869998 0.867998
0.863998 0.34 0.859998 0.855998 0.853998 0.851998 0.849998 0.847998
0.913999 0.915999 0.919999 0.923999 0.923999 0.923999 0.925999 0.927999
0.929333 0.930666 0.931999 0.877999 0.879999 0.801997 0.799997 0.781997
0.775997 0.768997 0.761997 0.754997 0.747996 0.735996 0.731996 0.725996
0.719996 0.707996 0.695995 0.695995 0.695995 0.679995 0.675995 0.671995
0.667995 0.656995 0.653995 0.650995 0.647995 0.637994 0.627994 0.623994
0.619994 0.613994 0.607994 0.603994 0.599994 0.594994 0.589994 0.584993
0.579993 0.561993 0.555993 0.495992 0.487992 0.469325 0.462658 0.455991
0.449991 0.443991 0.437991 0.431991 0.425991 0.419991 0.416991 0.413991
0.410991 0.407991 0.404991 0.40199 0.39899 0.39599 0.39399 0.39199
0.38999 0.38799 0.38499 0.38199 0.37899 0.37599 0.37399 0.37199 0.36999
0.36799 0.364657 0.361323 0.35799 0.354656 0.351323 0.34799 0.34599
0.343989 0.341989 0.339989 0.337989 0.335989 0.333989 0.331989 0.329589
0.327189 0.324789 0.322389 0.319989 0.318489 0.316989 0.315489 0.313989
0.312489 0.310989 0.309489 0.307989 0.303989 0.299989 0.297989 0.295989
0.293989 0.291989 0.289989 0.287989 0.285989 0.283988 0.281988 0.279988
0.277988 0.275988 0.273988 0.271988 0.270988 0.269988 0.268988 0.267988
0.264988 0.261988 0.258988 0.255988 0.253988 0.251988 0.249988 0.247988
0.246274 0.244559 0.242845 0.241131 0.239416 0.237702 0.235988 0.234988
0.233988 0.232988 0.231988 0.227988 0.223987 0.221487 0.218987 0.216487
0.213987 0.211487 0.208987 0.206487 0.203987 0.201987 0.199987 0.197987
0.195987 0.191987 0.187987 0.185987 0.183987 0.179987 0.175987 0.173987
0.171987 0.169987 0.167987 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.162986 0.161986 0.160986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.159986
0.159986 0.159986 0.159986 0.159986 0.159986 0.159986 0.160786 0.161586
0.162386 0.163186 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986 0.163986
0.163986 0.163986 0.163701 0.163415 0.163129 0.162844 0.162558 0.162272
0.161986 0.161701 0.161415 0.161129 0.160844 0.160558 0.160272 0.159986
0.15932 0.158653 0.157986 0.15732 0.156653 0.155986 0.155486 0.154986
0.154486 0.153986 0.153486 0.152986 0.152486 0.151986 0.151986 0.151986
0.151986 0.151986 0.151986 0.151986 0.151986 0.15132 0.150653 0.149986
0.14932 0.148653 0.147986 0.147319 0.146653 0.145986 0.145319 0.144653
0.143986 0.143986 0.143986 0.143986 0.143986 0.143986 0.143986 0.142986
0.141986 0.140986 0.139986 0.139319 0.138653 0.137986 0.137319 0.136653
0.135986 0.135319 0.134653 0.133986 0.133319 0.132653 0.131986 0.131541
0.131097 0.130653 0.130208 0.129764 0.129319 0.128875 0.12843 0.127986
0.127319 0.126652 0.125986 0.125319 0.124652 0.123986 0.122652 0.121319
0.119986 0.118652 0.117319 0.115986 0.115319 0.114652 0.113986 0.113319
0.112652 0.111986 0.111986 0.111986 0.111986 0.111986 0.111986 0.111986
0.109986 0.107985 0.107985 0.107985 0.107985 0.107985 0.107985 0.107985
0.107985 0.107985 0.107622 0.107258 0.106895 0.106531 0.106167 0.105804
0.10544 0.105076 0.104713 0.104349 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985 0.103985
0.103985 0.103985 0.103985 0.103985 0.103485 0.102985 0.102485 0.101985
0.101485 0.100985 0.100485 0.0999854 0.0999854 0.0999854 0.0999854
0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854
0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854
0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854 0.0999854
0.0995409 0.0990965 0.098652 0.0982076 0.0977631 0.0973187 0.0968742
0.0964298 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853
0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853
0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853
0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853
0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0959853 0.0953186
0.0946519 0.0939853 0.0933186 0.0926519 0.0919852 0.0919852 0.0919852
0.0919852 0.0919852 0.0919852 0.0919852 0.0919852 0.0919852 0.0919852
0.0916995 0.0914138 0.0911281 0.0908423 0.0905566 0.0902709 0.0899852
0.0896994 0.0894137 0.089128 0.0888423 0.0885566 0.0882708 0.0879851
0.0873185 0.0866518 0.0859851 0.0853184 0.0846518 0.0839851 0.0839851
0.0839851 0.0839851 0.0839851 0.0839851 0.0839851 0.0839851 0.0839851
0.0839851 0.0839851 0.0836774 0.0833697 0.083062 0.0827543 0.0824466
0.0821389 0.0818312 0.0815235 0.0812158 0.0809081 0.0806005 0.0802928
0.0799851 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985
0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985
0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985
0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985 0.079985
0.079985 0.0797745 0.079564 0.0793534 0.0791429 0.0789324 0.0787218
0.0785113 0.0783008 0.0780902 0.0778797 0.0776692 0.0774586 0.0772481
0.0770376 0.0768271 0.0766165 0.076406 0.0761955 0.0759849 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985 0.075985
0.0754849 0.0749849 0.0744849 0.0739849 0.0734849 0.0729849 0.0724849
0.0719849 0.0719849 0.0719849 0.0719849 0.0719849 0.0719849 0.0719849
0.0719849 0.0719849 0.0719849 0.0719849 0.0719849 0.0719849 0.0719849
0.0719849 0.0719849 0.0719849 0.0719849 0.0719849 0.0711849 0.0703849
0.0695848 0.0687848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0669848 0.0659848 0.0649848 0.0639848 0.0639848 0.0639848
0.0639848 0.0639848 0.0639848 0.0639848 0.0639848 0.0639848 0.0639848
0.0639848 0.0639848 0.0639848 0.0639848 0.0639848 0.0639848 0.0639848
0.0639848 0.0639848 0.0639848 0.0649848 0.0659848 0.0669848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848 0.0679848
0.0679848 0.0659848 0.0639848 0.0639848 0.0639848 0.0639848 0.0639848
0.0619847 0.0599847 0.964 0.964 0.964 0.964 0.964 0.964 0.964 0.968
0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968
0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.968 0.966 0.964 0.964
0.964 0.962 0.96 0.96 0.96 0.96 0.96 0.956 0.956 0.956 0.956 0.952
0.952 0.952 0.952 0.948 0.948 0.948 0.936 0.931999 0.909999 0.899999
0.877999 0.871998 0.839998 0.835998 0.801997 0.795997 0.761997 0.751996
0.713996 0.707996 0.673995 0.671995 0.629994 0.623994 0.593994 0.579993
0.559993 0.551993 0.519992 0.515992 0.435991;
#A 1000 0.427991 0.37599 0.35999 0.339989 0.335989 0.310989 0.301989
0.292989 0.283988 0.259988 0.251988 0.123986 0.119986 0.00498375 0.00598377
0.00698379 0.0079838 0.0079838 0.0079838 0.0079838 0.00898382 0.00998384
0.0109839 0.0119839;
#X coords 0 1 1023 0 500 250 1 0 0;
#X restore 100 20 graph;
#X restore 76 255 pd tables;
#X text 170 232 <-you can also use a table to set a different threshold
for each bin of the fft;
#X msg 59 119 open \$1;
#X msg 156 127 1;
#X obj 59 94 openpanel;
#X obj 59 71 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X text 375 357 <-threshhold for 'sinusoidality' classification \,
between 0 and 1 \, scaled here for convenience;
#X msg 195 127 0;
#X text 169 258 playing with this can yield some great sounds;
#X connect 0 0 4 0;
#X connect 0 0 15 0;
#X connect 0 1 6 0;
#X connect 2 0 15 1;
#X connect 3 0 17 0;
#X connect 5 0 7 6;
#X connect 7 0 1 0;
#X connect 7 0 1 1;
#X connect 7 1 1 0;
#X connect 7 1 1 1;
#X connect 7 2 1 0;
#X connect 7 2 1 1;
#X connect 7 3 1 0;
#X connect 7 3 1 1;
#X connect 8 0 9 0;
#X connect 9 0 7 7;
#X connect 10 0 7 1;
#X connect 11 0 7 3;
#X connect 12 0 7 5;
#X connect 13 0 16 0;
#X connect 15 0 7 0;
#X connect 15 1 7 2;
#X connect 15 2 7 4;
#X connect 16 0 3 0;
#X connect 17 0 15 2;
#X connect 18 0 15 0;
#X connect 23 0 0 0;
#X connect 24 0 0 0;
#X connect 25 0 23 0;
#X connect 26 0 25 0;
#X connect 28 0 0 0;