aboutsummaryrefslogtreecommitdiff
path: root/doc/pddp/until-help.pd
blob: 59d8652aa408ebe64a0099146c86e65113e95b72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#N canvas 272 105 879 604 10;
#X obj 13 49 until;
#X text 7 78 Every modern programming language will have various "looping"
mechanisms: either in the form of an object \, or as a data structure.
For example in Visual Basic:;
#X text 18 145 DO UNTIL i = 100;
#X text 18 159 i = i + 1;
#X text 19 130 i = 0;
#X text 18 174 LOOP;
#X text 3 285 And now Pd's version of the above programming structures:
;
#X obj 12 332 until;
#X msg 12 312 100;
#X obj 12 352 print i;
#X text 5 379 If you start [until] with a "bang" \, it will begin an
infinite loop! Please plan ahead in this case so that there is a mechanism
in place to stop the loop - otherwise Pd will effectively freeze.;
#X text 5 446 HOW TO FREEZE Pd;
#X msg 13 469 bang;
#X obj 13 489 until;
#X obj 13 509 print;
#X text 51 469 DO NOT CLICK. DO NOT CLICK. DO NOT CLICK.;
#X text 5 200 OR:;
#X text 17 226 FOR i = 0 TO 100;
#X text 16 252 NEXT;
#X text 17 240 ' do something;
#X text 439 240 If you start [until] with a number \, it iterates that
number of times. The [uzi] object in MAX works the same way.;
#X obj 496 328 until;
#X msg 496 281 100;
#X obj 496 348 print i;
#X msg 524 288 3;
#X msg 552 295 42;
#X text 14 536 The [until] object's left inlet starts a loop in which
it outputs "bang" until its right inlet gets a "bang" which stops it.
;
#X obj 418 44 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 418 571 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X text 55 49 - LOOPing mechanism;
#X text 441 381 RELATED OBJECTS;
#X text 446 400 ?? This author does not know of any other native looping
mechanisms in Pd.;
#N canvas 0 22 452 302 related_objects_from_other_libraries 0;
#X text 27 63 These objects are offered in Pd only if you have downloaded
and properly installed the appropriate library. These objects may or
may not exist in a single library.;
#X text 26 112 The best places to find information about Pd's libraries
is:;
#X text 23 134 www.puredata.org and click on "Downloads" then "Software"
;
#X text 25 149 or;
#X text 25 164 iem.kug.ac.at/pdb/;
#X obj 43 32 for++;
#X obj 90 32 counter;
#X obj 150 32 gem_counter;
#X obj 250 32 modulo_counter;
#X restore 454 440 pd related_objects_from_other_libraries;
#X obj 486 513 pddp_open all_about_looping;
#X text 450 490 For more info:;
#X msg 496 110 bang;
#X obj 496 131 until;
#X text 527 110 start;
#X obj 496 153 f;
#X obj 525 153 + 1;
#X obj 571 155 sel 0;
#X obj 496 197 print;
#X obj 525 175 mod 10;
#X text 444 58 The example below includes a method to stop the loop
to prevent Pd from looping infinitely.;
#X text 54 489 If you click \, kill Pd or reboot the computer.;
#X text 447 546 This document was updated for Pd version 0.35 test
26 by Dave Sabine as part of a project called pddp proposed by Krzysztof
Czaja to build comprehensive documentation for Pd.;
#X obj 2 2 cnv 15 870 20 empty empty [until] 20 10 1 18 -233017 -66577
0;
#X obj 821 3 pddp;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X connect 21 0 23 0;
#X connect 22 0 21 0;
#X connect 24 0 21 0;
#X connect 25 0 21 0;
#X connect 27 0 28 0;
#X connect 35 0 36 0;
#X connect 36 0 38 0;
#X connect 38 0 39 0;
#X connect 38 0 41 0;
#X connect 39 0 42 0;
#X connect 40 0 36 1;
#X connect 42 0 38 1;
#X connect 42 0 40 0;