From 7686b96d2119d2d70b329a02a8af52792ca2d9f1 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 27 May 2004 16:53:47 +0000 Subject: added a number of sketches for the help structure; most are not close to completion svn path=/trunk/; revision=1770 --- doc/pddp/all_about_looping.pd | 109 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 doc/pddp/all_about_looping.pd (limited to 'doc/pddp/all_about_looping.pd') diff --git a/doc/pddp/all_about_looping.pd b/doc/pddp/all_about_looping.pd new file mode 100644 index 00000000..75668aaa --- /dev/null +++ b/doc/pddp/all_about_looping.pd @@ -0,0 +1,109 @@ +#N canvas 255 95 856 623 10; +#X text 460 79 looping objects:; +#X obj 462 101 until; +#X obj 572 102 loop; +#X obj 458 504 susloop~; +#X obj 527 504 loop~; +#X text 455 483 for looping samples:; +#X obj 0 2 cnv 15 850 20 empty empty all_about_looping 20 10 1 18 -233017 +-66577 0; +#X obj 816 3 pddp; +#X obj 461 127 counter; +#X obj 519 127 gem_counter; +#X obj 604 127 cxc.counter; +#X obj 463 551 pdp_loop; +#X obj 534 551 pdp_qtloop~; +#X obj 572 504 loopsampler; +#X text 480 395 examples:; +#X obj 480 424 test-loop~; +#X obj 695 126 for++; +#X obj 60 167 +; +#X floatatom 89 170 5 0 0 0 - - -; +#X msg 59 138 1; +#X obj 139 186 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 98 138 0; +#X obj 60 209 t f f; +#X text 214 302 X; +#X text 76 306 Y; +#X obj 60 289 t b f; +#N canvas 0 22 450 300 graph2 0; +#X array \$0-array 100 float 1; +#A 0 0 0.950467 0.973181 0.989041 0.997937 0.999806 0.994635 0.982459 +0.963366 0.937489 0.905011 0.866159 0.821209 0.770476 0.714317 0.653128 +0.587341 0.517417 0.44385 0.367158 0.28788 0.206575 0.123815 0.040184 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 0.000796274 +0.000796274 0.000796274 0.000796274 0.000796274; +#X coords 0 1 99 -1 300 100 1; +#X restore 82 405 graph; +#X obj 90 314 tabwrite \$0-array; +#X obj 60 186 moses 100; +#X obj 59 111 bng 20 250 50 0 empty empty start 0 -6 1 10 -4033 -1 +-1; +#X text 136 166 <-- counter; +#X text 158 186 <-- split at array size to stop; +#X text 186 199 and reset counter to 0; +#X text 57 336 ^--bang for next step; +#X obj 39 198 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 422 36 inf; +#X obj 60 249 expr abs(cos( min (1.57 \, ($f1 / $f2 - 0.4)) ) ); +#X obj 263 227 hsl 128 15 1 127 0 1 empty empty change_graph_shape +-130 8 1 12 -208896 -1 -1 1100 0; +#X text 7 29 Programming with Pd is a different way of thinking that +standard procedural or object-oriented programming. Looping illustrates +this. Instead of setting up a C-like [counter] or [for++] \, set up +a condition to continue the loop \, and a condition that ends the loop. +; +#X text 13 362 In this example \, the "bang" from [t b f] continues +the loop. The [moses 100] ends the loop.; +#X text 17 601 by Hans-Christoph Steiner ; +#X text 629 603 updated for Pd version 0.37.1; +#X text 125 138 <-- stop; +#X text 451 466 There are also specific loops for samples and video: +; +#X text 458 530 video looping:; +#X obj 660 504 xgroove~; +#X obj 619 353 readsf~; +#X obj 431 338 bng 15 250 50 0 empty empty play_sound 17 7 0 10 -4033 +-1 -1; +#X obj 619 328 spigot; +#X obj 656 306 tgl 15 0 empty empty allow_looping 17 7 0 10 -4033 -1 +-1 0 1; +#X text 429 271 For the most basic looping of samples \, you can use +[readsf~]:; +#X msg 430 307 open ../sound/voice.wav; +#X text 664 373 ^- "bang"ed when complete; +#X connect 17 0 18 0; +#X connect 17 0 28 0; +#X connect 18 0 17 1; +#X connect 19 0 17 0; +#X connect 20 0 21 0; +#X connect 21 0 18 0; +#X connect 21 0 17 1; +#X connect 22 0 36 0; +#X connect 22 1 27 1; +#X connect 25 0 34 0; +#X connect 25 1 27 0; +#X connect 28 0 22 0; +#X connect 28 1 20 0; +#X connect 29 0 19 0; +#X connect 34 0 19 0; +#X connect 36 0 25 0; +#X connect 37 0 36 1; +#X connect 46 1 48 0; +#X connect 47 0 46 0; +#X connect 48 0 46 0; +#X connect 49 0 48 1; +#X connect 51 0 46 0; -- cgit v1.2.1