[PD] is this a spectral gate?

Frank Barknecht fbar at footils.org
Wed Feb 21 10:30:28 CET 2007


Hallo,
David Powers hat gesagt: // David Powers wrote:

> I wish there was an "fft for dumbies" ... or, I guess, some kind of
> fft "black boxes" to play with, where you don't need to understand the
> math. Frank's recent post completely lost me, 

Now I'm disappointed ...

> though given a bit of study I can probably decode it.

... ah, and relieved a bit again. ;) 

> But, for instance, in Reaktor or Plogue Bidule, you can move stuff
> into fft, mess with it, and resynthesize, without having any idea what
> the hell the math is. In comparison, I really couldn't understand the
> PD fft examples at all, it's just been too many years since I had a
> math class. 

The power of Pd of course is, that you can influence things on a much
lower level than NI allows you to do in Reaktor - although I admit,
that I only know Reaktor from screenshots. The downside is, that you
have to dig deeper to make the most out of Pd. This is especially true
for FFT applications. The actual FFT patches often are very simple and
they contain just of a handful of objects. It's the knowledge hidden
inside that makes them difficult to understand. 

While you can skip a lot of the math, you cannot do FFT in Pd without
at least understanding what kind of data is generated by the two
[rfft~] outlets. Because without understanding this, you cannot even
"fool around" with the data in between [rfft~] and [rifft~] in a
meaningful way. 

