aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/4.fft.examples/13.partialtracer.pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd/doc/4.fft.examples/13.partialtracer.pd')
-rw-r--r--pd/doc/4.fft.examples/13.partialtracer.pd783
1 files changed, 783 insertions, 0 deletions
diff --git a/pd/doc/4.fft.examples/13.partialtracer.pd b/pd/doc/4.fft.examples/13.partialtracer.pd
new file mode 100644
index 00000000..5458f900
--- /dev/null
+++ b/pd/doc/4.fft.examples/13.partialtracer.pd
@@ -0,0 +1,783 @@
+#N canvas 234 52 720 591 12;
+#X floatatom 598 72;
+#N canvas 516 98 663 557 boo 0;
+#X obj 79 108 outlet;
+#X msg 78 80 set \$1;
+#X obj 79 57 r osc-amp;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 598 52 pd;
+#X obj 598 93 s osc-amp;
+#X obj 93 513 pack 0 100;
+#X obj 94 533 line~;
+#X obj 93 493 dbtorms;
+#X obj 94 573 *~;
+#X floatatom 624 225;
+#X msg 514 269 0;
+#X floatatom 567 225;
+#X floatatom 645 290;
+#X floatatom 498 71;
+#N canvas 516 98 663 555 boo 0;
+#X obj 79 108 outlet;
+#X msg 78 80 set \$1;
+#X obj 79 57 r grain-amp;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 498 51 pd;
+#N canvas 201 90 556 354 analysis 0;
+#X obj 220 45 r snapshot;
+#X obj 62 283 print;
+#X obj 106 154 t b b b;
+#X obj 20 189 s done-analysis;
+#X obj 209 149 s start-analysis;
+#X obj 161 261 s found-peak;
+#X obj 107 263 r loud;
+#X obj 63 262 spigot;
+#X msg 138 101 1;
+#X obj 31 99 r fft-done;
+#X obj 31 129 spigot;
+#X msg 110 101 0;
+#X obj 222 84 del 0.01;
+#X msg 221 66 bang;
+#X text 183 103 Wait for the next FFT to come by before doing the peak search.;
+#X obj 341 176 r errthresh;
+#X msg 343 219 errthresh \$1;
+#X floatatom 341 199;
+#X obj 212 173 r window-size;
+#X obj 169 190 f;
+#X msg 162 211 \$1 fft-real fft-imag 10;
+#X obj 162 231 pique;
+#X connect 0 0 13 0;
+#X connect 2 0 3 0;
+#X connect 2 1 19 0;
+#X connect 2 2 4 0;
+#X connect 2 2 11 0;
+#X connect 6 0 7 1;
+#X connect 7 0 1 0;
+#X connect 8 0 10 1;
+#X connect 9 0 10 0;
+#X connect 10 0 2 0;
+#X connect 11 0 10 1;
+#X connect 12 0 8 0;
+#X connect 13 0 12 0;
+#X connect 15 0 17 0;
+#X connect 16 0 21 0;
+#X connect 17 0 16 0;
+#X connect 18 0 19 1;
+#X connect 19 0 20 0;
+#X connect 20 0 21 0;
+#X connect 21 0 5 0;
+#X connect 21 0 7 0;
+#X restore 270 411 pd analysis;
+#N canvas 168 244 411 214 peak-template 0;
+#X obj 62 52 filledpolygon 3 3 3 0 0 0 amp 0 0;
+#X obj 57 10 template float x float y float amp float ampreal float ampimag float used;
+#X restore 270 516 pd peak-template;
+#N canvas 0 0 600 386 peak-list 0;
+#X restore 270 454 pd peak-list;
+#N canvas 20 23 472 426 trace-list 1;
+#X restore 270 494 pd trace-list;
+#N canvas 56 84 527 179 trace-template 0;
+#X obj 93 72 plot bazoo 0 1 0 500 5;
+#X obj 96 36 template float x float y float voiceno array bazoo point-template;
+#X text 93 93 This template describes a pitch/amplitude trace. The array "bazoo" holds the actual points. In this template \, y is always 0 and x is the starting location in pixels. There are 5 pixels per point.;
+#X restore 270 537 pd trace-template;
+#N canvas 96 258 494 158 point-template 0;
+#X text 98 56 This template describes a single point on a pitch trace (cf. trace-template w describes the trace itself.);
+#X obj 163 14 template float y float amp;
+#X text 98 89 "y" is the field that is shown on the graph \; it's - 4 * pitch. You also get an "amp" field in dB \, which you can't see as a plot (yet).;
+#X restore 270 557 pd point-template;
+#X msg 574 506 bang;
+#X obj 6 425 pack 0 100;
+#X obj 6 449 line~;
+#X obj 6 405 dbtorms;
+#X floatatom 419 70;
+#N canvas 194 37 730 722 output 0;
+#X obj 227 76 t b f;
+#X obj 220 100 +;
+#X obj 396 207 f;
+#X obj 409 165 f;
+#X obj 276 210 f;
+#X obj 64 179 t b;
+#X obj 63 127 f;
+#X obj 55 58 inlet;
+#X text 60 37 mute;
+#X obj 64 201 f;
+#X msg 181 153 0;
+#X msg 57 84 bang;
+#X obj 64 155 moses 1;
+#X obj 178 69 t b f;
+#X obj 171 93 +;
+#X obj 139 27 r loop-amp;
+#X obj 304 26 r osc-amp;
+#X obj 64 236 s loop-amp;
+#X obj 276 235 s osc-amp;
+#X obj 455 125 print;
+#X obj 143 148 f;
+#X obj 288 168 f;
+#X obj 173 120 t b b;
+#X obj 425 23 r grain-amp;
+#X obj 397 232 s grain-amp;
+#X connect 0 0 1 0;
+#X connect 0 1 1 1;
+#X connect 1 0 6 1;
+#X connect 2 0 24 0;
+#X connect 3 0 2 1;
+#X connect 4 0 18 0;
+#X connect 5 0 9 0;
+#X connect 5 0 4 0;
+#X connect 5 0 2 0;
+#X connect 6 0 12 0;
+#X connect 7 0 11 0;
+#X connect 9 0 17 0;
+#X connect 10 0 17 0;
+#X connect 10 0 18 0;
+#X connect 10 0 24 0;
+#X connect 11 0 6 0;
+#X connect 12 0 5 0;
+#X connect 12 1 22 0;
+#X connect 13 0 14 0;
+#X connect 13 1 14 1;
+#X connect 14 0 1 0;
+#X connect 15 0 14 0;
+#X connect 15 0 20 1;
+#X connect 16 0 13 0;
+#X connect 16 0 21 1;
+#X connect 20 0 9 1;
+#X connect 21 0 4 1;
+#X connect 22 0 10 0;
+#X connect 22 1 20 0;
+#X connect 22 1 21 0;
+#X connect 22 1 3 0;
+#X connect 23 0 3 1;
+#X connect 23 0 0 0;
+#X restore 631 69 pd output;
+#N canvas 516 98 663 559 /SUBPATCH/ 0;
+#X obj 79 108 outlet;
+#X msg 78 80 set \$1;
+#X obj 79 57 r loop-amp;
+#X connect 1 0 0 0;
+#X connect 2 0 1 0;
+#X restore 419 50 pd;
+#N canvas 209 96 518 375 fft 0;
+#X floatatom 235 194;
+#X obj 349 160 r sample-rate;
+#X obj 349 180 t b f;
+#X obj 234 169 r window-size;
+#X obj 203 38 r sample-rate;
+#X obj 183 16 r window-size;
+#X obj 203 58 t b f;
+#X obj 183 83 /;
+#X obj 131 103 bang~;
+#X obj 130 175 line~;
+#X obj 183 104 * 1000;
+#X text 229 104 window size (msec);
+#X obj 129 281 rfft~;
+#X obj 131 337 tabsend~ fft-real;
+#X obj 159 307 tabsend~ fft-imag;
+#X obj 330 140 r location;
+#X obj 330 205 *;
+#X obj 330 228 * 0.001;
+#X text 383 228 location (samples);
+#X obj 130 129 f;
+#X msg 130 152 0 \, 1 \$1;
+#X obj 87 201 *~;
+#X obj 87 224 -~;
+#X obj 62 301 *~;
+#X obj 62 324 outlet~;
+#X floatatom 330 252;
+#X obj 41 127 s fft-done;
+#X obj 51 31 block~ 2048 1;
+#X obj 129 255 tabread4~ sample;
+#X obj 130 211 *~ 0;
+#X obj 129 232 +~ 0;
+#X connect 1 0 2 0;
+#X connect 2 0 16 0;
+#X connect 2 1 16 1;
+#X connect 3 0 0 0;
+#X connect 3 0 29 1;
+#X connect 4 0 6 0;
+#X connect 5 0 7 0;
+#X connect 6 0 7 0;
+#X connect 6 1 7 1;
+#X connect 7 0 10 0;
+#X connect 8 0 19 0;
+#X connect 8 0 26 0;
+#X connect 9 0 21 0;
+#X connect 9 0 21 1;
+#X connect 9 0 22 1;
+#X connect 9 0 29 0;
+#X connect 10 0 19 1;
+#X connect 12 0 13 0;
+#X connect 12 1 14 0;
+#X connect 15 0 16 0;
+#X connect 16 0 17 0;
+#X connect 17 0 25 0;
+#X connect 17 0 30 1;
+#X connect 19 0 20 0;
+#X connect 20 0 9 0;
+#X connect 21 0 22 0;
+#X connect 22 0 23 0;
+#X connect 23 0 24 0;
+#X connect 28 0 12 0;
+#X connect 28 0 23 1;
+#X connect 29 0 30 0;
+#X connect 30 0 28 0;
+#X restore 17 470 pd fft;
+#X obj 6 493 *~;
+#X obj 7 544 hip~ 5;
+#X obj 7 571 dac~;
+#X obj 580 529 adc~;
+#X obj 419 91 s loop-amp;
+#X msg 631 48 mute;
+#X text 13 127 click here first;
+#X text 570 489 live sample;
+#X text 521 25 AMPLITUDES;
+#N canvas 5 1 864 622 make-trace 0;
+#X obj 143 220 * -0.33333;
+#X obj 70 216 * 10;
+#X obj 91 136 pointer;
+#X msg 91 115 next;
+#X obj 91 97 until;
+#X obj 298 134 pointer;
+#X msg 299 108 next;
+#X obj 154 330 unpack;
+#X obj 196 332 s amp;
+#X obj 218 378 s frequency;
+#X obj 231 361 s pitch;
+#X obj 193 375 f 0;
+#X obj 154 348 t b b b b f;
+#X obj 601 133 pointer;
+#X obj 572 602 setsize trace-template bazoo;
+#X obj 572 514 random 200;
+#X obj 572 532 + 100;
+#X obj 659 526 pointer;
+#X obj 168 532 pointer;
+#X floatatom 274 524;
+#X floatatom 228 550;
+#X msg 158 509 bang;
+#X floatatom 83 461;
+#X floatatom 31 509;
+#X floatatom 118 590;
+#X floatatom 397 556;
+#X floatatom 274 489;
+#X floatatom 513 511;
+#X obj 370 464 pointer;
+#X msg 391 447 next;
+#X floatatom 409 512;
+#X obj 397 539 getsize trace-template bazoo;
+#X obj 98 563 get point-template y;
+#X obj 31 533 set point-template y;
+#X obj 78 486 element trace-template bazoo;
+#X obj 228 580 setsize trace-template bazoo;
+#X obj 274 507 set trace-template x;
+#X obj 274 542 set trace-template y;
+#X msg 572 497 bang;
+#X obj 572 549 append trace-template x;
+#X obj 399 489 get trace-template x y;
+#X obj 572 567 t b p;
+#X msg 572 584 5;
+#X obj 628 93 s clear-traces;
+#X obj 602 155 s last-in-list;
+#X msg 600 43 bang;
+#X obj 600 60 t b b;
+#X obj 573 156 f 0;
+#X obj 572 176 s nframe;
+#X obj 342 337 r nframe;
+#X obj 330 356 f;
+#X obj 330 373 + 1;
+#X obj 330 391 s nframe;
+#X obj 330 296 r done-frame;
+#X obj 336 315 s done-adding-traces;
+#X obj 15 309 r component;
+#X obj 15 326 unpack;
+#X obj 56 331 s amp;
+#X obj 80 370 s frequency;
+#X obj 92 354 s pitch;
+#X obj 54 388 s added-to-trace;
+#X obj 54 370 f 0;
+#X obj 48 408 s add-to-trace;
+#X obj 15 344 t b b b b f;
+#X obj 600 25 r clear-all;
+#X obj 154 311 r component2;
+#X obj 193 393 s started-new-trace;
+#X obj 185 414 s start-new-trace;
+#X obj 273 41 r done-analysis;
+#X obj 273 62 t b b b b;
+#X obj 225 176 r added-to-trace;
+#X obj 299 89 until;
+#X obj 351 172 get peak-template x amp;
+#X obj 425 195 * -0.33333;
+#X obj 351 190 * 10;
+#X obj 351 210 pack;
+#X obj 351 226 s component;
+#X obj 92 337 ftom;
+#X obj 298 155 t b p p;
+#X obj 197 196 set peak-template used;
+#X obj 199 176 f;
+#X obj 232 344 ftom;
+#X msg 135 31 \; done-frame bang;
+#X obj 16 178 get peak-template used x amp;
+#X obj 27 236 pack 0 0 0;
+#X obj 27 255 route 0;
+#X obj 27 272 s component2;
+#X obj 422 260 print x1;
+#X obj 174 276 print x2;
+#X obj 559 255 add-trace 1;
+#X obj 560 274 add-trace 2;
+#X obj 560 291 add-trace 3;
+#X obj 559 309 add-trace 4;
+#X obj 560 328 add-trace 5;
+#X obj 560 345 add-trace 6;
+#X obj 560 363 add-trace 7;
+#X obj 561 381 add-trace 8;
+#X obj 561 399 add-trace 9;
+#X obj 561 417 add-trace 10;
+#X msg 372 111 traverse pd-peak-list;
+#X msg 601 115 traverse pd-trace-list \, bang;
+#X msg 641 59 \; pd-trace-list clear;
+#X msg 370 430 traverse pd-trace-list \, next;
+#X msg 659 509 traverse pd-trace-list \, bang;
+#X connect 0 0 84 2;
+#X connect 1 0 84 1;
+#X connect 2 0 83 0;
+#X connect 2 1 4 1;
+#X connect 3 0 2 0;
+#X connect 4 0 3 0;
+#X connect 5 0 78 0;
+#X connect 5 1 71 1;
+#X connect 6 0 5 0;
+#X connect 7 0 12 0;
+#X connect 7 1 8 0;
+#X connect 11 0 66 0;
+#X connect 12 2 67 0;
+#X connect 12 3 11 0;
+#X connect 12 4 81 0;
+#X connect 12 4 9 0;
+#X connect 13 0 44 0;
+#X connect 15 0 16 0;
+#X connect 16 0 39 0;
+#X connect 17 0 39 1;
+#X connect 18 0 32 0;
+#X connect 19 0 37 0;
+#X connect 20 0 35 0;
+#X connect 21 0 18 0;
+#X connect 22 0 34 0;
+#X connect 23 0 33 0;
+#X connect 26 0 36 0;
+#X connect 28 0 35 1;
+#X connect 28 0 36 1;
+#X connect 28 0 37 1;
+#X connect 28 0 34 1;
+#X connect 28 0 40 0;
+#X connect 28 0 31 0;
+#X connect 29 0 28 0;
+#X connect 31 0 25 0;
+#X connect 32 0 24 0;
+#X connect 34 0 18 0;
+#X connect 34 0 33 1;
+#X connect 38 0 15 0;
+#X connect 39 0 41 0;
+#X connect 40 0 30 0;
+#X connect 40 1 27 0;
+#X connect 41 0 42 0;
+#X connect 41 1 14 1;
+#X connect 42 0 14 0;
+#X connect 45 0 46 0;
+#X connect 46 0 100 0;
+#X connect 46 0 47 0;
+#X connect 46 1 101 0;
+#X connect 46 1 43 0;
+#X connect 47 0 48 0;
+#X connect 49 0 50 1;
+#X connect 50 0 51 0;
+#X connect 51 0 52 0;
+#X connect 53 0 50 0;
+#X connect 53 0 54 0;
+#X connect 55 0 56 0;
+#X connect 56 0 63 0;
+#X connect 56 1 57 0;
+#X connect 61 0 60 0;
+#X connect 63 2 62 0;
+#X connect 63 3 61 0;
+#X connect 63 4 77 0;
+#X connect 63 4 58 0;
+#X connect 64 0 45 0;
+#X connect 65 0 7 0;
+#X connect 68 0 69 0;
+#X connect 69 0 82 0;
+#X connect 69 1 4 0;
+#X connect 69 2 71 0;
+#X connect 69 3 99 0;
+#X connect 70 0 80 1;
+#X connect 71 0 6 0;
+#X connect 72 0 74 0;
+#X connect 72 1 73 0;
+#X connect 73 0 75 1;
+#X connect 74 0 75 0;
+#X connect 75 0 76 0;
+#X connect 77 0 59 0;
+#X connect 78 0 80 0;
+#X connect 78 1 79 1;
+#X connect 78 2 72 0;
+#X connect 80 0 79 0;
+#X connect 81 0 10 0;
+#X connect 83 0 84 0;
+#X connect 83 1 1 0;
+#X connect 83 2 0 0;
+#X connect 84 0 85 0;
+#X connect 85 0 86 0;
+#X connect 99 0 5 0;
+#X connect 99 0 2 0;
+#X connect 100 0 13 0;
+#X connect 102 0 28 0;
+#X connect 103 0 17 0;
+#X restore 270 474 pd make-trace;
+#X floatatom 4 289;
+#N canvas 0 0 955 721 arrays 0;
+#X msg 30 202 \; fft-real resize 4096 \; fft-imag resize 4096;
+#X graph graph1 0 -1 4096 1 332 341 732 41;
+#X array fft-real 4096 float;
+#X pop;
+#X graph graph2 0 -1 4096 1 322 565 722 265;
+#X array fft-imag 4096 float;
+#X pop;
+#X restore 439 515 pd arrays;
+#X obj 4 309 s location;
+#X obj 95 412 r loop-amp;
+#X obj 567 288 f;
+#X obj 4 248 r location;
+#X msg 4 268 set \$1;
+#X obj 598 288 +;
+#X obj 567 309 moses 900;
+#X msg 535 329 0;
+#X msg 534 247 1;
+#X msg 566 335 \; location \$1 \; snapshot bang;
+#X msg 504 177 bang \; location 0 \; clear-all bang;
+#X floatatom 504 305;
+#X obj 504 225 t b b;
+#X obj 645 270 r incr;
+#X obj 6 385 r grain-amp;
+#X obj 93 473 r osc-amp;
+#X obj 110 553 catch~ osc-sum;
+#N canvas 102 67 751 619 osc-bank 0;
+#X obj 239 433 osc-voice;
+#X obj 223 451 osc-voice;
+#X obj 207 471 osc-voice;
+#X obj 191 490 osc-voice;
+#X obj 175 510 osc-voice;
+#X obj 159 528 osc-voice;
+#X obj 143 547 osc-voice;
+#X obj 127 566 osc-voice;
+#X obj 111 586 osc-voice;
+#X obj 95 410 route 1 2 3 4 5 6 7 8 9 10;
+#X msg 290 269 0;
+#X obj 560 489 pointer;
+#X floatatom 652 417;
+#X obj 479 351 pointer;
+#X msg 422 491 next;
+#X floatatom 479 419;
+#X obj 178 111 pointer;
+#X floatatom 283 104;
+#X floatatom 238 129;
+#X msg 168 88 bang;
+#X floatatom 92 40;
+#X floatatom 41 88;
+#X floatatom 127 169;
+#X floatatom 420 137;
+#X floatatom 283 69;
+#X floatatom 523 90;
+#X obj 425 43 pointer;
+#X msg 447 27 next;
+#X floatatom 419 92;
+#X obj 420 120 getsize trace-template bazoo;
+#X obj 108 142 get point-template y;
+#X obj 41 113 set point-template y;
+#X obj 87 66 element trace-template bazoo;
+#X obj 238 159 setsize trace-template bazoo;
+#X obj 283 86 set trace-template x;
+#X obj 283 121 set trace-template y;
+#X obj 409 68 get trace-template x y;
+#X floatatom 403 312;
+#X msg 403 288 1;
+#X msg 434 288 0;
+#X obj 479 451 <;
+#X obj 479 398 get trace-template x voiceno;
+#X obj 479 374 t p p;
+#X obj 302 337 until;
+#X obj 477 233 r start-resynth;
+#X obj 481 255 t b b;
+#X obj 388 353 f;
+#X obj 388 372 sel 0 1;
+#X obj 514 436 r synth-index;
+#X obj 478 555 pack f p;
+#X obj 479 470 sel 0 1;
+#X obj 235 230 r step-resynth;
+#X obj 291 288 f;
+#X obj 291 308 s synth-index;
+#X obj 489 523 f;
+#X obj 322 289 + 5;
+#X obj 478 490 t b b b;
+#X obj 235 252 t b b b;
+#X obj 216 301 s osc-tick;
+#X obj 95 604 osc-voice;
+#X msg 425 10 traverse pd-trace-list \, next;
+#X msg 478 288 traverse pd-trace-list \, next;
+#X connect 9 0 59 0;
+#X connect 9 1 8 0;
+#X connect 9 2 7 0;
+#X connect 9 3 6 0;
+#X connect 9 4 5 0;
+#X connect 9 5 4 0;
+#X connect 9 6 3 0;
+#X connect 9 7 2 0;
+#X connect 9 8 1 0;
+#X connect 9 9 0 0;
+#X connect 10 0 52 0;
+#X connect 11 0 49 1;
+#X connect 13 0 42 0;
+#X connect 13 1 39 0;
+#X connect 13 1 43 1;
+#X connect 14 0 13 0;
+#X connect 15 0 40 0;
+#X connect 16 0 30 0;
+#X connect 17 0 35 0;
+#X connect 18 0 33 0;
+#X connect 19 0 16 0;
+#X connect 20 0 32 0;
+#X connect 21 0 31 0;
+#X connect 24 0 34 0;
+#X connect 26 0 33 1;
+#X connect 26 0 34 1;
+#X connect 26 0 35 1;
+#X connect 26 0 32 1;
+#X connect 26 0 36 0;
+#X connect 26 0 29 0;
+#X connect 27 0 26 0;
+#X connect 29 0 23 0;
+#X connect 30 0 22 0;
+#X connect 32 0 16 0;
+#X connect 32 0 31 1;
+#X connect 36 0 28 0;
+#X connect 36 1 25 0;
+#X connect 37 0 46 1;
+#X connect 38 0 37 0;
+#X connect 39 0 37 0;
+#X connect 40 0 50 0;
+#X connect 41 0 15 0;
+#X connect 41 1 54 1;
+#X connect 42 0 41 0;
+#X connect 42 1 11 1;
+#X connect 43 0 46 0;
+#X connect 44 0 45 0;
+#X connect 45 0 61 0;
+#X connect 45 1 38 0;
+#X connect 45 1 10 0;
+#X connect 46 0 47 0;
+#X connect 47 0 43 1;
+#X connect 47 1 15 0;
+#X connect 48 0 40 1;
+#X connect 49 0 9 0;
+#X connect 50 0 43 1;
+#X connect 50 1 56 0;
+#X connect 51 0 57 0;
+#X connect 52 0 53 0;
+#X connect 52 0 55 0;
+#X connect 54 0 49 0;
+#X connect 55 0 52 1;
+#X connect 56 0 14 0;
+#X connect 56 1 54 0;
+#X connect 56 2 11 0;
+#X connect 57 0 58 0;
+#X connect 57 1 43 0;
+#X connect 57 2 52 0;
+#X connect 60 0 26 0;
+#X connect 61 0 13 0;
+#X restore 439 494 pd osc-bank;
+#X obj 498 92 s grain-amp;
+#N canvas 31 70 662 326 save-list 0;
+#X floatatom 584 255;
+#X floatatom 521 254;
+#X floatatom 461 251;
+#X floatatom 398 250;
+#X obj 335 206 pointer;
+#X obj 236 121 pointer;
+#X msg 252 47 bang;
+#X obj 117 200 rmstodb;
+#X obj 8 201 * 0.1;
+#X obj 116 220 * -3;
+#X floatatom 342 247;
+#X obj 234 27 r start-analysis;
+#X obj 235 71 t b b;
+#X msg 351 185 next;
+#X obj 331 227 get peak-template x y amp ampreal ampimag;
+#X obj 7 241 append peak-template x y amp ampreal ampimag;
+#X obj 96 138 r found-peak;
+#X obj 97 161 unpack 0 0 0 0 0;
+#X msg 62 201 330;
+#X msg 274 69 \; pd-peak-list clear;
+#X msg 235 100 traverse pd-peak-list \, bang;
+#X msg 336 166 traverse pd-peak-list \, next;
+#X connect 4 0 14 0;
+#X connect 5 0 15 5;
+#X connect 6 0 12 0;
+#X connect 7 0 9 0;
+#X connect 8 0 15 0;
+#X connect 9 0 15 2;
+#X connect 11 0 12 0;
+#X connect 12 0 20 0;
+#X connect 12 1 19 0;
+#X connect 13 0 4 0;
+#X connect 14 0 10 0;
+#X connect 14 1 3 0;
+#X connect 14 2 2 0;
+#X connect 14 3 1 0;
+#X connect 14 4 0 0;
+#X connect 16 0 17 0;
+#X connect 17 1 8 0;
+#X connect 17 2 18 0;
+#X connect 17 2 7 0;
+#X connect 17 3 15 3;
+#X connect 17 4 15 4;
+#X connect 18 0 15 1;
+#X connect 20 0 5 0;
+#X connect 21 0 4 0;
+#X restore 270 431 pd save-list;
+#X msg 6 144 \; pd dsp 1 \; window-size 2048 \; sample-rate 44100 \; f-threshold 40 \; incr 10 \; clear-all bang;
+#X obj 567 245 metro 150;
+#X floatatom 242 309;
+#X floatatom 290 309;
+#X msg 107 349 \; start-resynth bang;
+#X msg 242 350 \; step-resynth bang;
+#X obj 242 329 metro 100;
+#X msg 368 350 \; osc-stop bang;
+#X text 605 107 resynth;
+#X text 491 106 analyzed grains;
+#X text 423 106 original;
+#X text 502 158 ... and here third to analyze;
+#N canvas 0 0 276 216 test 0;
+#X floatatom 43 120;
+#X obj 43 141 s loud;
+#X msg 38 84 \; clear-all bang;
+#X msg 39 52 \; snapshot bang;
+#X connect 0 0 1 0;
+#X restore 438 538 pd test;
+#X text 244 140 read a sample;
+#X msg 165 163 \; read-sample ../sound/bell.aiff 44100;
+#X msg 164 200 \; read-sample ../sound/voice.wav 32000;
+#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 96 436 pd test-signal;
+#N canvas 132 255 634 331 insample 0;
+#X graph graph1 0 -1 55408 1 199 168 599 18;
+#X array sample 55409 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 438 559 pd insample;
+#X obj 572 553 tabwrite~ sample;
+#X text 117 0 SINUSOID TRACKING;
+#X text 99 259 to resynthesize \, "start" once and "step" ad lib. To stop \, stop stepping and hit osc-stop. Note resynth ampliture control above.;
+#X text 3 17 This patch tries to reconstruct sinusoidal "tracks" from a sampled sound using pique~ and the data structure facilities. It turns out to be quite hard \, not least because pique~ 0.1 puts out all sorts of spurious peaks.;
+#X connect 0 0 2 0;
+#X connect 1 0 0 0;
+#X connect 3 0 4 0;
+#X connect 4 0 6 0;
+#X connect 5 0 3 0;
+#X connect 6 0 28 0;
+#X connect 7 0 60 1;
+#X connect 8 0 41 1;
+#X connect 9 0 60 0;
+#X connect 10 0 44 1;
+#X connect 11 0 57 0;
+#X connect 12 0 11 0;
+#X connect 19 0 77 0;
+#X connect 20 0 21 0;
+#X connect 21 0 27 0;
+#X connect 22 0 20 0;
+#X connect 23 0 31 0;
+#X connect 25 0 23 0;
+#X connect 26 0 27 1;
+#X connect 27 0 28 0;
+#X connect 28 0 29 0;
+#X connect 28 0 29 1;
+#X connect 30 0 77 0;
+#X connect 32 0 24 0;
+#X connect 37 0 39 0;
+#X connect 40 0 75 0;
+#X connect 41 0 44 0;
+#X connect 41 0 45 0;
+#X connect 41 0 50 0;
+#X connect 42 0 43 0;
+#X connect 43 0 37 0;
+#X connect 44 0 41 1;
+#X connect 45 0 48 0;
+#X connect 45 1 46 0;
+#X connect 46 0 9 0;
+#X connect 47 0 9 0;
+#X connect 49 0 51 0;
+#X connect 51 0 47 0;
+#X connect 51 1 8 0;
+#X connect 52 0 10 0;
+#X connect 53 0 22 0;
+#X connect 54 0 5 0;
+#X connect 55 0 6 1;
+#X connect 60 0 41 0;
+#X connect 61 0 65 0;
+#X connect 62 0 65 1;
+#X connect 65 0 64 0;
+#X connect 75 0 28 0;