diff --git a/pd/doc/5.reference/array-object-help.pd b/pd/doc/5.reference/array-object-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..35124428eafc56e72dd3ed05e2aa498d1ab4ced1 --- /dev/null +++ b/pd/doc/5.reference/array-object-help.pd @@ -0,0 +1,412 @@ +#N struct array-help-struct float x float y array z float; +#N struct float float y; +#N struct array-help-struct2 float x float y array z element-struct2 +; +#N struct element-struct2 float x float y float w; +#N canvas 309 129 694 542 12; +#X obj 208 496 list; +#X text 34 496 see also:; +#X text 485 171 (click for details:), f 11; +#N canvas 844 217 900 716 define 0; +#X text 295 562 creation arguments:; +#X text 325 597 optional name; +#X text 322 164 read from a file; +#X text 324 195 write to a file; +#X text 32 20 "array define" maintains an array and can name it so +that other objects can find it (and later should have some alternative +\, anonymous way to be found).; +#X text 324 614 optional size (100 by default); +#X msg 35 138 const 0; +#X text 325 138 set to a constant (0 \, for instance); +#X msg 45 167 read array-object-help.txt; +#X msg 45 194 write array-object-help.txt; +#X obj 36 596 array define array-help-1; +#X msg 45 224 resize 100; +#X text 71 255 ... other messages are also forwarded to the array like +those above - xticks \, etc \, and also lists to set values.; +#X obj 154 412 r array-help-send; +#X text 221 313 send a pointer to a named receive object; +#X floatatom 154 460 5 0 0 0 - - -, f 5; +#X obj 364 407 r array-help-send; +#X floatatom 364 481 5 0 0 0 - - -, f 5; +#X text 46 570 click to open or edit array:; +#X obj 364 431 t b p; +#X obj 154 436 getsize float-array z; +#X obj 364 456 array size -s float-array z; +#X text 109 349 The pointer will be to a structure float-array and +the array itself will be the field named 'z' \, so that you can access +it as shown in these examples:; +#X obj 38 659 array define -k array-help-2 10; +#A 0 -0.320006 0 0 0 0.973333 0 0 0 0 0; +#X msg 49 313 send array-help-send; +#X text 323 580 optional -k flag to keep contents; +#X connect 6 0 10 0; +#X connect 8 0 10 0; +#X connect 9 0 10 0; +#X connect 11 0 10 0; +#X connect 13 0 20 0; +#X connect 16 0 19 0; +#X connect 19 0 21 0; +#X connect 19 1 21 1; +#X connect 20 0 15 0; +#X connect 21 0 17 0; +#X connect 24 0 10 0; +#X restore 486 212 pd define; +#X obj 112 496 text; +#X obj 90 236 array size; +#N canvas 0 50 600 400 (subpatch) 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X coords 0 1 99 -1 500 300 1; +#X restore 50 50 graph; +#X restore 18 6 array; +#X text 193 210 - create \, store \, and/or edit one; +#X text 193 237 - get or change size; +#X text 194 261 - sum all or a range of elements; +#N canvas 624 95 689 679 array-and-data-structures 0; +#X obj 98 247 pointer; +#N canvas 804 396 504 278 array-help-struct 0; +#X scalar array-help-struct 20 20 \; 0 \; 0 \; -1 \; -6 \; -9 \; -10 +\; -5 \; -2 \; 8 \; 12 \; 12 \; 12 \; 10 \; 8 \; 6 \; 1 \; \;; +#X obj 88 204 pointer; +#X msg 32 156 20 20; +#X obj 31 231 append array-help-struct x y; +#X msg 88 147 traverse pd-array-help-struct \, bang, f 21; +#X obj 13 83 filledpolygon 0 0 0 0 0 0 10 20 10 20 0 0 0; +#X obj 13 56 struct array-help-struct float x float y array z float +; +#X obj 17 114 plot z 500 2 25 5 5; +#X connect 1 0 3 2; +#X connect 2 0 3 0; +#X connect 4 0 1 0; +#X restore 289 159 pd array-help-struct; +#N canvas 1207 234 450 300 array-help-data 0; +#X scalar array-help-struct 84 93 \; 0 \; 0 \; -1 \; -6 \; -9 \; -10 +\; -5 \; -2 \; 5 \; -7 \; -41 \; -47 \; -45 \; -34 \; -17 \; 8 \; 5 +\; 2 \; -2 \; -11 \; -16 \; -26 \; -43 \; 16 \; 24 \; 26 \; 21 \; 20 +\; 19 \; 17 \; 16 \; 16 \; 16 \; 16 \; 12 \; \;; +#X text 26 215 We have one datum... right-click to see contents.; +#X restore 290 189 pd array-help-data; +#X msg 98 190 traverse pd-array-help-data \, next, f 19; +#X obj 61 139 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 61 161 t b b; +#X obj 61 286 array sum -s array-help-struct z, f 19; +#X floatatom 61 327 5 0 0 0 - - -, f 5; +#X text 449 190 <- the array; +#X text 460 161 <- the structure; +#X text 56 21 The array objects can also reference arrays within structures +via pointers. The "-s" flag takes two arguments \, specifying the data +structure and the field within it that will contain the array. By default +the array should be a simple floating point array (use hte template +"float" for the array elements) but you can override that using "-f" +as shown further down.; +#X obj 115 549 pointer; +#X obj 78 441 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 78 463 t b b; +#X floatatom 78 629 5 0 0 0 - - -, f 5; +#X text 466 518 <- the array; +#N canvas 1063 375 447 373 array-help-struct2 0; +#X obj 95 252 pointer; +#X msg 39 204 20 20; +#X obj 13 94 filledpolygon 0 0 0 0 0 0 10 20 10 20 0 0 0; +#X obj 13 56 struct array-help-struct2 float x float y array z element-struct2 +; +#X msg 95 195 traverse pd-array-help-struct2 \, bang, f 22; +#X obj 38 279 append array-help-struct2 x y; +#X obj 16 120 plot z 500 2 25 5; +#X connect 0 0 5 2; +#X connect 1 0 5 0; +#X connect 4 0 0 0; +#X restore 306 461 pd array-help-struct2; +#N canvas 1028 171 477 318 array-help-data2 0; +#X scalar array-help-struct2 80 30 \; -54 200 10 \; 138 -10 3 \; -32 +26 0 \; 109 141 8 \; 272 19 0 \; \;; +#X text 31 267 A structure whose array has (x \, y \, w) triples - +right-click to see contents., f 40; +#X restore 307 517 pd array-help-data2; +#X msg 115 492 traverse pd-array-help-data2 \, next, f 20; +#X text 484 461 <- main structure, f 30; +#X text 484 486 <- element structure, f 30; +#N canvas 1103 205 413 178 element-struct2 0; +#X obj 13 56 struct element-struct2 float x float y float w; +#X restore 306 486 pd element-struct2; +#X obj 78 588 array sum -s array-help-struct2 z -f element-struct2 +w, f 33; +#X text 58 366 Using an additional '-f' flag we can specify which field +in the array we're referring to. In this example the array has (x \, +y \, w) triples (struct element-struct2) and we're asking for the "w" +field using the "-f" flag and its two arguments.; +#X text 128 629 sum of all the 'w' values in the array; +#X text 225 267 when "-s" is given this inlet takes a pointer in place +of a name., f 35; +#X connect 0 0 6 2; +#X connect 3 0 0 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 5 1 3 0; +#X connect 6 0 7 0; +#X connect 11 0 22 2; +#X connect 12 0 13 0; +#X connect 13 0 22 0; +#X connect 13 1 18 0; +#X connect 18 0 11 0; +#X connect 22 0 14 0; +#X restore 87 456 pd array-and-data-structures; +#N canvas 771 174 751 261 size 0; +#X floatatom 26 95 5 1 100 0 - - -, f 5; +#X obj 25 200 print; +#X text 45 19 "array size" outputs the size (if sent a bang) or sets +the size (if sent a number).; +#X obj 25 171 array size array-help-2; +#X obj 35 122 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 226 169 creations arguments: either array name or "-s" and +optional "-f" flags to refer to an array in a data structure; +#X msg 249 137 symbol array-help-2; +#X text 414 110 inlet to set name or pointer; +#X text 74 94 number to set size; +#X text 59 121 bang outputs size; +#X msg 248 113 symbol array-help-1; +#X connect 0 0 3 0; +#X connect 3 0 1 0; +#X connect 4 0 3 0; +#X connect 6 0 3 1; +#X connect 10 0 3 1; +#X restore 486 236 pd size; +#X obj 90 212 array define; +#X text 84 432 accessing arrays inside data structures:; +#X text 65 6 - accessing arrays; +#X text 50 43 In Pd an array may be part of a "garray" (a graphical +array of numbers) or appear as a slot in a data structure (in which +case the elements may be arbitrary data \, not necessarily just numbers). +The "array" object can define an array (so far just of numbers but +maybe later arbitrary data structures) or access an array defined elsewhere +to get or change its size \, set or read its elements \, and so on. +; +#X text 93 183 The first argument sets its function:; +#X obj 153 496 scalar; +#X obj 90 260 array sum; +#X obj 90 332 array quantile; +#N canvas 791 201 776 362 sum 0; +#X floatatom 74 135 5 0 10 0 - - -, f 5; +#X obj 65 114 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X floatatom 65 268 5 0 0 0 - - -, f 5; +#X floatatom 111 162 5 -1 10 0 - - -, f 5; +#X text 45 19 "array sum" outputs the sum of all or a selected range +of elements of the array.; +#X obj 65 223 array sum array-help-2, f 12; +#X text 183 262 - optional number to initialize onset - default 0; +#X text 183 281 - optional number to initialize number of points - +default -1, f 61; +#X text 91 112 bang to output sum; +#X text 184 226 creation arguments: either array name or "-s" and optional +"-f" flags to refer to an array in a data structure; +#X text 124 131 onset (first index to sum from) \, zero for start of +array; +#X text 159 157 number of points or -1 for end of array; +#X text 65 328 (array-help-2 is defined in the "define" subwindow). +; +#X msg 158 189 symbol array-help-2; +#X text 322 188 set name or pointer; +#X connect 0 0 5 0; +#X connect 1 0 5 0; +#X connect 3 0 5 1; +#X connect 5 0 2 0; +#X connect 13 0 5 2; +#X restore 486 260 pd sum; +#X obj 90 284 array get; +#N canvas 342 597 805 335 get 0; +#X floatatom 135 103 5 0 10 0 - - -, f 5; +#X obj 118 78 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X floatatom 165 126 5 -1 10 0 - - -, f 5; +#X obj 119 185 array get array-help-2, f 12; +#X obj 119 226 print; +#X text 45 19 "array get" outputs all or a selected range of elements +of the array as a list.; +#X text 276 238 - optional number to initialize onset - default 0; +#X text 275 257 - optional number to initialize number of points - +default -1, f 61; +#X text 280 201 creation arguments: either array name or "-s" and optional +"-f" flags to refer to an array in a data structure; +#X text 212 128 number of points or -1 for end of array; +#X text 140 78 bang for output; +#X text 65 298 (array-help-2 is defined in the "define" subwindow). +; +#X msg 212 155 symbol array-help-2; +#X text 376 154 set name or pointer; +#X text 181 102 onset (first index to output) \, zero for start of +array; +#X connect 0 0 3 0; +#X connect 1 0 3 0; +#X connect 2 0 3 1; +#X connect 3 0 4 0; +#X connect 12 0 3 2; +#X restore 486 284 pd get; +#X obj 90 308 array set; +#N canvas 525 369 752 328 set 0; +#X obj 119 203 array set array-help-2, f 12; +#X msg 119 117 0.1 0.2 0.3 0.4 0.3 0.2 0.1; +#X text 45 19 "array set" sets values of an array from an incoming +list \, starting from a specified onset (0 by default). The size of +the array is not changed -- values that would be written past the end +of the array are dropped.; +#X floatatom 165 143 5 0 0 0 - - -, f 5; +#X text 215 141 onset (first index to write to); +#X text 252 244 - optional number to initialize onset - default 0; +#X text 256 207 creation arguments: either array name or "-s" and optional +"-f" flags to refer to an array in a data structure; +#X text 349 118 list of values to write to array; +#X text 56 265 (array-help-2 is defined in the "define" subwindow). +; +#X msg 212 170 symbol array-help-2; +#X text 376 169 set name or pointer; +#X connect 1 0 0 0; +#X connect 3 0 0 1; +#X connect 9 0 0 2; +#X restore 486 308 pd set; +#X text 194 285 - get contents as a list; +#X text 194 309 - set contents from a list; +#X text 212 333 - get a quantile; +#X obj 90 356 array random; +#N canvas 102 243 816 629 quantile+random 0; +#X floatatom 75 177 5 0 100 0 - - -, f 5; +#X obj 39 251 array quantile array-help-3, f 14; +#N canvas 0 50 450 250 (subpatch) 0; +#X array array-help-3 100 float 3; +#A 0 0 0 0 0 0 0 0 0 0 0 0 0.00715053 0.00715053 0.0285789 0.0500072 +0.0714356 0.100007 0.128578 0.164292 0.207148 0.478574 0.628573 0.678572 +0.721429 0.717857 0.714286 0.707143 0.7 0.692857 0.685715 0.678572 +0.18572 0.164292 0.157149 0.0142931 -0.00713521 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.014293 0.0214357 0.0357213 0.078578 +0.142863 0.207148 0.335718 0.407146 0.435717 0.478574 0.514288 0.557144 +0.592858 0.642858 0.7 0.692857 0.692857 0.692857 0.692857 0.7 0.696429 +0.349997 0.335712 0.321426 0.278569 0.192856 0.149999 0.135714 0.114285 +0.0999998 0.0714298 0.0642871 0.0571443 0.0285732 0 0 0 0 0; +#X coords 0 1 99 0 200 140 1 0 0; +#X restore 37 375 graph; +#X floatatom 111 198 5 -1 100 0 - - -, f 5; +#X msg 43 524 \; array-help-3 const 0; +#X floatatom 39 131 5 -1 100 0 - - -, f 5; +#X obj 39 152 / 100; +#X floatatom 39 295 5 0 100 0 - - -, f 5; +#X floatatom 368 599 5 0 100 0 - - -, f 5; +#X obj 370 555 array random array-help-3, f 13; +#X obj 370 435 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X floatatom 383 484 5 0 0 0 - - -, f 5; +#X floatatom 420 507 5 0 0 0 - - -, f 5; +#X text 303 358 "array random" makes a pseudo-random numbver from 0 +to 1 and outputs its quantile (which will therefore have probabilities +proportional to the table's values.); +#X text 394 430 bang to generate a random value; +#X msg 377 456 seed 56; +#X text 445 456 set random seed; +#X text 170 286 - optional number to initialize onset - default 0; +#X text 169 305 - optional number to initialize number of points - +default -1, f 61; +#X text 494 569 same creation arguments; +#X text 174 249 creation arguments: either array name or "-s" and optional +"-f" flags to refer to an array in a data structure; +#X text 120 174 onset (first index to sum from) \, zero for start of +array; +#X text 160 196 number of points or -1 for end of array; +#X text 130 5 "array quantile" outputs the specified quantile of the +array - so for instance \, the 0.5 quantile is the median of the array. +This generalizes the "array random" function allowing you to use the +same source of randomness on several arrays \, for example. Negative +numbers in the array are silently replaced by zero. Quantiles outside +the range 0-1 output the x values at the two extremes of the array +(0 and 99 here).; +#X text 428 481 onset; +#X text 466 505 number of points; +#X text 88 130 quantile (between 0 and 1); +#X msg 149 218 symbol array-help-2; +#X text 313 217 set name or pointer; +#X msg 471 529 symbol array-help-2; +#X text 635 528 set name or pointer; +#X connect 0 0 1 1; +#X connect 1 0 7 0; +#X connect 3 0 1 2; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 9 0 8 0; +#X connect 10 0 9 0; +#X connect 11 0 9 0; +#X connect 12 0 9 1; +#X connect 15 0 9 0; +#X connect 27 0 1 3; +#X connect 29 0 9 2; +#X restore 485 346 pd quantile+random; +#X text 195 356 - random - array as probabilities; +#X text 444 471 updated for Pd version 0.45; +#X obj 90 379 array max; +#N canvas 727 168 744 595 min+max 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array array-help-4 100 float 3; +#A 0 0.335714 0.37857 0.421427 0.442855 0.478569 0.521426 0.535711 +0.55714 0.585711 0.599997 0.614282 0.63571 0.649996 0.664282 0.671424 +0.699995 0.699995 0.714281 0.721424 0.707138 0.699995 0.692853 0.68571 +0.671424 0.649996 0.628568 0.599997 0.571425 0.514283 0.471426 0.414284 +0.385713 0.357142 0.328571 0.3 0.285714 0.271429 0.25 0.228572 0.214286 +0.207143 0.200001 0.185715 0.17143 0.164287 0.157144 0.150001 0.135716 +0.128573 0.12143 0.12143 0.114287 0.114287 0.114287 0.114287 0.114287 +0.12143 0.125001 0.128573 0.128573 0.135716 0.139287 0.142858 0.150001 +0.157144 0.157144 0.164287 0.17143 0.200001 0.214286 0.228572 0.235715 +0.242857 0.257143 0.271429 0.285714 0.307142 0.321428 0.335714 0.357142 +0.371427 0.385713 0.399999 0.407141 0.414284 0.421427 0.42857 0.435713 +0.442855 0.457141 0.460712 0.464284 0.471426 0.478569 0.485712 0.499998 +0.50714 0.514283 0.521426 0.528569; +#X coords 0 1 99 0 200 140 1 0 0; +#X restore 382 386 graph; +#X floatatom 55 275 7 0 100 0 - - -, f 7; +#X obj 57 136 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X floatatom 70 159 5 0 0 0 - - -, f 5; +#X floatatom 107 182 5 0 0 0 - - -, f 5; +#X text 179 264 - optional number to initialize onset - default 0; +#X text 178 283 - optional number to initialize number of points - +default -1, f 61; +#X text 173 229 creation arguments: either array name or "-s" and optional +"-f" flags to refer to an array in a data structure; +#X text 115 156 onset; +#X text 153 180 number of points; +#X msg 158 204 symbol array-help-2; +#X text 322 205 set name or pointer; +#X obj 57 230 array max array-help-4, f 13; +#X floatatom 123 275 5 0 100 0 - - -, f 5; +#X text 79 133 bang to find maximum; +#X text 130 5 "array max" and "array min" find the maximum and minimum +values in the array \, respectively. The first outlet is the value +and the second is the index (the x location where the value was found). +The search may be restricted to a sub-domain of the array by specifying +the "onset" and "number of points".; +#X floatatom 52 497 7 0 100 0 - - -, f 7; +#X obj 54 358 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X floatatom 67 381 5 0 0 0 - - -, f 5; +#X floatatom 104 404 5 0 0 0 - - -, f 5; +#X text 112 378 onset; +#X floatatom 120 497 5 0 100 0 - - -, f 5; +#X text 76 355 bang to find minimum; +#X text 153 402 number of points; +#X obj 54 452 array min array-help-4, f 13; +#X text 54 298 value; +#X text 118 299 index; +#X connect 2 0 12 0; +#X connect 3 0 12 0; +#X connect 4 0 12 1; +#X connect 10 0 12 2; +#X connect 12 0 1 0; +#X connect 12 1 13 0; +#X connect 17 0 24 0; +#X connect 18 0 24 0; +#X connect 19 0 24 1; +#X connect 24 0 16 0; +#X connect 24 1 21 0; +#X restore 480 392 pd min+max; +#X obj 90 402 array min; +#X text 194 403 - min - find lowest value; +#X text 193 384 - max - find highest value; diff --git a/pd/doc/5.reference/array-object-help.txt b/pd/doc/5.reference/array-object-help.txt new file mode 100644 index 0000000000000000000000000000000000000000..f7fe2464d1b1c0f97bab61b41acbd76952ee7248 --- /dev/null +++ b/pd/doc/5.reference/array-object-help.txt @@ -0,0 +1,100 @@ +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0.00666678 +0.060001 +0.173336 +0.540009 +-0.0266671 +-0.20667 +-0.406674 +-0.713345 +-0.833347 +-0.933349 +-1.04668 +-0.980017 +-0.800014 +-0.686678 +-0.526676 +-0.443341 +-0.360006 +-0.20667 +-0.140002 +-0.0733346 +-0.00666678 +0.060001 +0.173336 +0.313339 +0.400007 +0.433341 +0.39334 +0.293338 +0.18667 +0.0800014 +0.0400007 +0.060001 +0.0733346 +0.0933349 +0.113335 +0.126669 +0.100002 +0.0666678 +0.0400007 +0.0200003 +0.0200003 +-0.0400007 +-0.0266671 +-0.00666678 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 +0 diff --git a/pd/doc/5.reference/clone-help.pd b/pd/doc/5.reference/clone-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..0083278c46e7a75b893a0ec1ee1506d7223f12ff --- /dev/null +++ b/pd/doc/5.reference/clone-help.pd @@ -0,0 +1,76 @@ +#N canvas 155 58 847 810 12; +#X floatatom 218 329 5 36 144 0 - - -, f 5; +#X obj 218 350 t b f; +#X obj 218 374 f; +#X obj 218 398 + 1; +#X obj 218 422 mod 16; +#X obj 218 446 pack; +#X msg 327 422 next \$1; +#X floatatom 327 402 5 36 144 0 - - -, f 5; +#X floatatom 327 452 5 36 144 0 - - -, f 5; +#X msg 327 471 this \$1; +#X floatatom 326 499 5 36 144 0 - - -, f 5; +#X msg 326 518 set \$1; +#X msg 80 397 vis 5 1; +#X msg 79 425 vis 5 0; +#X floatatom 325 545 5 36 144 0 - - -, f 5; +#X msg 325 566 all \$1; +#X obj 178 662 ../3.audio.examples/output~; +#X text 597 749 updated for Pd version 0.47; +#X text 496 579 creation arguments:; +#X text 26 610 click to open ->; +#X text 14 632 (first copy only); +#X text 67 351 open or close copy number 5:, f 14; +#X text 276 326 A list beginning with a number dispatches the rest +of the list as a message, f 23; +#X text 403 392 "next" forwards a message to the next instance (incrementing +and repeating circularly)., f 33; +#X text 407 445 "this" forwards a message to the previous instance +sent to by "this" or "next", f 30; +#X text 391 500 "set" sets the "next"/"this" counter; +#X text 386 546 "all" broadcasts a message to all instances; +#X text 24 8 clone - make multiple copies of a patch; +#X text 20 170 clone's inlets and outlets correspond to those of the +contained patch \, and may be signal and/or control inlets and outlets. +(In this example there's one control inlet and one signal outlet). +You can click on the clone~ object to see the first of the created +instances., f 72; +#X obj 179 609 clone clone-subpatch 16; +#X text 30 734 note: for backward compatibility \, you can also invoke +this as "clone clone-subpatch 16" (for instance) \, swapping the abstraction +name and the mumber of voices.; +#X text 19 247 Signal inlets are copied to all the instances. Control +inlets forward messages as shown below. Signal outlets output the sum +of all instances' outputs \, and control outlets forward messages with +the number of the instance prepended to them., f 67; +#X text 418 605 optional "-s #" to set starting voice number \; optional +-x to avoid setting \$1 to voice number \; filename \; number of copies +\; optional arguments to copies; +#X text 21 36 clone creates any number of copies of a desired abstraction +(a patch loaded as an object in another patch). Within each copy \, +"\$1" is set to the instance number. (These count from 0 unless overridden +by the "-s" option in the creation arguments. You can avoid this behavior +using the "-x" option.), f 71; +#X text 23 129 You can pass additional arguments to the copies that +appear as \$2 and onward (or \$1 and onward with "-x" option)., f +71; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 1 1 5 1; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 2 1; +#X connect 4 0 5 0; +#X connect 5 0 29 0; +#X connect 6 0 29 0; +#X connect 7 0 6 0; +#X connect 8 0 9 0; +#X connect 9 0 29 0; +#X connect 10 0 11 0; +#X connect 11 0 29 0; +#X connect 12 0 29 0; +#X connect 13 0 29 0; +#X connect 14 0 15 0; +#X connect 15 0 29 0; +#X connect 29 0 16 0; +#X connect 29 0 16 1; diff --git a/pd/doc/5.reference/clone-subpatch.pd b/pd/doc/5.reference/clone-subpatch.pd new file mode 100644 index 0000000000000000000000000000000000000000..fc28d87d244f7d119a45fbf5520e152096f1bf47 --- /dev/null +++ b/pd/doc/5.reference/clone-subpatch.pd @@ -0,0 +1,38 @@ +#N canvas 647 320 470 387 10; +#X obj 112 74 inlet; +#X obj 112 171 osc~; +#X obj 112 224 outlet~; +#X obj 112 193 *~; +#X obj 257 195 *~; +#X obj 257 223 *~; +#X obj 257 167 line~; +#X obj 256 122 del 10; +#X obj 112 96 t f b; +#X obj 112 118 mtof; +#X obj 256 144 pack 0 4000; +#X obj 175 124 pack 1 10; +#X text 32 26 This is the subpatch for the clone help patch. It plays +tones at pitches sent to its inlet.; +#X obj 333 303 float \$1; +#X obj 333 281 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 333 325 print; +#X text 129 306 You can access the instance number within the patch: +, f 27; +#X connect 0 0 8 0; +#X connect 1 0 3 0; +#X connect 3 0 2 0; +#X connect 4 0 5 0; +#X connect 4 0 5 1; +#X connect 5 0 3 1; +#X connect 6 0 4 0; +#X connect 6 0 4 1; +#X connect 7 0 10 0; +#X connect 8 0 9 0; +#X connect 8 1 7 0; +#X connect 8 1 11 0; +#X connect 9 0 1 0; +#X connect 10 0 6 0; +#X connect 11 0 6 0; +#X connect 13 0 15 0; +#X connect 14 0 13 0; diff --git a/pd/doc/5.reference/text-object-help.pd b/pd/doc/5.reference/text-object-help.pd new file mode 100644 index 0000000000000000000000000000000000000000..d8ea606acaea839f894fd90d8b4494ea65a225f0 --- /dev/null +++ b/pd/doc/5.reference/text-object-help.pd @@ -0,0 +1,607 @@ +#N struct text-help-struct float x float y text z; +#N canvas 781 162 622 555 12; +#X obj 131 499 list; +#X obj 18 6 text; +#X text 25 498 see also:; +#N canvas 0 50 600 400 (subpatch) 0; +#N canvas 0 50 450 250 (subpatch) 0; +#X array table4 100 float 0; +#X coords 0 1 99 -1 500 300 1; +#X restore 50 50 graph; +#X restore 171 499 array; +#X obj 280 217 text define; +#X text 81 173 The text object's first argument sets its function: +, f 30; +#N canvas 636 69 631 661 define 0; +#X msg 39 141 clear; +#X msg 37 167 read text-object-help.txt; +#X msg 40 196 write text-object-help.txt; +#X text 32 20 "text define" maintains a text object and can name it +so that other objects can find it (and later should have some alternative +\, anonymous way to be found).; +#X text 61 376 click to open and edit text:; +#X text 296 364 creation arguments:; +#X text 324 382 optional -k flag to keep contents; +#X text 326 399 optional name; +#X text 77 263 (optionally you can read or write to/from a file interpreting +carriage returns as separators \; this should allow reading some text +file formats - like this:); +#X text 274 165 read from a file; +#X text 276 196 write to a file; +#X text 277 139 clear; +#X obj 48 228 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 38 491 t b p; +#X obj 38 540 text get -s text t; +#X msg 39 515 0; +#X obj 38 590 print; +#X obj 38 565 list trim; +#X text 204 499 machinery for printing out first line of text when +output as a pointer (by "bang" method above)., f 30; +#X text 69 222 bang to output a pointer to a scalar (struct) containing +the text, f 35; +#X obj 38 400 text define -k text-help-1; +#A set this is a message \; this is another 1 ... \;; +#X msg 149 326 write -c /tmp/test-cr.txt; +#X connect 0 0 20 0; +#X connect 1 0 20 0; +#X connect 2 0 20 0; +#X connect 12 0 20 0; +#X connect 13 0 15 0; +#X connect 13 1 14 3; +#X connect 14 0 17 0; +#X connect 15 0 14 0; +#X connect 17 0 16 0; +#X connect 20 0 13 0; +#X connect 21 0 20 0; +#X restore 392 217 pd define; +#X obj 280 240 text get; +#N canvas 885 156 859 566 get 0; +#X floatatom 47 115 5 0 5 0 - - -, f 5; +#X msg 47 84 0; +#X msg 123 84 2; +#X msg 83 84 1; +#X obj 47 275 print; +#X obj 148 300 print type; +#X msg 160 87 3; +#X msg 200 89 4; +#X text 242 298 "type" is 0 if terminated by a semicolon \, 1 if by +a comma \, or 2 if the line number was out of range.; +#X obj 72 533 text define -k text-help-get; +#A set; +#X obj 47 230 text get text-help-get, f 13; +#X floatatom 50 407 5 0 0 0 - - -, f 5; +#X msg 50 376 0; +#X msg 126 376 2; +#X msg 86 376 1; +#X obj 50 478 print; +#X msg 163 379 3; +#X msg 203 381 4; +#X obj 50 451 text get text-help-get 1; +#X text 165 217 arguments: name of the text object or "-s struct-name" +; +#X floatatom 462 410 5 0 0 0 - - -, f 5; +#X msg 462 379 0; +#X msg 538 379 2; +#X msg 498 379 1; +#X obj 462 461 print; +#X msg 575 382 3; +#X msg 615 384 4; +#X text 259 450 read field number 1 (zero for first field), f 23; +#X obj 461 434 text get text-help-get 1 3; +#X text 127 345 examples showing field selection:; +#X text 32 20 "text get" reads the nth line from the named text and +outputs it \, or optionally reads one or more specific fields (atoms) +from the line.; +#X text 101 115 spedcify line number (0 for first line); +#X floatatom 80 140 5 0 5 0 - - -, f 5; +#X floatatom 114 163 5 0 5 0 - - -, f 5; +#X text 162 162 specify number of fields (1 by default \, but ignored +if whole line), f 66; +#X text 680 434 read 3 fields starting at field 1, f 21; +#X text 128 139 starting field number (-1 \, the default \, gives the +whole line), f 61; +#X text 162 237 next optional arg to set starting field number (first +inlet -- none to specify whole line), f 63; +#X text 166 274 next optional arg to set inlet 2 (number of fields +\, defaults to one), f 68; +#X msg 148 186 symbol text-help-get; +#X text 321 186 find another text by name or pointer; +#X connect 0 0 10 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X connect 10 0 4 0; +#X connect 10 1 5 0; +#X connect 11 0 18 0; +#X connect 12 0 11 0; +#X connect 13 0 11 0; +#X connect 14 0 11 0; +#X connect 16 0 11 0; +#X connect 17 0 11 0; +#X connect 18 0 15 0; +#X connect 20 0 28 0; +#X connect 21 0 20 0; +#X connect 22 0 20 0; +#X connect 23 0 20 0; +#X connect 25 0 20 0; +#X connect 26 0 20 0; +#X connect 28 0 24 0; +#X connect 32 0 10 1; +#X connect 33 0 10 2; +#X connect 39 0 10 3; +#X restore 392 240 pd get; +#N canvas 226 212 807 554 text-and-data-structures 0; +#X floatatom 65 196 5 0 0 0 - - -, f 5; +#X msg 65 165 0; +#X msg 140 165 2; +#X msg 100 165 1; +#X obj 65 387 print; +#X obj 206 391 print type; +#X obj 206 315 pointer; +#X obj 65 347 text get -s text-help-struct z, f 18; +#N canvas 807 416 450 300 text-help-struct 0; +#X scalar text-help-struct 20 20 \; a b c d \;; +#X obj 79 230 pointer; +#X msg 79 172 traverse pd-text-help-struct \, bang, f 21; +#X obj 22 257 append text-help-struct x y; +#X msg 23 172 20 20; +#X obj 13 56 struct text-help-struct float x float y text z; +#X obj 13 83 filledpolygon 0 0 0 0 0 0 10 10 10 10 0 0 0; +#X obj 15 120 drawtext z 16 -3 0; +#X connect 1 0 3 2; +#X connect 2 0 1 0; +#X connect 4 0 3 0; +#X restore 208 136 pd text-help-struct; +#X obj 65 218 t f b; +#X text 58 35 a simple example showing how to access text in data structures +via pointers.; +#N canvas 851 144 450 300 text-help-data 0; +#X scalar text-help-struct 20 20 \; 1 2 3 \\\; a b c d \\\; \;; +#X text 13 86 We have one datum (above) whose "z" field is text.; +#X restore 209 108 pd text-help-data; +#X msg 205 258 traverse pd-text-help-data \, next, f 18; +#X text 88 466 bug - saving multi-line texts inside structures; +#X obj 586 333 pointer; +#X msg 585 276 traverse pd-text-help-data \, next, f 18; +#X obj 445 365 text set -s text-help-struct z, f 18; +#X obj 445 236 t l b; +#X floatatom 492 337 5 0 0 0 - - -, f 5; +#X msg 478 292 0; +#X msg 553 292 2; +#X msg 513 292 1; +#X msg 443 158 1 2 3; +#X msg 454 194 list a b c d; +#X connect 0 0 9 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 6 0 7 3; +#X connect 7 0 4 0; +#X connect 7 1 5 0; +#X connect 9 0 7 0; +#X connect 9 1 12 0; +#X connect 12 0 6 0; +#X connect 14 0 16 3; +#X connect 15 0 14 0; +#X connect 17 0 16 0; +#X connect 17 1 15 0; +#X connect 18 0 16 1; +#X connect 19 0 18 0; +#X connect 20 0 18 0; +#X connect 21 0 18 0; +#X connect 22 0 17 0; +#X connect 23 0 17 0; +#X restore 83 459 pd text-and-data-structures; +#X text 73 435 here's how to access texts inside data structures:; +#X text 63 6 - manage a list of messages; +#X obj 219 499 scalar; +#X obj 280 312 text size; +#N canvas 847 155 741 313 size 0; +#X obj 71 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 68 257 text define -k text-help-size; +#A set; +#X obj 71 179 text size text-help-size; +#X floatatom 71 204 5 0 0 0 - - -, f 5; +#X floatatom 80 91 5 0 2 0 - - -, f 5; +#X text 46 11 "text size" reports the number of lines in the text or +the length of a specified line.; +#X text 100 52 bang for number of lines; +#X text 129 89 float for length of nth line (-1 if line number out +of range); +#X text 443 122 find another text by name or pointer, f 18; +#X msg 260 126 symbol text-help-size; +#X text 281 176 arguments: name of the text object or "-s struct-name" +, f 30; +#X connect 0 0 2 0; +#X connect 2 0 3 0; +#X connect 4 0 2 0; +#X connect 9 0 2 1; +#X restore 392 311 pd size; +#X obj 280 264 text set; +#N canvas 483 595 834 537 set 0; +#X floatatom 107 197 5 0 0 0 - - -, f 5; +#X msg 107 163 0; +#X msg 180 165 2; +#X msg 140 165 1; +#X msg 62 111 list x y z w; +#X msg 68 137 1 2 3; +#X msg 53 84 12 23 34 45 56 56; +#X obj 48 505 text define -k text-help-3; +#A set 12 23 34 45 56 56 \; x y z w \; 1 2 3 \;; +#X obj 55 293 text set text-help-3; +#X msg 223 165 1e+06; +#X floatatom 159 219 5 0 0 0 - - -, f 5; +#X text 211 85 list to write into the text; +#X text 165 197 line number - use a large number to append a line; +#X text 240 295 arguments: name of the text object or "-s struct-name" +; +#X text 240 320 next optional arg to set inlet 1 (line number); +#X text 66 407 if inlet 2 is supplied to specify a starting field \, +the line is not resized - instead \, as many items are replaced as +were in the list at left. Otherwise \, the line is resized to the size +of the list.; +#X msg 212 260 symbol text-help-get; +#X text 385 260 find another text by name or pointer; +#X text 206 218 field number - if 0 or positive \, replace text starting +at this field \, or if negative (or not supplied) \, replace whole +line., f 62; +#X text 288 506 <-- click here to see text; +#X text 46 9 "text set" replaces the nth line with the incoming list. +If the number n is greater than the number of lines in the text the +new line is added.; +#X text 241 348 next optional arg to set inlet 2 (field number \, defaults +to whole line), f 47; +#X connect 0 0 8 1; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 4 0 8 0; +#X connect 5 0 8 0; +#X connect 6 0 8 0; +#X connect 9 0 0 0; +#X connect 10 0 8 2; +#X connect 16 0 8 3; +#X restore 392 263 pd set; +#X text 391 176 (click for details), f 11; +#X text 60 216 create \, store \, and/or edit; +#X text 91 239 read and output a line; +#X text 100 263 replace or add a line; +#X text 115 313 get number of lines; +#X text 62 50 In Pd a "text" refers to a list of atoms that can include +commas \, semicolons \, and dollar-sign constructs - anything that +can go in a message box or a patch (as a saved file). You can use them +to store a semicolon-separated list of lists \, or as messages to "execute" +as in a sequencer or message box.; +#X text 145 337 convert to list; +#X obj 280 335 text tolist; +#N canvas 842 231 590 379 tolist 0; +#X obj 86 99 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 48 13 "text tolist" outputs the entire contents as a list. +Semicolons \, commas \, and dollar signs are output as symbols (and +so \, if symbols like " \, " are encountered \, they're escaped with +backslashes).; +#X text 108 96 bang to output list; +#X obj 86 180 text tolist text-help-1; +#X obj 173 218 list prepend set; +#X obj 173 241 list trim; +#X msg 173 291 this is a message \\\; this is another 1 ... \\\;; +#X msg 187 265 set; +#X obj 87 218 print; +#X text 72 326 N.B.: text-help-1 is defined in 'pd define' subwindow. +; +#X text 370 122 find another text by name or pointer, f 18; +#X msg 267 124 symbol text-help-1, f 11; +#X text 280 172 arguments: name of the text object or "-s struct-name" +, f 30; +#X connect 0 0 3 0; +#X connect 3 0 4 0; +#X connect 3 0 8 0; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 7 0 6 0; +#X connect 11 0 3 1; +#X restore 392 335 pd tolist; +#X obj 280 359 text fromlist; +#N canvas 842 231 604 318 fromlist 0; +#X obj 81 202 text fromlist text-help-fromlist; +#X obj 114 263 text define text-help-fromlist; +#X text 46 21 "text fromlist" converts a list such as "text tolist" +would output and fills the text with it. Whatever the text had previously +contained is discarded.; +#X msg 81 115 list this is a message \\\; this is another 1 ... \\\; +; +#X text 135 241 click here to see contents; +#X msg 92 145 list 1 2 3; +#X text 437 157 find another text by name or pointer, f 18; +#X msg 334 159 symbol text-help-1, f 11; +#X text 121 92 set contents of text; +#X connect 3 0 0 0; +#X connect 5 0 0 0; +#X connect 7 0 0 1; +#X restore 392 359 pd fromlist; +#X text 131 361 convert from list; +#X text 218 384 search; +#X obj 280 383 text search; +#N canvas 626 77 1011 913 search 0; +#X floatatom 60 313 5 0 0 0 - - -, f 5; +#X text 385 232 find another text by name or pointer, f 18; +#X text 207 280 arguments: name of the text object or "-s struct-name" +, f 30; +#X text 46 11 "text search" outputs the line number of the line that +best matches a search key. By default it seeks a line whose leading +fields match the incoming list.; +#X obj 52 873 text define -k text-help-search; +#A set 1 2 3 dog \; 7 8 9 cat \; 4 5 3 dog \; 7 8 9 alligator \; random +line that won't match numbers \;; +#X obj 60 270 text search text-help-search, f 16; +#X msg 182 244 symbol text-help-search; +#X msg 60 77 1; +#X msg 60 101 2; +#X msg 60 125 4; +#X msg 69 188 4 5; +#X msg 69 211 4 13; +#X msg 60 149 7; +#X text 110 76 matches first line (number 0); +#X text 102 99 doesn't match first field of any line so -1; +#X text 113 210 fails on second field so no match; +#X text 211 314 ... then optional search fields. Each is a field number +(starting from 0) optionally preceeded by ">". ">=" \, "<" \, "<=" +\, or "near".; +#X text 98 150 if two lines match only the first is output (but see +below for finding best matches).; +#X msg 47 446 7 cat; +#X msg 47 470 7 alligator; +#X floatatom 47 574 5 0 0 0 - - -, f 5; +#X msg 47 494 7 dog; +#X obj 47 518 text search text-help-search 0 3, f 16; +#X floatatom 503 600 5 0 0 0 - - -, f 5; +#X obj 503 541 text search text-help-search 1, f 16; +#X msg 504 508 8 9; +#X msg 559 486 8 9 alligator; +#X msg 504 482 8; +#X msg 559 513 symbol line; +#X text 43 392 in this example we ask to match both field 0 and field +3 exactly. In field 3 we're testing symbols for equality., f 39; +#X text 401 382 If the search pattern (the incoming list) has more +fields than we have specified search fields \, extra search patterns +match succeeding fields starting from the last one give as an argument. +So for example if there are no arguments we look for matches to any +number of fields starting from the beginning of the line in the text. +; +#X floatatom 49 834 5 0 0 0 - - -, f 5; +#X obj 49 778 text search text-help-search > 0, f 16; +#X text 45 613 Match a line for which the search key is greater than +field zero of that line. The line getting closest to the key wins. +, f 41; +#X msg 49 671 2; +#X msg 49 713 4; +#X text 86 664 lines 1 \, 2 \, and 3 match \, but 2 wins because its +first field (4) is closest to the search key 2, f 48; +#X text 88 703 this matches lines 1 and 3 \, and each is equally good +\, so line 1 wins., f 43; +#X text 86 744 nobody's first field is greater than 10; +#X msg 49 745 10; +#X obj 507 809 text search text-help-search 2 near 0, f 18; +#X floatatom 507 866 5 0 0 0 - - -, f 5; +#X msg 507 685 3 3; +#X msg 507 714 3 2.5 1; +#X msg 507 775 3 3 1; +#X text 506 628 Hear we ask for field 2 to equal 3 and fields starting +at 0 to be 'near' the following arguments., f 33; +#X text 547 684 field 2 is 3 and field 0 nearest 3; +#X text 575 706 here lines 0 and 2 tie over 2.4 (1 and 4 are equally +far from it) so line 0 whose second field is closer to 1 wins., f +40; +#X text 560 766 Here line 2 wins because its field 0 is nearer to 3 +\, notwithstanding that its field 1 is farther from 1; +#X text 103 125 matches line number 2 (third line); +#X text 114 188 matches two fields of line number 2; +#X connect 5 0 0 0; +#X connect 6 0 5 1; +#X connect 7 0 5 0; +#X connect 8 0 5 0; +#X connect 9 0 5 0; +#X connect 10 0 5 0; +#X connect 11 0 5 0; +#X connect 12 0 5 0; +#X connect 18 0 22 0; +#X connect 19 0 22 0; +#X connect 21 0 22 0; +#X connect 22 0 20 0; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 26 0 24 0; +#X connect 27 0 24 0; +#X connect 28 0 24 0; +#X connect 32 0 31 0; +#X connect 34 0 32 0; +#X connect 35 0 32 0; +#X connect 39 0 32 0; +#X connect 40 0 41 0; +#X connect 42 0 40 0; +#X connect 43 0 40 0; +#X connect 44 0 40 0; +#X restore 393 383 pd search; +#X text 76 408 sequencer/message-sender; +#X obj 280 406 text sequence; +#N canvas 199 57 1155 839 sequence 0; +#X msg 138 468 symbol text-help-search; +#X text 101 443 specify another text by name or pointer; +#X msg 37 225 bang; +#X obj 37 693 print out1; +#X obj 138 695 print out2; +#X msg 46 415 args 1 2 fuzz; +#X msg 37 167 line 0; +#X obj 655 282 text sequence text-help-seq2 -g, f 17; +#X obj 889 300 text define -k text-help-seq2; +#A set test1 1 2 3 \; 1000 test2 6 7 8 \; test1 9 10 \, 21 22 23 \, +walk the dog \; 500 1500 test1 \; test2 13 14 \;; +#X msg 771 248 bang; +#X msg 655 248 line 0; +#X obj 334 748 print test1; +#X obj 334 721 r test1; +#X obj 431 720 r test2; +#X obj 431 747 print test2; +#X obj 749 329 print done; +#X obj 46 391 loadbang; +#X text 163 414 set values for \$1 \, \$2 \, etc; +#X msg 37 198 step; +#X text 81 198 output next line; +#X text 97 160 set current line number (counting from 0), f 23; +#X msg 820 248 auto; +#X msg 868 248 stop; +#X msg 37 263 auto; +#X text 79 219 output all lines starting from current one to next waiting +point, f 34; +#X text 43 718 lists; +#X text 133 718 bang if done; +#X text 162 527 -g to specify global mode (each line begins with a +symbolic destination), f 39; +#X text 164 562 -w <symbol> specifies that lines beginning with the +symbol are waiting points, f 43; +#X text 165 597 -w <number> specifies that every line's leading n atoms +are used as a waiting point, f 39; +#X obj 37 497 text sequence text-help-seq, f 13; +#X text 230 489 creation arguments:, f 30; +#X text 164 508 name of the text object or "-s struct-name"; +#X obj 58 764 text define -k text-help-seq; +#A set 1 2 3 \; 4 5 symbol 7 \; 8 \$1 \$2 \; 9 \$3 \$1-\$2-\$3 \;; +#X obj 653 328 print wait; +#X msg 37 327 stop; +#X text 84 328 stop the sequence; +#X text 30 10 "text sequence" outputs lines from a text buffer \, either +to an outlet \, or as messages to named destinations. The text is interpreted +as a sequence of lists \, and possibly some interspersed waiting instructions +(called "waits" here). You can ask for one line at a time ("step" message") +\, or to proceed without delay to the next wait ("bang") \, or to automatically +sequence through a series of waits (with each wait specifying a delay +in milliseconds); +#X text 78 255 automatically sequence \, interpreting waits as delay +times (but note there aren't any waits in this example - see at right) +, f 36; +#X text 653 228 rewind; +#X text 912 274 click to see the sequence:; +#X msg 723 248 step; +#X msg 761 448 bang; +#X msg 629 448 line 0; +#X obj 825 535 print done; +#X msg 816 448 auto; +#X msg 869 449 stop; +#X obj 726 535 print wait; +#X msg 704 448 step; +#X obj 885 496 text define -k text-help-seq3; +#A set 1 2 3 \; fred 1000 \; 4 5 6 \; blanch 7 8 \; fred 500 \; 9 10 +\;; +#X obj 629 482 text sequence text-help-seq3 -w fred, f 22; +#X obj 629 535 print out1; +#X text 624 365 Alternatively \, with the "-w" flag (with or without +"-g" but most usefully without) \, you can specify a symbol that tags +an entire line as a wait. Here the three outlets are for lists (regular +lines) \, waits \, and a bang at end of sequence:; +#X msg 760 718 bang; +#X msg 628 718 line 0; +#X msg 815 718 auto; +#X msg 868 719 stop; +#X msg 703 718 step; +#X text 934 472 sequence:; +#X text 962 746 sequence:; +#X obj 884 766 text define -k text-help-seq4; +#A set 0 1 2 3 \; 1000 4 5 6 \; 500 7 8 9 \; 500 10 11 12 \;; +#X obj 628 752 text sequence text-help-seq4 -w 1, f 19; +#X obj 824 802 print done; +#X obj 725 802 print wait; +#X obj 628 802 print out1; +#X msg 37 356 tempo 1 msec; +#X obj 390 376 delay; +#X text 149 347 set tempo in msec \, sec \, min \, samples \, permin +\, etc. -- see 'delay' help for details...., f 28; +#X text 163 646 -t <tempo> <units> initializes tempo as with the "tempo" +message above., f 36; +#X msg 915 248 tempo 2 permsec; +#X text 937 226 set 2x tempo; +#X text 625 20 The -g flag (which must be given after specifying the +text with a name or a "-s" argument) specifies that the text contains +messages to send to global symbols. Lines beginning with symbols are +sent to the corresponding receive (or other named object). Leading +numbers are then interpreted as waits. If you use "bang" to sequence +the text the waits will be output as lists for you to interpret as +you wish. If you send an "auto" message \, waits that consist of a +single number are interpreted as delay times in milliseconds (but waits +with 2 or more arguments are treated as in "bang"). Here the two waits +are "1000" and "500 1500".; +#X text 623 576 If you want to use leading numbers in lists as waits +without having to specify "-g" \, specify "-w 3" for example and up +to 3 leading numbers (fewer if there's a symbol among the first 3 items) +will be taken as a wait. Waits specified this way can only have numeric +elements (while waits specified with a symbol tag as above could have +symbols too if desired.) Here we use "-w 1" so the "auto" feature can +simply sequence a list of numbers:; +#X connect 0 0 30 1; +#X connect 2 0 30 0; +#X connect 5 0 30 0; +#X connect 6 0 30 0; +#X connect 7 0 34 0; +#X connect 7 1 15 0; +#X connect 9 0 7 0; +#X connect 10 0 7 0; +#X connect 12 0 11 0; +#X connect 13 0 14 0; +#X connect 16 0 5 0; +#X connect 18 0 30 0; +#X connect 21 0 7 0; +#X connect 22 0 7 0; +#X connect 23 0 30 0; +#X connect 30 0 3 0; +#X connect 30 1 4 0; +#X connect 35 0 30 0; +#X connect 41 0 7 0; +#X connect 42 0 50 0; +#X connect 43 0 50 0; +#X connect 45 0 50 0; +#X connect 46 0 50 0; +#X connect 48 0 50 0; +#X connect 50 0 51 0; +#X connect 50 1 47 0; +#X connect 50 2 44 0; +#X connect 53 0 61 0; +#X connect 54 0 61 0; +#X connect 55 0 61 0; +#X connect 56 0 61 0; +#X connect 57 0 61 0; +#X connect 61 0 64 0; +#X connect 61 1 63 0; +#X connect 61 2 62 0; +#X connect 65 0 30 0; +#X connect 69 0 7 0; +#X restore 393 406 pd sequence; +#X text 365 497 updated for Pd version 0.47; +#X text 100 287 delete a line or clear; +#X obj 280 288 text delete; +#N canvas 1058 154 749 465 delete 0; +#X text 409 144 find another text by name or pointer; +#X text 319 257 <-- click here to see text; +#X obj 49 177 text delete text-help-delete; +#X text 295 180 argument: name of the text object or "-s struct-name" +; +#X msg 206 144 symbol text-help-delete; +#X obj 55 257 text define -k text-help-delete; +#A set line 0 \; line 1 \; line 2 \; line 3 \; line 4 \;; +#X msg 49 62 2; +#X msg 58 89 -1; +#X text 98 92 clear whole text; +#X obj 57 401 text fromlist text-help-delete; +#X msg 57 376 list line 0 \\\; line 1 \\\; line 2 \\\; line 3 \\\; +line 4 \\\;; +#X text 78 353 click below to get original text back:; +#X text 46 9 "text delete" deletes the nth line.; +#X text 88 62 delete line nyumber 2 (counting from 0); +#X connect 4 0 2 1; +#X connect 6 0 2 0; +#X connect 7 0 2 0; +#X connect 10 0 9 0; +#X restore 392 287 pd delete; diff --git a/pd/doc/5.reference/text-object-help.txt b/pd/doc/5.reference/text-object-help.txt new file mode 100644 index 0000000000000000000000000000000000000000..d373bb6dd98c53dc0607c57eca5980e873f72686 --- /dev/null +++ b/pd/doc/5.reference/text-object-help.txt @@ -0,0 +1,2 @@ +this is a message; +this is another 1 ...;