aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/H04.two.cosines.pd
diff options
context:
space:
mode:
Diffstat (limited to 'pd/doc/3.audio.examples/H04.two.cosines.pd')
-rw-r--r--pd/doc/3.audio.examples/H04.two.cosines.pd124
1 files changed, 124 insertions, 0 deletions
diff --git a/pd/doc/3.audio.examples/H04.two.cosines.pd b/pd/doc/3.audio.examples/H04.two.cosines.pd
new file mode 100644
index 00000000..0f813164
--- /dev/null
+++ b/pd/doc/3.audio.examples/H04.two.cosines.pd
@@ -0,0 +1,124 @@
+#N canvas 10 49 705 610 12;
+#X floatatom 262 549 0 0 0;
+#N canvas 176 241 532 273 output 0;
+#X obj 338 160 t b;
+#X obj 338 110 f;
+#X obj 338 60 inlet;
+#X text 344 29 mute;
+#X obj 338 185 f;
+#X msg 425 178 0;
+#X msg 338 85 bang;
+#X obj 338 135 moses 1;
+#X obj 398 111 moses 1;
+#X obj 83 148 dbtorms;
+#X obj 398 86 r master-lvl;
+#X obj 83 42 r master-lvl;
+#X obj 338 210 s master-lvl;
+#X obj 17 148 inlet~;
+#X obj 199 41 inlet;
+#X text 199 18 level;
+#X obj 199 100 s master-lvl;
+#X msg 96 65 set \$1;
+#X obj 96 89 outlet;
+#X msg 214 64 \; pd dsp 1;
+#X obj 83 194 line~;
+#X obj 22 212 *~;
+#X obj 22 241 dac~;
+#X obj 83 171 pack 0 50;
+#X text 15 125 audio;
+#X text 93 110 show level;
+#X obj 17 177 hip~ 1;
+#X connect 0 0 4 0;
+#X connect 1 0 7 0;
+#X connect 2 0 6 0;
+#X connect 4 0 12 0;
+#X connect 5 0 12 0;
+#X connect 6 0 1 0;
+#X connect 7 0 0 0;
+#X connect 7 1 5 0;
+#X connect 8 1 4 1;
+#X connect 9 0 23 0;
+#X connect 10 0 1 1;
+#X connect 10 0 8 0;
+#X connect 11 0 9 0;
+#X connect 11 0 17 0;
+#X connect 13 0 26 0;
+#X connect 14 0 16 0;
+#X connect 14 0 19 0;
+#X connect 17 0 18 0;
+#X connect 20 0 21 1;
+#X connect 21 0 22 0;
+#X connect 21 0 22 1;
+#X connect 23 0 20 0;
+#X connect 26 0 21 0;
+#X restore 226 576 pd output;
+#X msg 302 549 MUTE;
+#X msg 59 550 bang;
+#X obj 185 427 cos~;
+#X floatatom 232 217 4 0 0;
+#X obj 232 241 / 10;
+#X text 464 288 --- 0.02 seconds ---;
+#X obj 185 397 *~;
+#X text 236 133 center;
+#X obj 232 313 line~;
+#X obj 232 265 max 0;
+#X graph graph3 0 -2 881 2 450 276 650 136;
+#X array carrier 882 float 0;
+#X pop;
+#X floatatom 33 284 4 0 0;
+#X text 29 240 fundamental;
+#X text 31 2 ADDING TWO COSINES;
+#X text 234 152 freq. (in;
+#X text 233 171 tenths of;
+#X text 232 191 fundamental);
+#X text 29 259 frequency;
+#X obj 227 427 cos~;
+#X obj 268 340 wrap~;
+#X obj 232 367 -~;
+#X obj 227 397 +~;
+#X obj 232 464 -~;
+#X obj 247 494 *~;
+#X obj 225 519 +~;
+#X obj 59 578 tabwrite~ carrier;
+#X obj 33 308 phasor~ 40;
+#X obj 232 289 pack 0 50;
+#X text 27 36 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.7:;
+#X text 451 581 updated for Pd version 0.34;
+#X text 281 366 subtract to get the integer part "n";
+#X text 277 399 multiply phase by n and n+1;
+#X text 282 427 synthesize the two partials;
+#X text 54 526 graph;
+#X text 347 548 <--output;
+#X text 323 339 the fractional part "b";
+#X text 280 463 p2 - p1;
+#X text 295 492 b * (p2 - p1);
+#X text 264 519 b * p2 + (1-b) * p1;
+#X connect 0 0 1 1;
+#X connect 1 0 0 0;
+#X connect 2 0 1 2;
+#X connect 3 0 27 0;
+#X connect 4 0 24 1;
+#X connect 4 0 26 0;
+#X connect 5 0 6 0;
+#X connect 6 0 11 0;
+#X connect 8 0 4 0;
+#X connect 8 0 23 0;
+#X connect 10 0 22 0;
+#X connect 10 0 21 0;
+#X connect 11 0 29 0;
+#X connect 13 0 28 0;
+#X connect 20 0 24 0;
+#X connect 21 0 22 1;
+#X connect 21 0 25 1;
+#X connect 22 0 8 1;
+#X connect 23 0 20 0;
+#X connect 24 0 25 0;
+#X connect 25 0 26 1;
+#X connect 26 0 1 0;
+#X connect 26 0 27 0;
+#X connect 28 0 8 0;
+#X connect 28 0 23 1;
+#X connect 29 0 10 0;