From 4d84d14ac1aa13958eaa2971b03f7f929a519105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 8 Feb 2008 13:00:32 +0000 Subject: reorganized svn path=/trunk/; revision=9400 --- desiredata/doc/3.audio.examples/F08.two.cosines.pd | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 desiredata/doc/3.audio.examples/F08.two.cosines.pd (limited to 'desiredata/doc/3.audio.examples/F08.two.cosines.pd') diff --git a/desiredata/doc/3.audio.examples/F08.two.cosines.pd b/desiredata/doc/3.audio.examples/F08.two.cosines.pd new file mode 100644 index 00000000..ae4788f6 --- /dev/null +++ b/desiredata/doc/3.audio.examples/F08.two.cosines.pd @@ -0,0 +1,70 @@ +#N canvas 534 115 698 613 12; +#X obj 157 408 cos~; +#X floatatom 204 198 4 0 100 0 - - -; +#X obj 204 222 / 10; +#X text 461 275 --- 0.02 seconds ---; +#X obj 157 378 *~; +#X obj 204 294 line~; +#X obj 204 246 max 0; +#N canvas 0 0 450 300 graph3 0; +#X array F08-carrier 882 float 0; +#X coords 0 2 881 -2 200 140 1; +#X restore 447 123 graph; +#X floatatom 57 295 4 0 0 0 - - -; +#X text 53 251 fundamental; +#X text 53 270 frequency; +#X obj 199 408 cos~; +#X obj 240 321 wrap~; +#X obj 204 348 -~; +#X obj 199 378 +~; +#X obj 204 445 -~; +#X obj 219 475 *~; +#X obj 197 500 +~; +#X obj 204 270 pack 0 50; +#X text 254 408 synthesize the two partials; +#X text 447 590 updated for Pd version 0.37; +#X obj 198 526 hip~; +#X obj 199 552 output~; +#X text 26 29 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:; +#X obj 286 552 tabwrite~ F08-carrier; +#X text 316 528 <-graph; +#X obj 284 527 bng 18 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 57 319 phasor~ 100; +#X text 83 149 center frequency (in; +#X text 82 169 tenths of fundamental); +#X text 125 3 MOVABLE CENTER FREQUENCY BY ADDING TWO COSINES; +#X text 295 320 the fractional part "q"; +#X text 253 347 subtract to get the integer part "k"; +#X text 249 380 multiply phase by k and k+1; +#X text 252 444 c2 - c1; +#X text 267 473 q * (c2 - c1); +#X text 236 500 q * c2 + (1-q) * c1; +#X connect 0 0 15 1; +#X connect 0 0 17 0; +#X connect 1 0 2 0; +#X connect 2 0 6 0; +#X connect 4 0 0 0; +#X connect 4 0 14 0; +#X connect 5 0 13 0; +#X connect 5 0 12 0; +#X connect 6 0 18 0; +#X connect 8 0 27 0; +#X connect 11 0 15 0; +#X connect 12 0 13 1; +#X connect 12 0 16 1; +#X connect 13 0 4 1; +#X connect 14 0 11 0; +#X connect 15 0 16 0; +#X connect 16 0 17 1; +#X connect 17 0 21 0; +#X connect 17 0 24 0; +#X connect 18 0 5 0; +#X connect 21 0 22 0; +#X connect 21 0 22 1; +#X connect 26 0 24 0; +#X connect 27 0 4 0; +#X connect 27 0 14 1; -- cgit v1.2.1