Anyway, to give you a blackbox maybe like in Reaktor, attached is a
Spectral Delay GOP abstraction ready to be dropped into any glitch
patch.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 0 0 820 636 10;
#N canvas 227 106 775 691 fft-analysis 0;
#X obj 20 126 *~;
#X obj 19 61 inlet~;
#X obj 20 150 rfft~;
#X obj 41 102 tabreceive~ \$0-hann;
#X obj 21 549 *~;
#X obj 66 530 tabreceive~ \$0-hann;
#X obj 21 476 rifft~;
#X obj 21 581 outlet~;
#X obj 43 320 wrap~;
#X obj 22 344 -~;
#X obj 22 410 /~ 44.1;
#X obj 21 505 /~ 64;
#X obj 21 292 tabreceive~ \$0-delay;
#X obj 154 326 tabreceive~ \$0-feedback;
#X obj 158 366 *~;
#X obj 122 367 *~;
#X obj 16 7 block~ 512 4;
#X obj 22 372 *~ 512;
#X text 246 443 read out the delay and feedbackarrays for;
#X text 246 469 every audio block (= fft frame) and use the;
#X text 247 491 integer value of each delay bin as multiplier;
#X text 252 512 of the blocksize to calculate the pointer;
#X text 250 533 back into the vd~s before resynthesis.;
#X obj 201 385 samplerate~;
#X obj 201 363 loadbang;
#X msg 283 364 bang;
#X obj 201 407 / 1000;
#X obj 20 235 delwrite~ \$0-re 12000;
#X obj 60 212 delwrite~ \$0-im 12000;
#X obj 22 441 vd~ \$0-re;
#X obj 119 441 vd~ \$0-im;
#X text 275 211 write real and imaginary part into delay-buffer;
#X obj 229 39 tabreceive~ \$0-gain;
#X obj 230 68 *~;
#X text 273 59 Just to show we're doing something \, we multiply each
channel by a gain controlled by an array in the main window. The control
is quartic-scaled for easy editing.;
#X obj 231 94 *~;
#X obj 19 185 *~;
#X obj 61 185 *~;
#X obj 300 175 print~;
#X msg 316 148 bang;
#X floatatom 297 127 5 0 0 0 - - -;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 36 0;
#X connect 2 1 37 0;
#X connect 3 0 0 1;
#X connect 4 0 7 0;
#X connect 5 0 4 1;
#X connect 6 0 11 0;
#X connect 8 0 9 1;
#X connect 9 0 17 0;
#X connect 10 0 29 0;
#X connect 10 0 30 0;
#X connect 11 0 4 0;
#X connect 12 0 8 0;
#X connect 12 0 9 0;
#X connect 13 0 15 1;
#X connect 13 0 14 1;
#X connect 14 0 28 0;
#X connect 15 0 27 0;
#X connect 17 0 10 0;
#X connect 23 0 26 0;
#X connect 24 0 23 0;
#X connect 25 0 23 0;
#X connect 26 0 10 1;
#X connect 29 0 6 0;
#X connect 29 0 15 0;
#X connect 30 0 6 1;
#X connect 30 0 14 0;
#X connect 32 0 33 0;
#X connect 32 0 33 1;
#X connect 33 0 35 0;
#X connect 33 0 35 1;
#X connect 35 0 37 1;
#X connect 35 0 36 1;
#X connect 36 0 27 0;
#X connect 37 0 28 0;
#X connect 39 0 38 0;
#X restore 52 492 pd fft-analysis;
#N canvas 35 66 600 441 Hann-window 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-hann 512 float 0;
#X coords 0 1 511 0 200 120 1;
#X restore 293 249 graph;
#X msg 171 263 0;
#X obj 65 312 osc~;
#X obj 65 264 samplerate~;
#X obj 65 335 *~ -0.5;
#X obj 65 358 +~ 0.5;
#X obj 57 383 tabwrite~ \$0-hann;
#X text 279 241 1;
#X text 272 359 0;
#X text 288 372 0;
#X obj 65 288 / 512;
#X obj 57 241 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 336 221 Hann window;
#X text 113 310 period 512;
#X text 90 215 recalculate Hann;
#X text 125 230 window table;
#X obj 57 146 loadbang;
#X msg 79 179 \; pd dsp 1;
#X text 40 27 The Hann window is now recomputed on 'loadbang' to make
the file smaller (it doesn't have to be saved with the array.);
#X text 474 375 511;
#X connect 1 0 2 1;
#X connect 2 0 4 0;
#X connect 3 0 10 0;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X connect 10 0 2 0;
#X connect 11 0 3 0;
#X connect 11 0 1 0;
#X connect 11 0 6 0;
#X connect 16 0 11 0;
#X connect 16 0 17 0;
#X restore 170 493 pd Hann-window;
#N canvas 0 0 454 304 (subpatch) 0;
#X array \$0-delay 256 float 2;
#X coords 0 1024 256 0 512 60 1;
#X restore 26 158 graph;
#X text 12 150 2;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-feedback 256 float 2;
#X coords 0 1 256 0 512 60 1;
#X restore 26 254 graph;
#X text 12 310 0;
#X text 10 250 1;
#X text 28 78 in each individual bin.;
#X text 30 63 The two arrays below are for setting the delay and feedback
;
#X text 198 2 SPECTRAL DELAY;
#X text 28 99 See the fft-analysis subpatch for details how it is done.
;
#X text 26 23 Example patch for spectral delay \, utilizing Miller
;
#X text 27 38 Puckette's patch on Fourier Resynthesis.;
#N canvas 0 0 450 300 (subpatch) 0;
#X array \$0-gain 256 float 2;
#X coords 0 1 256 -0.01 512 60 1;
#X restore 25 350 graph;
#X text 12 403 0;
#X text 12 344 1;
#X text 25 413 0;
#X text 518 411 22K;
#X obj 51 513 outlet~;
#X floatatom 501 237 5 0 0 2 fb-sin - -;
#X floatatom 501 140 5 0 0 2 del-sin - -;
#N canvas 0 0 450 300 del-sin 0;
#X obj 45 289 tabwrite \$0-delay;
#N canvas 0 0 450 300 count256 0;
#X obj 101 155 f 0;
#X obj 133 155 + 1;
#X obj 101 79 t a b;
#X obj 103 111 until;
#X obj 162 112 0;
#X obj 103 27 inlet;
#X msg 101 51 256;
#X obj 102 192 outlet;
#X connect 0 0 1 0;
#X connect 0 0 7 0;
#X connect 1 0 0 1;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 0 0;
#X connect 4 0 0 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X restore 42 131 pd count256;
#X obj 44 208 sin;
#X obj 43 159 t a a;
#X obj 44 184 / 10;
#X obj 46 232 + 1;
#X obj 47 261 * 512;
#X floatatom 120 167 5 0 0 0 - - -;
#X obj 47 95 t b a;
#X obj 47 70 inlet;
#X connect 1 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 4 0;
#X connect 3 1 0 1;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 6 0 0 0;
#X connect 7 0 4 1;
#X connect 8 0 1 0;
#X connect 8 1 4 1;
#X connect 9 0 8 0;
#X restore 628 154 pd del-sin;
#N canvas 492 383 519 433 fb-sin 0;
#N canvas 0 0 450 300 count256 0;
#X obj 101 155 f 0;
#X obj 133 155 + 1;
#X obj 101 79 t a b;
#X obj 103 111 until;
#X obj 162 112 0;
#X obj 103 27 inlet;
#X msg 101 51 256;
#X obj 102 192 outlet;
#X connect 0 0 1 0;
#X connect 0 0 7 0;
#X connect 1 0 0 1;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 0 0;
#X connect 4 0 0 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X restore 234 129 pd count256;
#X obj 235 157 t a a;
#X obj 237 287 tabwrite \$0-feedback;
#X obj 236 206 cos;
#X obj 236 182 / 20;
#X obj 236 230 + 1;
#X floatatom 296 164 5 0 0 0 - - -;
#X obj 239 93 t b a;
#X obj 239 68 inlet;
#X obj 236 261 / 2.5;
#X text 124 263 don't go to 1:;
#X connect 0 0 1 0;
#X connect 1 0 4 0;
#X connect 1 1 2 1;
#X connect 3 0 5 0;
#X connect 4 0 3 0;
#X connect 5 0 9 0;
#X connect 6 0 4 1;
#X connect 7 0 0 0;
#X connect 7 1 4 1;
#X connect 8 0 7 0;
#X connect 9 0 2 0;
#X restore 630 251 pd fb-sin;
#X obj 541 160 vsl 15 55 0 1024 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 2100 1;
#X obj 719 240 s \$0-delay;
#X msg 719 218 const \$1;
#X obj 540 256 vsl 15 55 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 700 1;
#X obj 711 339 s \$0-feedback;
#X msg 711 314 const \$1;
#X obj 542 352 vsl 15 55 0 1 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X msg 723 410 const \$1;
#X obj 723 435 s \$0-gain;
#X floatatom 500 333 5 0 0 2 gain-sin - -;
#N canvas 492 383 519 433 gain-sin 0;
#N canvas 0 0 450 300 count256 0;
#X obj 101 155 f 0;
#X obj 133 155 + 1;
#X obj 101 79 t a b;
#X obj 103 111 until;
#X obj 162 112 0;
#X obj 103 27 inlet;
#X msg 101 51 256;
#X obj 102 192 outlet;
#X connect 0 0 1 0;
#X connect 0 0 7 0;
#X connect 1 0 0 1;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 0 0;
#X connect 4 0 0 1;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X restore 234 129 pd count256;
#X obj 235 157 t a a;
#X obj 236 206 cos;
#X obj 236 182 / 20;
#X obj 236 230 + 1;
#X obj 236 261 / 2;
#X floatatom 296 164 5 0 0 0 - - -;
#X obj 239 93 t b a;
#X obj 239 68 inlet;
#X obj 237 287 tabwrite \$0-gain;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 1 1 9 1;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 5 0;
#X connect 5 0 9 0;
#X connect 6 0 3 1;
#X connect 7 0 0 0;
#X connect 7 1 3 1;
#X connect 8 0 7 0;
#X restore 621 347 pd gain-sin;
#X obj 52 472 inlet~;
#X text 64 558 Based on patches by MSP \, Johannes Kreidler \, Orm
Finnendahl;
#X text 12 215 0;
#X connect 0 0 18 0;
#X connect 19 0 22 0;
#X connect 20 0 21 0;
#X connect 23 0 25 0;
#X connect 25 0 24 0;
#X connect 26 0 28 0;
#X connect 28 0 27 0;
#X connect 29 0 30 0;
#X connect 30 0 31 0;
#X connect 32 0 33 0;
#X connect 34 0 0 0;
#X coords 0 -1 1 1 560 320 1 10 120;
-------------- next part --------------
#N canvas 273 131 757 578 10;
#X obj 101 127 specdelay~;
#X obj 101 98 tabplay~ \$0-sample;
#X obj 117 73 spigot 1;
#X obj 184 50 tgl 15 0 empty empty loop 17 7 1 10 -262144 -1 -1 0 1
;
#X msg 101 47 bang;
#N canvas 0 0 506 290 sample 0;
#X obj 76 84 openpanel;
#X obj 76 161 soundfiler;
#X obj 75 189 table \$0-sample;
#X msg 76 135 read -resize \$1 \$2-sample;
#X obj 76 110 pack s \$0;
#X obj 76 57 inlet;
#X connect 0 0 4 0;
#X connect 3 0 1 0;
#X connect 4 0 3 0;
#X connect 5 0 0 0;
#X restore 280 89 pd sample;
#X obj 280 64 bng 20 250 50 0 empty empty open-sample 0 -6 0 8 -262144
-1 -1;
#X obj 100 501 *~ 0;
#X obj 123 478 dbtorms;
#X obj 199 463 hsl 128 15 0 127 0 0 empty empty empty -2 -8 0 10 -262144
-1 -1 10000 1;
#X obj 101 528 dac~;
#X connect 0 0 7 0;
#X connect 1 0 0 0;
#X connect 1 1 2 0;
#X connect 2 0 1 0;
#X connect 3 0 2 1;
#X connect 4 0 1 0;
#X connect 6 0 5 0;
#X connect 7 0 10 0;
#X connect 7 0 10 1;
#X connect 8 0 7 1;
#X connect 9 0 8 0;


More information about the Pd-list mailing list