#N canvas 442 52 1004 763 10;
#X obj 266 531 phasor~;
#X obj 535 625 unpack;
#X floatatom 535 675 0 0 0 0 - - -;
#X msg 441 458 print;
#X obj 266 509 sig~;
#X floatatom 266 487 0 0 0 0 - - -;
#X obj 266 465 mtof;
#X floatatom 266 443 0 0 0 0 - - -;
#X floatatom 549 652 0 0 0 0 - - -;
#X obj 535 585 route 1 2 3 4;
#X obj 618 625 unpack;
#X floatatom 618 675 0 0 0 0 - - -;
#X floatatom 632 652 0 0 0 0 - - -;
#X obj 702 625 unpack;
#X floatatom 702 675 0 0 0 0 - - -;
#X floatatom 716 652 0 0 0 0 - - -;
#X obj 393 625 unpack;
#X floatatom 393 675 0 0 0 0 - - -;
#X floatatom 407 652 0 0 0 0 - - -;
#X obj 338 554 *~;
#X obj 326 403 loadbang;
#X obj 357 531 sig~;
#X floatatom 357 509 0 0 0 0 - - -;
#X msg 326 487 1;
#X msg 357 487 0;
#X floatatom 470 675 0 0 0 0 - - -;
#X obj 285 675 print attack;
#X obj 194 675 print pitch;
#X msg 780 27 \; pd dsp 1;
#X text 685 21 click here;
#X text 685 43 to start DSP;
#X text 124 7 FIDDLE - pitch estimator and sinusoidal peak finder;
#X text 12 79 The Fiddle object estimates the pitch and amplitude of
an incoming sound \, both continuously and as a stream of discrete
"note" events. Fiddle optionally outputs a list of detected sinusoidal
peaks used to make the pitch determination. Fiddle is described theoretically
in the 1998 ICMC proceedings \, reprinted on msp.ucsd.edu.
;
#X text 12 179 Fiddle's creation arguments specify an analysis window
size \, the maximum polyphony (i.e. \, the number of simultaneous "pitches"
to try to find) \, the number of peaks in the spectrum to consider
\, and the number of peaks \, if any \, to output "raw." The outlets
give discrete pitch (a number) \, detected attacks in the amplitude
envelope (a bang) \, one or more voices of continuous pitch and amplitude
\, overall amplitude \, and optionally a sequence of messages with
the peaks.;
#X text 12 305 The analysis hop size is half the window size so in
the example shown here \, one analysis is done every 512 samples (11.6
msec at 44K1) \, and the analysis uses the most recent 1024 samples
(23.2 msec at 44K1). The minimum frequency that Fiddle will report
is 2-1/2 cycles per analysis windows \, or about 108 Hz. (just below
MIDI 45.);
#X text 673 544 number of pitch outlets (1-3 \, default 1);
#X text 673 566 number of peaks to find (1-100 \, default 20);
#X text 673 588 number of peaks to output (default 0.);
#X msg 445 116 amp-range 40 50;
#X msg 443 236 reattack 100 10;
#X msg 442 291 npartial 7;
#X msg 442 179 vibrato 50 0.5;
#X text 564 100 a low and high amplitude threshold: if signal amplitude
is below the low threshold \, no pitches or peaks are output. The high
threshold is a minimum at which "cooked" outputs may appear.;
#X text 564 161 A period in milliseconds (50) over which the raw pitch
may not deviate more than an interval in half-tones (0.5) from the
average pitch to report it as a note to the "cooked" pitch outlet.
;
#X text 564 222 A period in milliseconds (100) over which a re-attack
is reported if the amplitude rises more than (1) dB. The re-attack
will result in a "bang" in the attack outlet and may give rise to repeated
notes in the cooked pitch output.;
#X text 146 441 test input pitch;
#X text 334 453 test input;
#X text 334 466 amplitude;
#X obj 414 554 fiddle~ 1024 1 20 3;
#X text 542 699 individual sinusoidal components;
#X text 470 697 amplitude;
#X text 480 712 (dB);
#X text 393 697 raw pitch;
#X text 380 721 and amplitude;
#X text 368 738 (up to 3 outputs);
#X text 291 695 bang on;
#X text 291 717 attack;
#X text 189 695 cooked pitch;
#X text 206 712 output;
#X text 549 554 ------ arguments:;
#X msg 266 421 57;
#X msg 444 340 auto 1;
#X msg 444 362 auto 0;
#X msg 443 427 bang;
#X text 565 425 poll current values --- useful if not in auto mode
\,;
#X text 564 283 Higher partials are weighed less strongly than lower
ones in determining the pitch. This specifies the number of the partial
(7) which will be weighted half as strongly as the fundamental.;
#X text 564 344 start and stop "auto" mode (on by default.) If off
\, output only appears on "bang" (poll mode).;
#X text 565 457 print out all settings;
#X text 673 522 window size (128-2048 \, default 1024);
#X msg 444 384 npoints 2048;
#X text 566 393 number of points in analysis window (power of 2 \,
128-2048);
#X msg 443 405 npoints 1024;
#X obj 429 34 sigmund~;
#X text 124 34 NOTE: fiddle~ is obsolete - consider using;
#X connect 0 0 19 0;
#X connect 1 0 2 0;
#X connect 1 1 8 0;
#X connect 3 0 48 0;
#X connect 4 0 0 0;
#X connect 5 0 4 0;
#X connect 6 0 5 0;
#X connect 7 0 6 0;
#X connect 9 0 1 0;
#X connect 9 1 10 0;
#X connect 9 2 13 0;
#X connect 10 0 11 0;
#X connect 10 1 12 0;
#X connect 13 0 14 0;
#X connect 13 1 15 0;
#X connect 16 0 17 0;
#X connect 16 1 18 0;
#X connect 19 0 48 0;
#X connect 20 0 60 0;
#X connect 20 0 23 0;
#X connect 21 0 19 1;
#X connect 22 0 21 0;
#X connect 23 0 22 0;
#X connect 24 0 22 0;
#X connect 38 0 48 0;
#X connect 39 0 48 0;
#X connect 40 0 48 0;
#X connect 41 0 48 0;
#X connect 48 0 27 0;
#X connect 48 1 26 0;
#X connect 48 2 16 0;
#X connect 48 3 25 0;
#X connect 48 4 9 0;
#X connect 60 0 7 0;
#X connect 61 0 48 0;
#X connect 62 0 48 0;
#X connect 63 0 48 0;
#X connect 69 0 48 0;
#X connect 71 0 48 0;
