#N canvas 438 38 756 667 12;
#X declare -stdpath ./;
#X obj 147 328 cos~;
#X floatatom 194 131 4 0 100 0 - \$0-center-freq - 0;
#X obj 194 155 / 10;
#X text 527 541 --- 0.02 seconds ---;
#X obj 147 298 *~;
#X obj 194 213 line~;
#N canvas 0 0 450 300 (subpatch) 0;
#X array F08-carrier 882 float 0;
#X coords 0 2 881 -2 228 182 1;
#X restore 479 350 graph;
#X floatatom 97 220 5 0 0 0 - \$0-fundamental - 0;
#X obj 189 328 cos~;
#X obj 230 241 wrap~;
#X obj 194 268 -~;
#X obj 189 298 +~;
#X obj 189 373 -~;
#X obj 212 423 *~;
#X obj 194 463 +~;
#X obj 194 189 pack 0 50;
#X text 243 328 synthesize the two partials;
#X obj 194 566 output~;
#X text 297 116 The other \, spiffier way is to make a sum of cosines to interpolate between adjacent harmonics. Suppose for example we want a center frequency of 5.3 (in units of the fundamental.) We just take partial 5 with amplitude 0.7 and partial 6 with amplitude 0.3:, f 52;
#X text 282 240 the fractional part "q";
#X text 243 268 subtract to get the integer part "k";
#X text 243 298 multiply phase by k and k+1;
#X text 237 374 c2 - c1;
#X text 250 421 q * (c2 - c1);
#X text 229 458 q * c2 + (1-q) * c1;
#X text 81 180 fundamental frequency, f 11;
#X text 26 127 center frequency (in tenths of fundamental), f 22;
#X obj 103 37 cnv 5 5 25 empty empty Movable\ Center\ Frequency\ by\ Adding\ Two\ Cosines 15 13 0 16 #dfdfdf #202020 0;
#N canvas 238 316 365 358 init 0;
#X obj 125 294 declare -stdpath ./;
#X obj 131 97 loadbang;
#X obj 149 175 s \$0-fundamental;
#X msg 149 143 220;
#X text 81 28 This subpatch initializes the patch and loads a value in the number boxes., f 29;
#X obj 130 235 s \$0-center-freq;
#X msg 130 207 25;
#X connect 1 0 3 0;
#X connect 1 0 6 0;
#X connect 3 0 2 0;
#X connect 6 0 5 0;
#X restore 341 595 pd init;
#X obj 97 244 phasor~;
#N canvas 462 254 350 232 graph 0;
#X obj 68 57 inlet~;
#X obj 133 57 inlet;
#X obj 193 57 inlet;
#X obj 193 97 metro 250;
#X obj 68 164 tabwrite~ F08-carrier;
#X connect 0 0 4 0;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X restore 219 521 pd graph;
#X obj 245 495 bng 19 250 50 0 empty empty empty 0 -6 0 8 #dfdfdf #000000 #000000;
#X text 267 493 <-- graph once;
#X obj 289 522 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 311 522 <-- graph repeatedly, f 11;
#X connect 0 0 12 1;
#X connect 0 0 14 0;
#X connect 1 0 2 0;
#X connect 2 0 15 0;
#X connect 4 0 0 0;
#X connect 4 0 11 0;
#X connect 5 0 10 0;
#X connect 5 0 9 0;
#X connect 7 0 29 0;
#X connect 8 0 12 0;
#X connect 9 0 10 1;
#X connect 9 0 13 1;
#X connect 10 0 4 1;
#X connect 11 0 8 0;
#X connect 12 0 13 0;
#X connect 13 0 14 1;
#X connect 14 0 17 0;
#X connect 14 0 30 0;
#X connect 15 0 5 0;
#X connect 29 0 4 0;
#X connect 29 0 11 1;
#X connect 31 0 30 1;
#X connect 33 0 30 2;
