#N canvas 484 38 622 806 12;
#X declare -stdpath ./;
#X obj 117 554 cos~;
#X obj 117 495 *~;
#X obj 157 554 cos~;
#X obj 230 505 wrap~;
#X obj 194 505 -~;
#X obj 157 531 +~;
#X obj 157 596 -~;
#X obj 187 627 *~;
#X obj 151 632 +~;
#X obj 194 473 samphold~;
#X floatatom 194 266 4 0 127 0 - \$0-center-freq - 0;
#X obj 194 340 line~;
#X obj 194 316 pack 0 50;
#X obj 117 416 phasor~;
#X floatatom 117 312 4 0 127 0 - \$0-fundamental - 0;
#X floatatom 355 334 4 0 127 0 - \$0-bandwidth - 0;
#X obj 355 405 line~;
#X obj 337 541 *~;
#X obj 355 382 pack 0 50;
#X obj 292 510 cos~;
#X obj 292 485 -~ 0.25;
#X obj 187 677 *~;
#X text 340 633 waveshaper;
#X obj 117 336 mtof;
#X obj 212 368 expr 1/$f1;
#X obj 194 292 mtof;
#X obj 194 392 *~;
#X obj 355 356 mtof;
#X obj 355 441 *~;
#X obj 355 485 *~ 25;
#X text 385 440 divide by fundamental;
#X text 403 484 range for table;
#X text 200 412 C.F. relative;
#X text 201 428 to fundamental;
#X text 119 676 ring mod;
#X obj 187 714 output~;
#X obj 292 460 *~ 0.5;
#X text 23 66 The more "natural" units for describing a formant might be center frequency and bandwidth \, so that you can change the fundamental without having the formant shift up and down in parallel. Here all three frequencies are expressed in MIDI units. The bandwidth and center frequency have to be divided by the fundamental (the expr 1/$f1 takes its reciprocal and two [*~] objects finish the division.), f 81;
#X text 79 274 fundamental (MIDI units), f 12;
#X obj 42 19 cnv 5 5 25 empty empty Changing\ PAF\ Controls\ to\ Natural\ Units 15 13 0 16 #dfdfdf #202020 0;
#N canvas 761 333 560 373 table 0;
#N canvas 0 0 450 300 (subpatch) 0;
#X array gaussian 200 float 0;
#A color 0;
#A width 1;
#X coords 0 1 199 0 243 162 1;
#X restore 284 146 graph;
#X obj 75 86 t b b;
#X obj 168 175 f;
#X obj 206 175 + 1;
#X msg 186 145 0;
#X obj 75 125 until;
#X obj 168 210 t f f;
#X obj 68 277 expr exp(-$f1*$f1);
#X obj 82 171 sel 199;
#X obj 68 248 expr ($f1-100)/25;
#X obj 75 55 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X obj 75 24 loadbang;
#X text 101 53 <- rebuild the table;
#X obj 84 309 tabwrite gaussian;
#X connect 1 0 5 0;
#X connect 1 1 4 0;
#X connect 2 0 3 0;
#X connect 2 0 6 0;
#X connect 2 0 8 0;
#X connect 3 0 2 1;
#X connect 4 0 2 1;
#X connect 5 0 2 0;
#X connect 6 0 9 0;
#X connect 6 1 13 1;
#X connect 7 0 13 0;
#X connect 8 0 5 1;
#X connect 9 0 7 0;
#X connect 10 0 1 0;
#X connect 11 0 10 0;
#X restore 452 707 pd table;
#N canvas 238 316 365 358 init 0;
#X obj 125 294 declare -stdpath ./;
#X obj 131 97 loadbang;
#X text 81 28 This subpatch initializes the patch and loads a value in the number boxes., f 29;
#X obj 131 126 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X obj 131 153 f \$0;
#X msg 131 183 \; \$1-fundamental 48 \; \$1-center-freq 60 \; \$1-bandwidth 72;
#X connect 1 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X restore 373 707 pd init;
#X text 228 266 center freq. (also MIDI);
#X text 394 334 bandwidth (MIDI);
#X text 23 154 Here we take a somewhat lax approach to sampholding the center frequency control. The frequency itself changes instantly \, but the center/fundamental frequency ratio waits for the next period. This gives a slight "chirp" if the fundamental is abruptly raised a couple of octaves. There's no easy way using Pd's built-in primitives to avoid this. Note that now we only compute the second half of the gaussian table \, which is the part we were effectively using., f 81;
#X obj 337 590 tabread4~ gaussian, f 9;
#X obj 337 565 +~ 100;
#X connect 0 0 6 1;
#X connect 0 0 8 0;
#X connect 1 0 5 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;
#X connect 3 0 4 1;
#X connect 3 0 7 1;
#X connect 4 0 1 1;
#X connect 5 0 2 0;
#X connect 6 0 7 0;
#X connect 7 0 8 1;
#X connect 8 0 21 0;
#X connect 9 0 4 0;
#X connect 9 0 3 0;
#X connect 10 0 25 0;
#X connect 11 0 26 0;
#X connect 12 0 11 0;
#X connect 13 0 9 1;
#X connect 13 0 1 0;
#X connect 13 0 5 1;
#X connect 13 0 36 0;
#X connect 14 0 23 0;
#X connect 15 0 27 0;
#X connect 16 0 28 0;
#X connect 17 0 46 0;
#X connect 18 0 16 0;
#X connect 19 0 17 0;
#X connect 20 0 19 0;
#X connect 21 0 35 0;
#X connect 23 0 24 0;
#X connect 23 0 13 0;
#X connect 24 0 26 1;
#X connect 24 0 28 1;
#X connect 25 0 12 0;
#X connect 26 0 9 0;
#X connect 27 0 18 0;
#X connect 28 0 29 0;
#X connect 29 0 17 1;
#X connect 36 0 20 0;
#X connect 45 0 21 1;
#X connect 46 0 45 0;
