From 819bc4309313e32809dff7cfd99df930c5055082 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 28 Jul 2005 19:45:58 +0000 Subject: added in documentation of Pd oddities that I generated in response to the thread on pd-dev about Miller's new [list] object svn path=/trunk/; revision=3383 --- doc/pddp/all_about_data_types.pd | 186 ++++++++++++++++------ doc/pddp/all_about_lists_vs_anythings.pd | 70 ++++----- doc/pddp/float-help.pd | 214 +++++++++++++++----------- doc/pddp/print-help.pd | 141 +++++++++++------ doc/pddp/route-help.pd | 254 +++++++++++++++++++++++-------- 5 files changed, 575 insertions(+), 290 deletions(-) (limited to 'doc') diff --git a/doc/pddp/all_about_data_types.pd b/doc/pddp/all_about_data_types.pd index 4f53fda1..b0293e88 100644 --- a/doc/pddp/all_about_data_types.pd +++ b/doc/pddp/all_about_data_types.pd @@ -1,5 +1,5 @@ -#N canvas 220 70 873 654 10; -#X obj 453 470 route; +#N canvas 246 35 862 651 10; +#X obj 453 446 route; #X floatatom 93 115 5 0 0 1 "float" - -; #X symbolatom 184 115 10 0 0 1 "symbol" - -; #X obj 96 211 symbol; @@ -12,7 +12,7 @@ #X floatatom 15 233 5 0 0 0 - - -; #X msg 20 212 12; #X msg 3 192 float 83; -#N canvas 770 126 486 336 Related_Objects 0; +#N canvas 770 126 490 340 Related_Objects 0; #X obj 32 54 ftos; #X obj 68 54 list2symbol; #X text 23 22 data type conversion; @@ -28,29 +28,28 @@ #X obj 158 159 symbol2list; #X obj 247 138 l2s; #X obj 247 158 s2l; -#X restore 433 581 pd Related_Objects; -#X text 427 256 Many objects cast the data they receive when they output +#X obj 123 252 list; +#X restore 467 591 pd Related_Objects; +#X text 427 232 Many objects cast the data they receive when they output it:; -#X text 546 337 Some objects do not cast the data:; -#X obj 444 308 trigger anything; -#X msg 444 283 this is a list without a cast; -#X obj 444 331 print; -#X text 430 371 Some objects need to have the data explicitly declared +#X text 546 313 Some objects do not cast the data:; +#X obj 444 284 trigger anything; +#X msg 444 259 this is a list without a cast; +#X obj 444 307 print; +#X text 430 347 Some objects need to have the data explicitly declared in order to handle it. These are mostly symbol handling objects.; -#X text 430 437 Objects which route data generally can handle explicitly +#X text 430 413 Objects which route data generally can handle explicitly or implicitly defined data.; -#X obj 500 470 trigger; -#X obj 558 470 niagara; -#X obj 446 414 select; +#X obj 500 446 trigger; +#X obj 558 446 niagara; +#X obj 446 390 select; #X obj -5 -2 cnv 15 850 20 empty empty all_about_data_types 20 10 1 18 -233017 -66577 0; #X obj 811 -1 pddp; -#X text 635 597 updated for Pd version 0.37.1; #X text -9 291 "anything"; #X text -9 407 "list"; #X text -9 393 "float"; #X text -9 434 "symbol"; -#X text -9 420 "scalar"; #X text -9 380 "bang"; #X msg 91 339 anything 1 two three; #X msg 242 339 one 2 3; @@ -61,26 +60,25 @@ or implicitly defined data.; -1; #X msg 244 373 list one 2 3; #X msg 283 403 1 2 3; -#X text 197 35 float symbol pointer; #X text -3 35 atoms (basic data types):; #X text -3 60 The basic data types are known as 'atoms' in Pd. "float" and "symbol" atoms have 'atom boxes' for realtime display and control from within a patch. "pointer" atoms are used for accessing data stored in graphical data structures.; -#X obj 441 208 int; -#X obj 449 188 / 5.23; -#X floatatom 449 160 5 0 0 0 - - -; -#X floatatom 482 228 5 0 0 0 - - -; -#X floatatom 441 228 5 0 0 0 - - -; -#X obj 531 158 tosymbol; -#X obj 595 159 fromsymbol; -#X obj 678 158 list2symbol; -#X obj 682 200 ftos; +#X obj 441 184 int; +#X obj 449 164 / 5.23; +#X floatatom 449 136 5 0 0 0 - - -; +#X floatatom 482 204 5 0 0 0 - - -; +#X floatatom 441 204 5 0 0 0 - - -; +#X obj 531 134 tosymbol; +#X obj 595 135 fromsymbol; +#X obj 678 134 list2symbol; +#X obj 682 176 ftos; #X obj 637 43 symbol; -#X obj 600 96 int; +#X obj 600 87 int; #X obj 719 43 pointer; -#X obj 460 96 bang; -#X obj 498 97 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +#X obj 460 87 bang; +#X obj 498 88 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 519 43 float; #X text 1 527 There a number of objects which are used for storing @@ -88,28 +86,114 @@ messages \, or casting messages as a specific data type \, sometimes converting from one data type to another. The right inlet on these objects is stores that value \, which can be later output using a bang. ; -#X obj 628 96 lister; +#X obj 628 87 lister; #X text 560 44 aka; #X obj 586 43 f; #X text 22 613 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 239 627 released under the GNU GPL; -#X text 435 614 $Revision: 1.4 $$Date: 2005-04-26 05:34:40 $; +#X text 435 614 $Revision: 1.5 $$Date: 2005-07-28 19:45:58 $; #X text 436 627 $Author: eighthave $; -#X obj 433 517 pddp_open all_about_lists_vs_anythings; -#X obj 433 538 pddp_open all_about_symbol_construction; -#X obj 433 559 pddp_open all_about_data_structures; -#X text 515 97 (aka [bng]); +#X obj 490 518 pddp_open all_about_lists_vs_anythings; +#X obj 490 539 pddp_open all_about_symbol_construction; +#X obj 490 560 pddp_open all_about_data_structures; +#X text 515 88 (aka [bng]); #X text 3 304 "anything" allows anything to pass through unchanged. It is not a data type tho.; #X text -6 143 "symbols" need to be declared explicitly. "floats" do not need to be declared explicitly \, but can be:; #X text 153 212 casting as a "symbol"; #X text 1 509 CASTING AND STORAGE OBJECTS; -#X text 431 498 FOR MORE INFO:; -#X text 430 138 EXAMPLES OF CASTING; +#X text 431 474 FOR MORE INFO:; +#X text 430 114 EXAMPLES OF CASTING; #X text 425 43 atom objects:; -#X text 432 74 other data types:; +#X text 432 65 other data types:; +#X text -9 420 "pointer"; +#X obj 24 460 trigger anything bang float list pointer symbol; +#X obj 24 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 88 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 152 479 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 218 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 283 479 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 348 480 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 193 35 "float" \, "symbol" \, "pointer"; +#N canvas 0 22 505 381 float/list 0; +#X msg 75 133 float 1 2 3; +#X text 34 22 FLOAT CONVERSION; +#X msg 95 187 list 1 2 3; +#X text 92 164 A list with multiple elements remains a list.; +#X text 43 59 A float with one element remains a float.; +#X text 72 106 A float with multiple elements remains a float but is +cut to one element.; +#X text 99 218 A list with one float element is converted to a float. +; +#X obj 58 308 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1 +-1; +#X obj 105 308 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 +-1; +#X obj 152 308 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +-1 -1; +#X obj 200 308 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 +-1; +#X obj 248 308 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +-1 -1; +#X obj 57 286 route bang float symbol list; +#X obj 92 349 print FLOAT; +#X msg 50 81 float 3; +#X msg 106 239 list 2; +#X obj 188 349 print LIST; +#X connect 0 0 12 0; +#X connect 2 0 12 0; +#X connect 12 0 7 0; +#X connect 12 1 8 0; +#X connect 12 1 13 0; +#X connect 12 2 9 0; +#X connect 12 3 10 0; +#X connect 12 3 16 0; +#X connect 12 4 11 0; +#X connect 14 0 12 0; +#X connect 15 0 12 0; +#X restore 465 493 pd float/list conversion; +#N canvas 0 22 479 361 empty 0; +#X obj 78 268 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1 +-1; +#X obj 125 268 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 +-1; +#X obj 172 268 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +-1 -1; +#X obj 220 268 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 +-1; +#X obj 268 268 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +-1 -1; +#X msg 127 205 list; +#X msg 50 75 float; +#X msg 97 134 symbol; +#X text 31 21 EMPTY DATA TYPES; +#X obj 77 246 route bang float symbol list; +#X obj 73 326 print FLOAT; +#X obj 155 326 print SYMBOL; +#X text 120 184 An empty list is converted to a bang; +#X text 85 114 An empty "symbol" remains a empty "symbol".; +#X text 46 55 An empty "float" remains a "float" and is initialized +to 0; +#X connect 5 0 9 0; +#X connect 6 0 9 0; +#X connect 7 0 9 0; +#X connect 9 0 0 0; +#X connect 9 1 1 0; +#X connect 9 1 10 0; +#X connect 9 2 2 0; +#X connect 9 2 11 0; +#X connect 9 3 3 0; +#X connect 9 4 4 0; +#X restore 656 493 pd empty data types; +#X text 635 597 updated for Pd version 0.38.4; #X connect 3 0 4 0; #X connect 5 0 4 0; #X connect 6 0 3 0; @@ -118,13 +202,19 @@ not need to be declared explicitly \, but can be:; #X connect 12 0 10 0; #X connect 16 0 18 0; #X connect 17 0 16 0; -#X connect 33 0 36 0; -#X connect 34 0 36 0; -#X connect 36 0 35 0; -#X connect 36 3 37 0; -#X connect 38 0 36 0; -#X connect 39 0 36 0; -#X connect 43 0 47 0; -#X connect 44 0 43 0; -#X connect 44 0 46 0; -#X connect 45 0 44 0; +#X connect 31 0 34 0; +#X connect 32 0 34 0; +#X connect 34 0 33 0; +#X connect 34 3 35 0; +#X connect 36 0 34 0; +#X connect 37 0 34 0; +#X connect 40 0 44 0; +#X connect 41 0 40 0; +#X connect 41 0 43 0; +#X connect 42 0 41 0; +#X connect 76 0 77 0; +#X connect 76 1 78 0; +#X connect 76 2 79 0; +#X connect 76 3 80 0; +#X connect 76 4 81 0; +#X connect 76 5 82 0; diff --git a/doc/pddp/all_about_lists_vs_anythings.pd b/doc/pddp/all_about_lists_vs_anythings.pd index 89fc865a..77b898dc 100644 --- a/doc/pddp/all_about_lists_vs_anythings.pd +++ b/doc/pddp/all_about_lists_vs_anythings.pd @@ -1,4 +1,4 @@ -#N canvas 268 58 885 631 10; +#N canvas 268 58 889 635 10; #X msg 95 298 1 2 3; #X obj 125 329 route list; #X msg 62 278 list 1 2 3; @@ -17,11 +17,11 @@ -1; #X obj 535 138 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 -1; -#X obj 684 138 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +#X obj 630 138 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 -1 -1; #X msg 486 73 list this is a set with a cast; #X msg 493 92 this is a set withOUT a cast; -#X obj 585 138 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 +#X obj 583 138 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 -1; #X obj 120 527 route list; #X obj 120 546 bng 15 250 50 0 empty empty list -20 7 1 10 -262144 @@ -49,13 +49,10 @@ NOT a "list":; #X text 22 575 (C) Copyright 2004 Hans-Christoph Steiner ; #X text 239 589 released under the GNU GPL; -#X text 445 576 $Revision: 1.6 $$Date: 2005-07-28 01:02:56 $; +#X text 445 576 $Revision: 1.7 $$Date: 2005-07-28 19:45:58 $; #X text 446 589 $Author: eighthave $; #X text 673 551 updated for Pd 0.38-2; -#X obj 487 117 route bang float list pointer symbol; -#X obj 635 138 bng 15 250 50 0 empty empty pointer 0 21 1 9 -262144 --1 -1; -#X obj 734 138 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +#X obj 679 138 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 -1 -1; #X msg 502 286 1 1; #X obj 495 312 +; @@ -78,15 +75,6 @@ starting with a "symbol" is not \, unless that "symbol" is the selector -1; #X obj 58 169 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 -1; -#X obj 207 169 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 --1 -1; -#X obj 108 169 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 --1; -#X obj 10 148 route bang float list pointer symbol; -#X obj 158 169 bng 15 250 50 0 empty empty pointer 0 21 1 9 -262144 --1 -1; -#X obj 257 169 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 --1 -1; #N canvas 183 32 857 475 has 0; #X obj 96 162 print; #X msg 57 93 list one two three; @@ -218,37 +206,43 @@ symbol] outputs a symbol from its left outlet.; #X text 450 389 When working with sets that might be either "lists" or undefined \, use [prepend]. Many of the "list" handling objects in Pd have odd quirks which can make things difficult.; +#X obj 487 117 route bang float list symbol; +#X obj 10 148 route bang float list symbol; +#X obj 152 169 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +-1 -1; +#X obj 105 169 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 +-1; +#X obj 201 169 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +-1 -1; #X connect 0 0 1 0; #X connect 1 0 7 0; #X connect 1 1 8 0; #X connect 2 0 1 0; -#X connect 3 0 56 0; +#X connect 3 0 55 0; #X connect 9 0 1 0; #X connect 10 0 1 0; -#X connect 14 0 38 0; -#X connect 15 0 38 0; +#X connect 14 0 54 0; +#X connect 15 0 54 0; #X connect 17 0 18 0; #X connect 17 1 19 0; #X connect 20 0 17 0; #X connect 21 0 17 0; #X connect 23 0 17 0; #X connect 24 0 17 0; -#X connect 25 0 56 0; +#X connect 25 0 55 0; #X connect 26 0 4 0; -#X connect 26 0 56 0; -#X connect 38 0 11 0; -#X connect 38 1 12 0; -#X connect 38 2 16 0; -#X connect 38 3 39 0; -#X connect 38 4 13 0; -#X connect 38 5 40 0; -#X connect 41 0 42 0; -#X connect 42 0 43 0; -#X connect 44 0 42 0; -#X connect 46 0 42 0; -#X connect 56 0 52 0; -#X connect 56 1 53 0; -#X connect 56 2 55 0; -#X connect 56 3 57 0; -#X connect 56 4 54 0; -#X connect 56 5 58 0; +#X connect 26 0 55 0; +#X connect 39 0 40 0; +#X connect 40 0 41 0; +#X connect 42 0 40 0; +#X connect 44 0 40 0; +#X connect 54 0 11 0; +#X connect 54 1 12 0; +#X connect 54 2 16 0; +#X connect 54 3 13 0; +#X connect 54 4 38 0; +#X connect 55 0 50 0; +#X connect 55 1 51 0; +#X connect 55 2 57 0; +#X connect 55 3 56 0; +#X connect 55 4 58 0; diff --git a/doc/pddp/float-help.pd b/doc/pddp/float-help.pd index bd04f8c5..ae2cb04b 100644 --- a/doc/pddp/float-help.pd +++ b/doc/pddp/float-help.pd @@ -1,88 +1,126 @@ -#N canvas 0 0 626 624 12; -#X obj 114 560 pddp; -#X obj 8 3 cnv 15 90 578 empty empty empty 20 12 0 14 -233017 -66577 -0; -#X floatatom 325 358 5 0 0 0 - - -; -#X floatatom 484 395 5 0 0 0 - - -; -#X floatatom 369 462 5 0 0 0 - - -; -#X msg 304 402 42 7; -#X obj 366 396 bng 15 250 50 0 empty empty "bang" 0 -6 0 8 -262144 --1 -1; -#X floatatom 128 422 5 0 0 0 - - -; -#X msg 128 373 bang; -#X obj 46 18 float; -#X obj 492 17 f; -#X text 111 18 - STORE A FLOATING POINT NUMBER - abbreviation:; -#X msg 249 402 7 3 4; -#X obj 369 436 f; -#X obj 128 397 float 7; -#X text 113 484 doc/2.control.examples/sendnumber.pd; -#X text 371 358 Tip: Shift+drag; -#X text 37 44 INLETS:; -#X text 37 59 - LEFT:; -#X text 104 59 Float - A float at the left inlet will update the stored -value of the object and will send the number immediately to the outlet. -; -#X text 104 114 Bang - A bang at the left inlet will force [float] -to send its value to the outlet.; -#X text 104 152 List - A list at the left inlet will be truncated to -include only the first element. The first element in the list will -update the stored value of the object and will send the number immediately -to the outlet.; -#X text 29 220 - RIGHT:; -#X text 105 220 Float - A float at the right inlet is stored for later -use. It will be sent to the left outlet when a float or bang is received -in the left inlet.; -#X text 29 324 OUTLETS:; -#X text 13 272 ARGUMENTS:; -#X text 20 354 EXAMPLES:; -#X text 22 484 SEE ALSO:; -#X text 104 272 One - [float] accepts a single float as a creation -argument which initializes the first value to be sent out the left -outlet.; -#X text 104 325 One - outputs the stored floating point value of the -object.; -#X text 249 384 lists; -#X text 106 355 creation argument; -#N canvas 58 0 401 250 Related_Objects 0; -#X text 25 11 Native Pd Objects; -#X text 23 92 Externals and other object libraries; -#X obj 42 48 int; -#X obj 109 48 symbol; -#X text 36 126 [randomF]; -#X restore 114 508 pd Related_Objects; -#N canvas 57 0 637 618 More_Info 0; -#X text 43 24 All numbers in Pd are kept in 32-bit floating point and -can represent real numbers between -8 \, 388608 and 8.388.608.00; -#X text 11 78 WHAT IS A FLOATING POINT NUMBER?; -#X text 41 267 The following are examples of floating point numbers: -; -#X text 61 293 3; -#X text 62 334 -111.5; -#X text 61 313 0.5; -#X text 40 387 3e-005 : This example is a computer shorthand for scientific -notation. It means 3*10-5 (or 10 to the negative 5th power multiplied -by 3).; -#X text 41 108 According to Webopedia.com \, "computers are integer -machines and are capable of representing real numbers only by using -complex codes." Hence \, real numbers must be 'approximated' by computers -using the "floating point standard". In such a number \, the decimal -point can "float" meaning that there is no fixed number of digits preceding -or following the decimal. A floating point number is therefore a computer's -approximation of a real number.; -#X text 43 453 Interesting side-note: In the early 1990's \, the Intel -80486 was shipped with a math coprocessor to help accelerate the process -of computing floating point numbers (which previously required a considerable -amount of CPU power.) Math coprocessors have since found there way -into nearly every graphics card and CPU available today.; -#X text 62 358 10000 to 1e-016; -#X restore 114 534 pd More_Info; -#X text 158 561 - Dave Sabine \, November 18 \, 2002; -#X connect 2 0 13 0; -#X connect 3 0 13 1; -#X connect 5 0 13 0; -#X connect 6 0 13 0; -#X connect 8 0 14 0; -#X connect 12 0 13 0; -#X connect 13 0 4 0; -#X connect 14 0 7 0; +#N canvas 217 31 536 593 10; +#X obj 114 560 pddp; +#X obj 8 3 cnv 15 90 578 empty empty empty 20 12 0 14 -233017 -66577 +0; +#X floatatom 325 358 5 0 0 0 - - -; +#X floatatom 484 395 5 0 0 0 - - -; +#X floatatom 369 462 5 0 0 0 - - -; +#X msg 304 402 42 7; +#X obj 366 396 bng 15 250 50 0 empty empty "bang" 0 -6 0 8 -262144 +-1 -1; +#X floatatom 128 422 5 0 0 0 - - -; +#X msg 128 373 bang; +#X obj 46 18 float; +#X obj 492 17 f; +#X text 111 18 - STORE A FLOATING POINT NUMBER - abbreviation:; +#X msg 249 402 7 3 4; +#X obj 369 436 f; +#X obj 128 397 float 7; +#X text 113 484 doc/2.control.examples/sendnumber.pd; +#X text 371 358 Tip: Shift+drag; +#X text 37 44 INLETS:; +#X text 37 59 - LEFT:; +#X text 104 59 Float - A float at the left inlet will update the stored +value of the object and will send the number immediately to the outlet. +; +#X text 104 114 Bang - A bang at the left inlet will force [float] +to send its value to the outlet.; +#X text 104 152 List - A list at the left inlet will be truncated to +include only the first element. The first element in the list will +update the stored value of the object and will send the number immediately +to the outlet.; +#X text 29 220 - RIGHT:; +#X text 105 220 Float - A float at the right inlet is stored for later +use. It will be sent to the left outlet when a float or bang is received +in the left inlet.; +#X text 29 324 OUTLETS:; +#X text 13 272 ARGUMENTS:; +#X text 20 354 EXAMPLES:; +#X text 22 484 SEE ALSO:; +#X text 104 272 One - [float] accepts a single float as a creation +argument which initializes the first value to be sent out the left +outlet.; +#X text 104 325 One - outputs the stored floating point value of the +object.; +#X text 249 384 lists; +#X text 106 355 creation argument; +#N canvas 58 22 401 250 Related_Objects 0; +#X text 25 11 Native Pd Objects; +#X text 23 92 Externals and other object libraries; +#X obj 42 48 int; +#X obj 109 48 symbol; +#X text 36 126 [randomF]; +#X restore 114 508 pd Related_Objects; +#N canvas 57 22 641 622 More_Info 0; +#X text 43 24 All numbers in Pd are kept in 32-bit floating point and +can represent real numbers between -8 \, 388608 and 8.388.608.00; +#X text 11 78 WHAT IS A FLOATING POINT NUMBER?; +#X text 41 267 The following are examples of floating point numbers: +; +#X text 61 293 3; +#X text 62 334 -111.5; +#X text 61 313 0.5; +#X text 40 387 3e-05 : This example is a computer shorthand for scientific +notation. It means 3*10-5 (or 10 to the negative 5th power multiplied +by 3).; +#X text 41 108 According to Webopedia.com \, "computers are integer +machines and are capable of representing real numbers only by using +complex codes." Hence \, real numbers must be 'approximated' by computers +using the "floating point standard". In such a number \, the decimal +point can "float" meaning that there is no fixed number of digits preceding +or following the decimal. A floating point number is therefore a computer's +approximation of a real number.; +#X text 43 453 Interesting side-note: In the early 1990's \, the Intel +80486 was shipped with a math coprocessor to help accelerate the process +of computing floating point numbers (which previously required a considerable +amount of CPU power.) Math coprocessors have since found there way +into nearly every graphics card and CPU available today.; +#X text 62 358 10000 to 1e-16; +#X restore 114 534 pd More_Info; +#X text 158 561 - Dave Sabine \, November 18 \, 2002; +#N canvas 0 22 454 304 float/list 0; +#X msg 75 133 float 1 2 3; +#X text 34 22 FLOAT CONVERSION; +#X msg 95 187 list 1 2 3; +#X text 92 164 A list with multiple elements remains a list.; +#X text 43 59 A float with one element remains a float.; +#X text 72 106 A float with multiple elements remains a float but is +cut to one element.; +#X text 99 218 A list with one float element is converted to a float. +; +#X obj 58 308 bng 15 250 50 0 empty empty bang 0 20 1 9 -262144 -1 +-1; +#X obj 105 308 bng 15 250 50 0 empty empty float 0 21 1 9 -262144 -1 +-1; +#X obj 152 308 bng 15 250 50 0 empty empty symbol 0 21 1 9 -262144 +-1 -1; +#X obj 200 308 bng 15 250 50 0 empty empty list 0 21 1 9 -262144 -1 +-1; +#X obj 248 308 bng 15 250 50 0 empty empty UNDEFINED 0 21 1 9 -262144 +-1 -1; +#X obj 57 286 route bang float symbol list; +#X obj 92 349 print FLOAT; +#X msg 50 81 float 3; +#X msg 106 239 list 2; +#X obj 188 349 print LIST; +#X connect 0 0 12 0; +#X connect 2 0 12 0; +#X connect 12 0 7 0; +#X connect 12 1 8 0; +#X connect 12 1 13 0; +#X connect 12 2 9 0; +#X connect 12 3 10 0; +#X connect 12 3 16 0; +#X connect 12 4 11 0; +#X connect 14 0 12 0; +#X connect 15 0 12 0; +#X restore 229 533 pd float/list conversion; +#X obj 263 506 pddp_open all_about_data_types; +#X connect 2 0 13 0; +#X connect 3 0 13 1; +#X connect 5 0 13 0; +#X connect 6 0 13 0; +#X connect 8 0 14 0; +#X connect 12 0 13 0; +#X connect 13 0 4 0; +#X connect 14 0 7 0; diff --git a/doc/pddp/print-help.pd b/doc/pddp/print-help.pd index a6fc43a9..9208cb6d 100644 --- a/doc/pddp/print-help.pd +++ b/doc/pddp/print-help.pd @@ -1,50 +1,91 @@ -#N canvas 11 11 777 611 10; -#X msg 93 173 walk the dog; -#X msg 19 173 bang; -#X msg 60 173 234; -#X obj 21 10 print; -#X obj 19 208 print; -#X text 20 44 The print object is used in Pd to send messages to the -'terminal window'. When the print object receives a message \, its -output will appear in the terminal window following the name of the -print object and a colon (:). If the print object does not have a name -(which you can supply as an argument within the print object itself) -then the word "print" appears followed by a colon (:) and your message. -; -#X msg 92 240 walk the dog; -#X msg 19 240 bang; -#X msg 59 240 234; -#X obj 19 267 print myPrintObject; -#X text 181 268 A print object with a name.; -#X text 17 309 When the print object receives a list \, it will output -the entire list as a single message. Like below:; -#X obj 17 369 print print_this_list; -#X msg 17 346 10 20 30 foo; -#X msg 17 461 10 20 30 foo; -#X obj 17 514 unpack f f f s; -#X obj 17 547 print unpack_this_list; -#X text 66 201 A print object without a name. Be sure you can see the -terminal window as you click on these messages.; -#X text 74 9 -- print messages to the terminal window; -#X obj 411 43 print~; -#X text 410 22 RELATED OBJECTS; -#X text 17 408 To output the list as separate elements \, the list -needs to be unpacked first. Note that [unpack]'s outlets are triggered -from right to left. Like below:; -#X text 28 481 The arguments here are used to tell Pd what type of -atom to expect: (f = float \, s = symbol).; -#X text 402 524 This document was updated for Pd version 0.35 test -24 by Dave Sabine as part of a project called pddp proposed by Krzysztof -Czaja to build comprehensive documentation for Pd.; -#X connect 0 0 4 0; -#X connect 1 0 4 0; -#X connect 2 0 4 0; -#X connect 6 0 9 0; -#X connect 7 0 9 0; -#X connect 8 0 9 0; -#X connect 13 0 12 0; -#X connect 14 0 15 0; -#X connect 15 0 16 0; -#X connect 15 1 16 0; -#X connect 15 2 16 0; -#X connect 15 3 16 0; +#N canvas 190 76 886 627 10; +#X msg 93 173 walk the dog; +#X msg 19 173 bang; +#X msg 60 173 234; +#X obj 21 10 print; +#X obj 19 208 print; +#X text 20 44 The print object is used in Pd to send messages to the +'terminal window'. When the print object receives a message \, its +output will appear in the terminal window following the name of the +print object and a colon (:). If the print object does not have a name +(which you can supply as an argument within the print object itself) +then the word "print" appears followed by a colon (:) and your message. +; +#X msg 92 240 walk the dog; +#X msg 19 240 bang; +#X msg 59 240 234; +#X obj 19 267 print myPrintObject; +#X text 181 268 A print object with a name.; +#X text 17 309 When the print object receives a list \, it will output +the entire list as a single message. Like below:; +#X obj 17 369 print print_this_list; +#X msg 17 346 10 20 30 foo; +#X msg 17 461 10 20 30 foo; +#X obj 17 514 unpack f f f s; +#X obj 17 547 print unpack_this_list; +#X text 66 201 A print object without a name. Be sure you can see the +terminal window as you click on these messages.; +#X text 74 9 -- print messages to the terminal window; +#X obj 153 588 print~; +#X text 40 588 RELATED OBJECTS; +#X text 17 408 To output the list as separate elements \, the list +needs to be unpacked first. Note that [unpack]'s outlets are triggered +from right to left. Like below:; +#X text 28 481 The arguments here are used to tell Pd what type of +atom to expect: (f = float \, s = symbol).; +#X obj 477 252 print; +#X msg 497 87 1; +#X msg 506 108 float 1; +#X text 464 52 "floats" are interpreted (i.e. it doesn't show the word +"float" before the number):; +#X obj 531 210 symbol test; +#X msg 526 169 symbol this; +#X obj 531 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 568 383 one 2 three; +#X obj 500 467 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 568 468 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 586 443 print STRAIGHT; +#X msg 552 363 list 1 two 3; +#X msg 535 343 1 two 3; +#X msg 577 404 list one 2 three; +#X obj 503 444 route list; +#X text 467 295 [print] only interprets the "list" selector when the +following body of the message is an implied list \, i.e. a set of atoms +that starts with a float.; +#X text 452 551 This document was updated for Pd version 0.38.4 by +Dave Sabine and Hans-Christoph Steiner as part of a project called +pddp proposed by Krzysztof Czaja to build comprehensive documentation +for Pd.; +#X text 454 28 [print]'S ODDITIES; +#X text 509 139 "symbols" are not interpreted (i.e. "symbol" is also +printed:; +#X connect 0 0 4 0; +#X connect 1 0 4 0; +#X connect 2 0 4 0; +#X connect 6 0 9 0; +#X connect 7 0 9 0; +#X connect 8 0 9 0; +#X connect 13 0 12 0; +#X connect 14 0 15 0; +#X connect 15 0 16 0; +#X connect 15 1 16 0; +#X connect 15 2 16 0; +#X connect 15 3 16 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 27 0 23 0; +#X connect 28 0 23 0; +#X connect 29 0 27 0; +#X connect 30 0 33 0; +#X connect 30 0 37 0; +#X connect 34 0 33 0; +#X connect 34 0 37 0; +#X connect 35 0 33 0; +#X connect 35 0 37 0; +#X connect 36 0 33 0; +#X connect 36 0 37 0; +#X connect 37 0 31 0; +#X connect 37 1 32 0; diff --git a/doc/pddp/route-help.pd b/doc/pddp/route-help.pd index bb87e568..b4dcca5f 100644 --- a/doc/pddp/route-help.pd +++ b/doc/pddp/route-help.pd @@ -1,13 +1,9 @@ -#N canvas 103 43 1019 657 10; -#X obj 7 331 print x1; -#X obj 69 331 print x2; -#X obj 131 331 print x3; -#X obj 194 331 print x4; +#N canvas 190 100 1023 661 10; #X obj 82 273 route 23 54 1; #X msg 170 239 54 43; #X msg 212 239 1 foo bar; #X obj 141 418 route big apple; -#X msg 351 386 1 2 3; +#X msg 351 376 1 2 3; #X msg 248 376 big apple pie; #X msg 320 238 walk the dog; #X text 8 217 numeric arguments:; @@ -27,10 +23,6 @@ a match if found \, and the message contains multiple elements (a list) the corresponding outlet. If no match is found \, then the entire message is sent out the right-most outlet - the "rejection" outlet. The number of outlets is the number of arguments plus one.; -#X text 176 265 In this case \, the creation arguments are all numbers -and [route] will therefore assume that it should attempt to match messages -that are data type 'number'. All messages that are not numbers will -be output through the right-most outlet.; #X msg 18 239 23 345 456; #X msg 96 239 420 34 45; #X msg 32 376 apple pie; @@ -59,13 +51,10 @@ output through the right-most outlet).; #X text 630 328 none of the above!; #X text 702 268 a list of symbols; #X text 599 349 SPECIAL CASES OF LISTS.; -#X text 18 563 RELATED OBJECTS; -#X obj 22 584 select; -#X obj 67 584 trigger; -#X obj 119 584 moses; -#X text 588 603 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 text 17 583 RELATED OBJECTS; +#X obj 21 604 select; +#X obj 68 604 trigger; +#X obj 122 604 moses; #X text 26 36 Route checks the first element of a message against each of its creation arguments \, which may be numbers or symbols (but not a mixture of the two unless the data types are defined explicitly) @@ -84,7 +73,7 @@ is:; #X text 16 187 iem.kug.ac.at/pdb/; #X obj 193 34 demux; #X obj 245 34 gate; -#X restore 22 607 pd related_objects_from_other_libraries; +#X restore 21 627 pd related_objects_from_other_libraries; #X floatatom 625 498 5 0 0 0 - - -; #X symbolatom 673 497 10 0 0 0 - - -; #X obj 578 518 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 @@ -114,54 +103,187 @@ is:; -1 -1; #X obj 237 439 bng 15 250 50 0 empty empty everything_else -2 23 1 12 -262144 -1 -1; -#X obj 286 326 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 --1 -1; -#X obj 333 326 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 --1 -1; -#X obj 381 326 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 --1 -1; -#X obj 429 326 bng 15 250 50 0 empty empty everything_else -2 23 1 -12 -262144 -1 -1; #X obj 129 469 print x1; #X obj 189 469 print x2; #X obj 249 469 print x3; -#X text 526 557 [trigger]-style shortcuts don't work:; -#X obj 538 577 route a b f l p s; -#X text 667 576 !=; -#X obj 689 577 route anything bang float list pointer symbol; -#X connect 4 0 0 0; -#X connect 4 1 1 0; -#X connect 4 2 2 0; -#X connect 4 3 3 0; -#X connect 5 0 4 0; -#X connect 6 0 4 0; -#X connect 7 0 60 0; -#X connect 7 0 67 0; -#X connect 7 1 61 0; -#X connect 7 1 68 0; -#X connect 7 2 62 0; -#X connect 7 2 69 0; -#X connect 8 0 7 0; -#X connect 9 0 7 0; -#X connect 10 0 4 0; -#X connect 13 0 50 0; -#X connect 14 0 50 0; -#X connect 15 0 50 0; -#X connect 16 0 50 0; -#X connect 17 0 50 0; -#X connect 18 0 50 0; -#X connect 23 0 4 0; -#X connect 24 0 4 0; -#X connect 25 0 7 0; -#X connect 26 0 7 0; -#X connect 44 0 51 0; -#X connect 45 0 52 0; -#X connect 47 0 50 0; -#X connect 48 0 50 0; -#X connect 49 0 50 0; -#X connect 50 0 46 0; -#X connect 50 1 44 0; -#X connect 50 2 45 0; -#X connect 50 3 53 0; -#X connect 50 4 54 0; -#X connect 55 0 50 0; +#X text 565 555 [trigger]-style shortcuts don't work:; +#X text 678 574 !=; +#X obj 579 575 route b f s l; +#X obj 700 575 route bang float symbol list; +#X obj 7 331 print x23; +#X obj 75 331 print x54; +#X obj 143 331 print x1; +#X obj 204 331 print other; +#X obj 82 293 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 109 293 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 137 293 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 161 293 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 176 265 In this case \, the creation arguments are all numbers +and [route] will therefore assume that it should attempt to match messages +that are data type "float". All messages that are not numbers will +be output through the right-most outlet.; +#N canvas 0 22 466 633 routing_data_types 0; +#X obj 334 314 route symbol; +#X obj 336 334 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 413 335 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 331 361 route symbol; +#X obj 333 381 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 410 382 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 318 269 test; +#X msg 357 269 symbol test; +#X obj 58 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 135 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 55 378 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 132 378 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 89 266 bang; +#X obj 56 311 route bang; +#X obj 53 358 route bang; +#X text 14 5 routing based on reserved words:; +#X obj 188 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 265 331 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 185 378 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 262 378 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 186 311 route float; +#X obj 183 358 route float; +#X msg 170 266 1; +#X msg 209 266 float 12; +#X obj 181 542 route list; +#X obj 181 561 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 249 562 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 168 580 route list; +#X obj 168 599 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 236 600 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 184 493 list 1 two 3; +#X msg 167 473 1 two 3; +#X msg 200 513 list one 2 three; +#X msg 365 289 symbol; +#X msg 113 484 list; +#X msg 224 287 float test; +#X text 26 245 These all output the as same atom type that is routed: +; +#X msg 15 266 bang test; +#X obj 71 131 route 1; +#X msg 71 183 2 3 4; +#X obj 71 164 prepend set; +#X msg 71 100 1 2 3 4; +#X msg 218 183 is not a list; +#X obj 218 164 prepend set; +#X obj 218 131 route this; +#X msg 218 100 this is not a list; +#X text 21 50 [route] has three modes \, first is float \, second is +symbol \, and third is data type. In the first two modes \, the first +element of the set is stripped off by [route].; +#X text 26 206 In the third mode \, [route] outputs the same atom type +(bang->bang \, float->float \, symbol->symbol).; +#X text 26 419 Lists do not behave the same with [route list] even +though it is interpreting incoming lists \, not just routing by keyword +\, as in the second symbol mode.; +#X msg 174 164 set; +#X text 157 164 re; +#X text 164 24 "bang" \, "float" \, "symbol" \, and "list"; +#X connect 0 0 1 0; +#X connect 0 0 3 0; +#X connect 0 1 2 0; +#X connect 3 0 4 0; +#X connect 3 1 5 0; +#X connect 6 0 0 0; +#X connect 7 0 0 0; +#X connect 12 0 13 0; +#X connect 13 0 8 0; +#X connect 13 0 14 0; +#X connect 13 1 9 0; +#X connect 14 0 10 0; +#X connect 14 1 11 0; +#X connect 20 0 16 0; +#X connect 20 0 21 0; +#X connect 20 1 17 0; +#X connect 21 0 18 0; +#X connect 21 1 19 0; +#X connect 22 0 20 0; +#X connect 23 0 20 0; +#X connect 24 0 25 0; +#X connect 24 0 27 0; +#X connect 24 1 26 0; +#X connect 27 0 28 0; +#X connect 27 1 29 0; +#X connect 30 0 24 0; +#X connect 31 0 24 0; +#X connect 32 0 24 0; +#X connect 33 0 0 0; +#X connect 34 0 24 0; +#X connect 35 0 20 0; +#X connect 37 0 13 0; +#X connect 38 0 40 0; +#X connect 40 0 39 0; +#X connect 41 0 38 0; +#X connect 43 0 42 0; +#X connect 44 0 43 0; +#X connect 45 0 44 0; +#X connect 49 0 42 0; +#X connect 49 0 39 0; +#X restore 838 496 pd routing_data_types; +#X text 580 601 This document was updated for Pd version 0.38.4 by +Dave Sabine and Hans-Christoph Steiner as part of a project called +pddp proposed by Krzysztof Czaja to build comprehensive documentation +for Pd.; +#X text 832 475 More info:; +#X connect 0 0 64 0; +#X connect 0 0 68 0; +#X connect 0 1 65 0; +#X connect 0 1 69 0; +#X connect 0 2 66 0; +#X connect 0 2 70 0; +#X connect 0 3 67 0; +#X connect 0 3 71 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 54 0; +#X connect 3 0 57 0; +#X connect 3 1 55 0; +#X connect 3 1 58 0; +#X connect 3 2 56 0; +#X connect 3 2 59 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 6 0 0 0; +#X connect 9 0 44 0; +#X connect 10 0 44 0; +#X connect 11 0 44 0; +#X connect 12 0 44 0; +#X connect 13 0 44 0; +#X connect 14 0 44 0; +#X connect 18 0 0 0; +#X connect 19 0 0 0; +#X connect 20 0 3 0; +#X connect 21 0 3 0; +#X connect 38 0 45 0; +#X connect 39 0 46 0; +#X connect 41 0 44 0; +#X connect 42 0 44 0; +#X connect 43 0 44 0; +#X connect 44 0 40 0; +#X connect 44 1 38 0; +#X connect 44 2 39 0; +#X connect 44 3 47 0; +#X connect 44 4 48 0; +#X connect 49 0 44 0; -- cgit v1.2.1