aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/4.fft.examples/07.tinbell.pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd/doc/4.fft.examples/07.tinbell.pd')
-rw-r--r--pd/doc/4.fft.examples/07.tinbell.pd248
1 files changed, 248 insertions, 0 deletions
diff --git a/pd/doc/4.fft.examples/07.tinbell.pd b/pd/doc/4.fft.examples/07.tinbell.pd
new file mode 100644
index 00000000..59ca1970
--- /dev/null
+++ b/pd/doc/4.fft.examples/07.tinbell.pd
@@ -0,0 +1,248 @@
+#N canvas 175 36 759 457 12;
+#N canvas 147 -3 718 530 fft-analysis 0;
+#X obj 138 257 *~;
+#X obj 122 286 *~;
+#X obj 87 286 *~;
+#X obj 86 71 *~;
+#X obj 117 71 inlet~;
+#X obj 86 94 rfft~;
+#X obj 60 351 *~;
+#X obj 190 136 *~;
+#X obj 63 40 tabreceive~ hanning;
+#X obj 87 309 rifft~;
+#X obj 60 374 outlet~;
+#X obj 156 136 *~;
+#X obj 156 159 +~;
+#X obj 166 257 sig~ 0.001;
+#X obj 185 349 block~ 1024 4;
+#X obj 156 184 rsqrt~;
+#X obj 217 187 sig~ 1e-20;
+#X obj 156 211 clip~;
+#X text 37 2 What does this do?;
+#X floatatom 462 156;
+#X obj 462 67 r squelch;
+#X obj 462 177 moses;
+#X msg 461 207 0;
+#X obj 461 90 t f f;
+#X obj 462 113 *;
+#X obj 462 134 * 0.01;
+#X connect 0 0 1 1;
+#X connect 0 0 2 1;
+#X connect 1 0 9 1;
+#X connect 2 0 9 0;
+#X connect 3 0 5 0;
+#X connect 4 0 3 1;
+#X connect 5 0 11 0;
+#X connect 5 0 11 1;
+#X connect 5 0 2 0;
+#X connect 5 1 7 0;
+#X connect 5 1 7 1;
+#X connect 5 1 1 0;
+#X connect 6 0 10 0;
+#X connect 7 0 12 1;
+#X connect 8 0 3 0;
+#X connect 8 0 6 0;
+#X connect 9 0 6 1;
+#X connect 11 0 12 0;
+#X connect 12 0 15 0;
+#X connect 13 0 0 1;
+#X connect 15 0 17 0;
+#X connect 16 0 15 0;
+#X connect 17 0 0 0;
+#X connect 19 0 21 0;
+#X connect 20 0 23 0;
+#X connect 21 0 22 0;
+#X connect 21 1 17 2;
+#X connect 22 0 17 2;
+#X connect 23 0 24 0;
+#X connect 23 0 24 1;
+#X connect 24 0 25 0;
+#X connect 25 0 19 0;
+#X restore 74 366 pd fft-analysis;
+#X floatatom 192 206;
+#X obj 74 414 dac~;
+#X obj 74 390 *~;
+#X obj 119 414 line~;
+#X floatatom 587 68;
+#N canvas 194 37 397 591 output 0;
+#X obj 62 191 t b;
+#X obj 62 144 f;
+#X obj 62 96 inlet;
+#X text 67 76 mute;
+#X obj 62 215 f;
+#X msg 127 230 0;
+#X msg 62 120 bang;
+#X obj 62 167 moses 1;
+#X obj 127 207 t b f;
+#X obj 91 417 outlet;
+#X msg 91 393 set \$1;
+#X obj 175 154 moses 1;
+#X obj 212 419 dbtorms;
+#X obj 212 443 pack 0 100;
+#X obj 175 130 r master-lvl;
+#X obj 91 360 r master-lvl;
+#X obj 78 269 s master-lvl;
+#X obj 212 467 s master-amp;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 16 0;
+#X connect 5 0 16 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 8 0;
+#X connect 8 0 5 0;
+#X connect 10 0 9 0;
+#X connect 11 1 4 1;
+#X connect 12 0 13 0;
+#X connect 13 0 17 0;
+#X connect 14 0 1 1;
+#X connect 14 0 11 0;
+#X connect 15 0 10 0;
+#X connect 15 0 12 0;
+#X restore 587 44 pd output;
+#X msg 587 20 mute;
+#X text 624 60 MASTER;
+#X text 623 74 LEVEL;
+#X obj 587 92 s master-lvl;
+#X obj 119 390 r master-amp;
+#X obj 664 177 loadbang;
+#X obj 664 201 samplerate~;
+#X text 30 187 click here first;
+#X text 361 166 read a sample;
+#X obj 562 225 hip~ 5;
+#X obj 562 201 adc~ 1;
+#X msg 624 170 bang;
+#X obj 624 201 f;
+#X obj 624 225 s insamprate;
+#X obj 562 248 tabwrite~ sample;
+#N canvas 107 33 607 436 hanning-window 0;
+#X obj 92 206 phasor~;
+#X obj 92 234 cos~;
+#X obj 23 328 tabwrite~ hanning;
+#X obj 30 252 -~;
+#X obj 28 218 sig~ 1;
+#X msg 37 180 0;
+#X text 141 13 CALCULATE HANNING;
+#X text 141 27 WINDOW TABLE;
+#X graph graph1 0 -1 1024 1 295 345 495 195;
+#X array hanning 1024 float;
+#X pop;
+#X msg 304 374 \; hanning resize 1024;
+#X obj 93 131 / 1024;
+#X obj 93 171 sig~;
+#X text 175 148 sample rate / window size;
+#X msg 23 144 bang;
+#X obj 66 269 sig~ 0.5;
+#X obj 49 300 *~;
+#X obj 67 96 samplerate~;
+#X obj 25 23 r window-size;
+#X obj 25 53 t b f;
+#X connect 0 0 1 0;
+#X connect 1 0 3 1;
+#X connect 3 0 15 0;
+#X connect 4 0 3 0;
+#X connect 5 0 0 1;
+#X connect 10 0 11 0;
+#X connect 11 0 0 0;
+#X connect 13 0 2 0;
+#X connect 13 0 5 0;
+#X connect 14 0 15 1;
+#X connect 15 0 2 0;
+#X connect 16 0 10 0;
+#X connect 17 0 18 0;
+#X connect 18 0 16 0;
+#X connect 18 0 13 0;
+#X connect 18 1 10 1;
+#X restore 521 332 pd hanning-window;
+#X msg 24 205 \; window-size 1024 \; pd dsp 1;
+#X obj 192 230 s squelch;
+#X text 116 3 BOOSTING SMALL AMPLITUDES;
+#X text 614 146 record;
+#X floatatom 75 316;
+#N canvas 190 43 405 461 test-signal 0;
+#X obj 134 293 tabread4~ sample;
+#X obj 134 268 line~;
+#X obj 95 146 f;
+#X obj 254 46 r insamprate;
+#X obj 136 350 *~;
+#X obj 164 351 dbtorms;
+#X obj 164 328 inlet;
+#X obj 135 415 outlet~;
+#X obj 146 33 r insamplength;
+#X msg 134 247 0 \, \$1 \$2;
+#X obj 134 221 pack 0 0;
+#X obj 209 190 /;
+#X obj 299 99 * 0.001;
+#X obj 135 388 hip~ 5;
+#X obj 33 5 loadbang;
+#X text 242 13 sample playback;
+#X msg 33 25 1;
+#X obj 33 69 metro 1000;
+#X floatatom 33 48;
+#X obj 255 75 t b b f;
+#X obj 161 84 t b f;
+#X connect 0 0 4 0;
+#X connect 1 0 0 0;
+#X connect 2 0 10 0;
+#X connect 3 0 19 0;
+#X connect 4 0 13 0;
+#X connect 5 0 4 1;
+#X connect 6 0 5 0;
+#X connect 8 0 20 0;
+#X connect 9 0 1 0;
+#X connect 10 0 9 0;
+#X connect 11 0 10 1;
+#X connect 11 0 17 1;
+#X connect 12 0 11 1;
+#X connect 13 0 7 0;
+#X connect 14 0 16 0;
+#X connect 16 0 18 0;
+#X connect 17 0 2 0;
+#X connect 18 0 17 0;
+#X connect 19 0 16 0;
+#X connect 19 1 11 0;
+#X connect 19 2 12 0;
+#X connect 20 0 16 0;
+#X connect 20 1 11 0;
+#X connect 20 1 2 1;
+#X restore 75 339 pd test-signal;
+#X text 76 294 amplitude;
+#N canvas 132 255 634 331 insample 0;
+#X graph graph1 0 -1 155947 1 199 168 599 18;
+#X array sample 155948 float;
+#X pop;
+#X obj 19 70 r read-sample;
+#X obj 19 95 unpack s f;
+#X obj 53 121 s insamprate;
+#X obj 19 171 soundfiler;
+#X msg 19 147 read -resize \$1 sample;
+#X obj 19 201 s insamplength;
+#X msg 357 197 \; sample resize 220500 \; insamplength 220500;
+#X connect 1 0 2 0;
+#X connect 2 0 5 0;
+#X connect 2 1 3 0;
+#X connect 4 0 6 0;
+#X connect 5 0 4 0;
+#X restore 521 357 pd insample;
+#X msg 282 189 \; read-sample ../sound/bell.aiff 44100;
+#X text 38 27 the "fft analysis" window here simply divides each complex bin of the FFT by its own magnitude to "flatten" the spectrum. The "squelch" control limits the amplitude boost the algorithm will apply. If infinite \, you'll get a white spectrum \; if less \, the louder parts of the spectrum will be flattened but the quieter ones will only be boosetd by the squelch value.;
+#X msg 281 229 \; read-sample ../sound/voice.wav 32000;
+#X connect 0 0 3 0;
+#X connect 1 0 24 0;
+#X connect 3 0 2 0;
+#X connect 3 0 2 1;
+#X connect 4 0 3 1;
+#X connect 5 0 10 0;
+#X connect 6 0 5 0;
+#X connect 7 0 6 0;
+#X connect 11 0 4 0;
+#X connect 12 0 13 0;
+#X connect 13 0 19 1;
+#X connect 16 0 21 0;
+#X connect 17 0 16 0;
+#X connect 18 0 19 0;
+#X connect 18 0 21 0;
+#X connect 19 0 20 0;
+#X connect 27 0 28 0;
+#X connect 28 0 0 0;