From 398c52f97852b584d7b7f81a4b0bf8c1a961acbb Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes Date: Mon, 13 Dec 2010 09:35:05 +0000 Subject: made some minor clarifications about data types and messages in Pd svn path=/trunk/; revision=14624 --- doc/pddp/all_about_arrays.pd | 18 +- doc/pddp/all_about_atom_conversion.pd | 6 +- doc/pddp/all_about_atoms.pd | 17 +- doc/pddp/all_about_help_patches.pd | 2 +- doc/pddp/all_about_message_conversion.pd | 26 +- doc/pddp/all_about_messages.pd | 763 +++++++++++++++---------------- doc/pddp/all_about_send_n_receive.pd | 12 +- 7 files changed, 423 insertions(+), 421 deletions(-) (limited to 'doc/pddp') diff --git a/doc/pddp/all_about_arrays.pd b/doc/pddp/all_about_arrays.pd index e4892920..671be10a 100644 --- a/doc/pddp/all_about_arrays.pd +++ b/doc/pddp/all_about_arrays.pd @@ -71,19 +71,19 @@ in a row: 0 \, 1 \, 2 \, 3 \, etc. These numbers are called indices. Each index holds a corresponding value.; #X text 19 119 All of this is true in Pd \, although the word "array" is often used loosely to refer to three different concepts:; -#X text 19 228 3) an array defined (and possibly represented graphically) -as part of a data structure.; #X text 19 146 1) an array as defined above.; #X text 19 161 2) a graphical representation of an array \, or "garray" \, created by:; #X text 37 186 a) choosing "Array" from the "Put" menu \, or; #X text 37 201 b) creating a [table] object (in which case it's hidden inside a subpatch).; +#X text 19 228 3) (less commonly) an array defined (and possibly represented +graphically) as part of a data structure.; #X restore 43 42 pd What_is_an_array_in_PD; #N canvas 0 0 428 403 The_Put_menu_array 0; #N canvas 0 0 450 300 (subpatch) 0; #X array \$0-pddp-garray-ex1 100 float 2; -#X coords 0 1 99 -1 200 140 1 0 0; +#X coords 0 1 99 -1 200 140 1; #X restore 22 73 graph; #X text 233 149 the black line to change; #X text 227 134 (You can click-drag the; @@ -140,7 +140,6 @@ can be anything greater than 0 (zero). At a sample rate of 441000 khz #X text 7 1 The [table] object; #X text 19 37 The [table] object is another way to create a graphical array.; -#X obj 22 73 table myTable; #X text 19 96 If you click the [table] object in runmode you can see it's just a subcanvas \, inside which is a graph containing an array. ; @@ -155,10 +154,11 @@ to set the name and size of the array.; #X text 19 249 * with the [table] object \, you cannot save the contents of the array with the patch. (Note: this is true even if you open [table] and check "save contents" in the garray properties.); -#X text 19 309 If you're not interested in seeing the array data within -your PD patch \, you can use the [table] object to store the array -and corresponding table in a sub-window. Note that [table]s are more -CPU friendly than their graphical counterpart.; +#X obj 22 73 table myTable 10; +#X text 138 73 (arguments are ARRAY_NAME and SIZE); +#X text 19 309 The [table] object is useful when you don't really need +to look at the array data. Note that [table]s are more CPU friendly +than "Put" menu arrays.; #X restore 63 86 pd The_[table]_object; #X obj 201 87 pddp/pddplink table-help.pd; #X obj 201 65 pddp/pddplink array-help.pd; @@ -212,7 +212,7 @@ menu arrays (both graphically and in their structure).; #N canvas 14 32 428 532 How_to_manipulate_arrays_in_PD 0; #N canvas 0 22 452 302 (subpatch) 0; #X array exampleArray 14 float 0; -#X coords 0 2 13 -2 200 140 1 0 0; +#X coords 0 2 13 -2 200 140 1; #X restore 214 378 graph; #N canvas 9 24 434 213 Setting_the_size_of_an_array 0; #X msg 214 88 \; exampleArray resize \$1; diff --git a/doc/pddp/all_about_atom_conversion.pd b/doc/pddp/all_about_atom_conversion.pd index 0daadcd5..f4ced2d4 100644 --- a/doc/pddp/all_about_atom_conversion.pd +++ b/doc/pddp/all_about_atom_conversion.pd @@ -39,17 +39,17 @@ sure you have read the following help patches first:; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 1 18 -261106 -33289 0; #X text 7 1 From a symbol-atom to a float; -#X text 20 37 There are no standard objects to turn a symbol-atom into -a float. There are two important externals for this \, however:; #X obj 20 70 pddp/helplink cyclone/fromsymbol; #X obj 20 90 pddp/helplink zexy/symbol2list; +#X text 20 37 There are no internal objects to turn a symbol-atom into +a float. There are two important externals for this \, however:; #X restore 43 149 pd symbol-atom_to_float; #N canvas 14 48 428 554 float_to_symbol-atom 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 1 18 -261106 -33289 0; #X text 7 1 Changing a float to a symbol-atom; #X obj 45 163 hsl 128 15 0 127 0 0 empty 123 empty -2 -8 0 10 -262144 --1 -1 0 1; +-1 -1 7000 1; #X text 19 79 For example \, you can enter a number for the "receive-symbol" of the so-called IEMGUIS like the slider below. Since receive-names need to be symbol-atoms \, the GUI automatically converts "123" to diff --git a/doc/pddp/all_about_atoms.pd b/doc/pddp/all_about_atoms.pd index be01b8dd..b546c607 100644 --- a/doc/pddp/all_about_atoms.pd +++ b/doc/pddp/all_about_atoms.pd @@ -3,17 +3,18 @@ -261106 -33289 0; #X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp ; -#N canvas 14 48 428 166 What_is_an_atom? 0; +#N canvas 14 48 428 202 What_is_an_atom? 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 1 18 -261106 -33289 0; #X text 7 1 What is an atom in Pd?; -#X text 19 66 1) Basic atom types: float \, symbol \, and pointer atoms. -; -#X text 19 86 2) Special atom types: comma and semicolons.; -#X text 19 136 See the other subpatches for more details.; -#X text 19 106 3) Variables: dollar and dollsym atoms.; +#X text 19 166 See the other subpatches for more details.; +#X text 19 136 3) Variables: dollar and dollsym atoms.; #X text 19 36 An atom is the the most basic unit of data in a message. Atoms can be divided into three groups:; +#X text 19 66 1) Basic atom types: float \, symbol \, and (less commonly) +pointer atoms.; +#X text 19 101 2) Special atom types: comma and semicolons \, which +are generally used to separate messages in Pd.; #X restore 43 42 pd What_is_an_atom?; #N canvas 22 133 428 399 Basic_atoms 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 @@ -74,15 +75,15 @@ to symbol atoms (and escaped):; #X text 178 339 <- In object boxes \, commas/semicolons; #X text 196 354 are saved and loaded consistently; #X text 142 403 <- In message boxes \, commas/semicolons won't; -#X text 160 418 get escaped if you save the patch and load; #X text 7 226 Conversion of Commas and Semicolons to Symbol Atoms; #X msg 115 404; +#X text 160 418 be escaped if you save the patch and load; #X connect 8 0 9 0; #X connect 8 0 12 0; #X connect 8 0 14 0; #X connect 9 0 10 0; #X connect 11 0 8 0; -#X connect 14 0 21 0; +#X connect 14 0 20 0; #X restore 43 95 pd Special_atoms; #N canvas 7 69 428 561 Variable_atoms 0; #X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 diff --git a/doc/pddp/all_about_help_patches.pd b/doc/pddp/all_about_help_patches.pd index 48c65e1e..10f10986 100644 --- a/doc/pddp/all_about_help_patches.pd +++ b/doc/pddp/all_about_help_patches.pd @@ -3,7 +3,7 @@ 14 -233017 -33289 0; #X obj 0 168 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13 -228856 -1 0; -#N canvas 507 26 494 625 META 1; +#N canvas 507 26 494 625 META 0; #X text 12 95 RELEASE_VERSION 0.41.4; #X text 158 96 Keywords:; #X text 12 5 GENRE help; diff --git a/doc/pddp/all_about_message_conversion.pd b/doc/pddp/all_about_message_conversion.pd index 9f192dd3..af20c923 100644 --- a/doc/pddp/all_about_message_conversion.pd +++ b/doc/pddp/all_about_message_conversion.pd @@ -70,8 +70,6 @@ the incoming message to a list before it is processed.; selector \, which will convert a list or symbol message to an anything: ; #X msg 40 289 symbol one; -#X text 138 313 custom selectors are not "trimmed" \, so an; -#X text 138 328 anything will remain an anything.; #X obj 1 388 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 1 18 -261106 -33289 0; #X msg 24 419 list; @@ -96,6 +94,10 @@ selector \, which will convert a list or symbol message to an anything: #X obj 182 541 bng 15 500 50 0 empty empty pointer 0 24 1 12 -262144 -1 -1; #X text 7 388 Special Cases of Lists; +#X text 103 118 <- route removes the selector "list"...; +#X text 123 162 <- ... so this is once again an anything; +#X text 138 328 message "one two three" will pass unchanged; +#X text 138 313 custom selectors are not "trimmed" \, so the; #X connect 3 0 4 0; #X connect 4 0 5 0; #X connect 5 0 6 0; @@ -104,16 +106,16 @@ selector \, which will convert a list or symbol message to an anything: #X connect 11 0 14 0; #X connect 12 0 11 0; #X connect 16 0 11 0; -#X connect 20 0 32 0; -#X connect 22 0 32 0; -#X connect 23 0 21 0; -#X connect 23 0 32 0; -#X connect 32 0 27 0; -#X connect 32 1 28 0; -#X connect 32 2 29 0; -#X connect 32 3 33 0; -#X connect 32 4 30 0; -#X connect 32 5 31 0; +#X connect 18 0 30 0; +#X connect 20 0 30 0; +#X connect 21 0 19 0; +#X connect 21 0 30 0; +#X connect 30 0 25 0; +#X connect 30 1 26 0; +#X connect 30 2 27 0; +#X connect 30 3 31 0; +#X connect 30 4 28 0; +#X connect 30 5 29 0; #X restore 43 42 pd anythings_and_lists; #X obj 43 170 pddp/pddplink all_about_lists_vs_anythings.pd; #X obj 43 190 pddp/pddplink all_about_atom_conversion.pd; diff --git a/doc/pddp/all_about_messages.pd b/doc/pddp/all_about_messages.pd index 36395fe7..68c455ce 100644 --- a/doc/pddp/all_about_messages.pd +++ b/doc/pddp/all_about_messages.pd @@ -1,382 +1,381 @@ -#N canvas 0 0 448 248 10; -#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header messages 20 10 1 -18 -261106 -33289 0; -#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp -; -#N canvas 14 48 428 289 What_is_a_message_in_Pd? 0; -#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 -1 18 -261106 -33289 0; -#X text 7 1 What is a message in Pd?; -#X text 19 126 1) A selector \, which must be a symbol atom.[1]; -#X text 19 243 [1] The exceptions to this are implicit float and list -messages. See the next subpatch for details.; -#X text 19 146 2) Zero or more elements \, which may be any atom type -that Pd can understand.; -#X text 19 106 Messages in Pd are made up of the following components: -; -#X text 19 183 Messages divide into two groups: those with selectors -that have a predefined meaning and behavior in Pd \, and everything -else. See the other subpatches for more on how Pd processes messages. -; -#X text 19 36 Objects in Pd send each other various data in the form -of messages. Messages can transport all kinds of information: float -\, symbol \, and pointer atoms \, groups of floats and symbols \, etc. -Understanding how to build and work with messages is a key to understanding -Pd.; -#X restore 43 42 pd What_is_a_message_in_Pd?; -#N canvas 18 112 428 500 Predefined_messages_in_Pd 0; -#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 -1 18 -261106 -33289 0; -#X text 7 1 Predefined messages in Pd; -#X text 20 131 2) symbol message - the selector "symbol" \, followed -by a single symbol atom.; -#X obj 1 274 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 -1 18 -261106 -33289 0; -#X text 20 216 5) pointer message - the selector "pointer" \, followed -by a pointer atom.; -#X text 20 97 1) float message - this message has the selector "float" -\, followed by a single float atom (e.g. \, "12" \, "-4" \, "1.8"). -; -#X text 20 186 4) list - the selector "list" \, followed by two or -more atoms of any type (these are the elements of the list).; -#X text 20 166 3) bang message - the single selector "bang".; -#X text 20 246 6) signal - an audio signal; -#X text 7 274 Implicit float and list Messages; -#X text 20 37 In Pd \, when an object receives a message to an inlet -\, it looks at the selector to figure out what to do next. So that -objects can easily communicate with one another \, Pd has several predefined -messages:; -#X text 20 309 Since numbers are used so often in Pd \, two shortcuts -are provided to ease typing and reading them:; -#X text 20 344 1) A single float atom has an implicit "float" selector. -; -#X msg 41 370 1; -#X msg 181 370 float 1; -#X text 71 370 is the same as...; -#X text 20 394 1) a message that starts with a float atom and is followed -by one or more atoms has an implicit "list" selector. Thus "1 2 3" -or "1 4 63" \, and even "1 foo fee four" are list messages.; -#X text 81 460 is the same as...; -#X msg 41 460 2 3 4; -#X msg 191 460 list 2 3 4; -#X restore 43 69 pd Predefined_messages_in_Pd; -#X obj 43 183 pddp/pddplink all_about_atoms.pd; -#N canvas 19 160 428 264 User_defined_messages_in_Pd 0; -#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 -1 18 -261106 -33289 0; -#X text 7 1 User-defined messages in Pd; -#X text 20 79 1) single selector messages - these are messages made -up of a single symbol atom \, like "set" \, "clear" \, or "flush". -; -#X text 20 165 These messages are also referred to as meta-messages -\, selector series \, anythings \, and named messages based on the -selector (e.g. \, "foo 1 2 3" is a "foo message").; -#X text 20 37 User defined messages \, also referred to as "anythings" -\, are messages with selectors other than those predefined by Pd (listed -in the previous subpatch). These include:; -#X text 20 110 2) custom selector + 1 or more elements - messages with -a custom selector followed by one or more atoms of any type. Examples -include "set 3 4 5" \, "threshold 30 74" \, and "foo bar 3 four".; -#X obj 20 231 pddp/pddplink all_about_lists_vs_anythings.pd; -#X text 20 212 For more information about "anythings" \, see:; -#X restore 43 94 pd User_defined_messages_in_Pd; -#X obj 1 226 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0 -14 -233017 -33289 0; -#N canvas 44 246 494 344 META 0; -#X text 12 105 HELP_PATCH_AUTHORS Dave Sabine \, May 5 \, 2003 . Jonathan -Wilkes revised the patch to conform to the PDDP template for Pd version -0.42.; -#X text 12 85 LIBRARY PDDP; -#X text 12 5 GENRE all_about_pd; -#X text 12 45 KEYWORDS needs_work; -#X text 12 25 NAME list float symbol; -#X text 12 65 DESCRIPTION message syntax in Pd; -#X restore 392 228 pd META; -#X obj 6 228 pddp/pddplink pddp/help.pd -text help; -#X text 42 153 Messages are made up of atoms. Make sure you understand -atoms before reading about messages.; -#N canvas 20 104 428 468 Distinguishing_Message_Types 0; -#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 -1 18 -261106 -33289 0; -#X msg 23 72 foo; -#X msg 23 140 symbol foo; -#X symbolatom 22 378 10 0 0 0 - - -; -#X msg 22 254 symbol clear; -#X msg 46 310 clear; -#X text 109 260 like this one and pass it to the outlet after; -#X text 108 246 The [pipe] object will take a symbol message; -#X text 91 297 On the other hand \, the "clear" message tells the; -#X text 19 403 It's helpful to consider the following: if Pd didn't -make a distinction between "symbol clear" and "clear" \, how would -[pipe] know whether you want to send the word "clear" to the outlet -\, or trigger the "clear" function described above?; -#X text 90 312 [pipe] object to forget all stored message and; -#X text 90 327 refrain from outputting anything.; -#X obj 22 351 pipe s 3000; -#X text 95 351 <-- wait 3 seconds \, then output the message; -#X text 19 159 Above is a message with the selector "symbol". The first -(and only) element of the message is "foo". This is a "symbol message" -\, one of Pd's built-in message types.; -#X text 19 93 Above is a message with the selector "foo". You might -also refer to this as a custom message \, the symbol atom "foo" \, -or even a "foo message". The message has no elements.; -#X text 7 1 Understanding Message Types; -#X text 20 35 Remember that messages in Pd can consist of a single -symbol atom. Consider the following:; -#X text 19 201 This distinction is important: some objects \, for example -\, have one behavior for symbol messages \, and a different behavior -for custom messages.; -#X text 109 274 the specified duration (3 seconds).; -#X connect 4 0 12 0; -#X connect 5 0 12 0; -#X connect 12 0 3 0; -#X restore 43 120 pd Distinguishing_Message_Types; -#N canvas 24 124 428 150 Quick_Quiz! 0; -#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 -14 -261106 -33289 0; -#X text 7 2 Messages- Related Objects; -#X msg 22 43 list quiz: What type of message is this?; -#X obj 22 99 bng 15 250 50 0 empty empty list 0 25 0 8 -262144 -1 -1 -; -#X obj 63 99 bng 15 250 50 0 empty empty bang 0 25 0 8 -262144 -1 -1 -; -#X obj 104 99 bng 15 250 50 0 empty empty float 0 25 0 8 -262144 -1 --1; -#X obj 146 99 bng 15 250 50 0 empty empty symbol 0 25 0 8 -262144 -1 --1; -#X obj 187 99 bng 15 250 50 0 empty empty secret 0 25 0 8 -262144 -1 --1; -#X obj 229 99 bng 15 250 50 0 empty empty none_of_the_above 0 25 0 -8 -262144 -1 -1; -#X obj 22 70 route list bang float symbol secret; -#X text 276 42 <- Click to find out; -#X connect 2 0 9 0; -#X connect 9 0 3 0; -#X connect 9 1 4 0; -#X connect 9 2 5 0; -#X connect 9 3 6 0; -#X connect 9 4 7 0; -#X connect 9 5 8 0; -#X restore 103 228 pd Quick_Quiz!; -#N canvas 0 0 878 627 old 0; -#X obj 433 459 route; -#X floatatom 113 135 5 0 0 1 "float" - -; -#X symbolatom 204 135 10 0 0 1 "symbol" - -; -#X obj 116 231 symbol; -#X symbolatom 116 278 0 0 0 0 - - -; -#X msg 125 255 word; -#X msg 116 213 test; -#X msg 99 191 symbol this; -#X text 190 190 set type directly; -#X text 157 255 does not work (check console messages); -#X floatatom 35 253 5 0 0 0 - - -; -#X msg 40 232 12; -#X msg 23 212 float 83; -#N canvas 534 126 490 340 Related_Objects 0; -#X obj 32 54 ftos; -#X obj 68 54 list2symbol; -#X text 23 22 data type conversion; -#X obj 155 55 tosymbol; -#X obj 219 55 fromsymbol; -#X obj 36 252 lister; -#X obj 34 98 atoi; -#X obj 30 138 list2int; -#X obj 94 137 l2i; -#X obj 96 163 a2l; -#X obj 29 164 any2list; -#X obj 158 138 list2symbol; -#X obj 158 159 symbol2list; -#X obj 247 138 l2s; -#X obj 247 158 s2l; -#X obj 123 252 list; -#X restore 447 604 pd Related_Objects; -#X text 407 245 Many objects cast the data they receive when they output -it:; -#X text 526 326 Some objects do not cast the data:; -#X obj 424 297 trigger anything; -#X msg 424 272 this is a list without a cast; -#X obj 424 320 print; -#X text 410 360 Some objects need to have the data explicitly declared -in order to handle it. These are mostly symbol handling objects.; -#X text 410 426 Objects which route data generally can handle explicitly -or implicitly defined data.; -#X obj 480 459 trigger; -#X obj 538 459 niagara; -#X obj 426 403 select; -#X obj 15 18 cnv 15 750 20 empty empty all_about_data_types 20 10 1 -18 -233017 -66577 0; -#X obj 731 19 pddp/pddplink http://puredata.info/dev/pddp -text pddp -; -#X text 11 311 "anything"; -#X text 11 427 "list"; -#X text 11 413 "float"; -#X text 11 454 "symbol"; -#X text 11 400 "bang"; -#X msg 111 359 anything 1 two three; -#X msg 262 359 one 2 3; -#X obj 167 442 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 171 416 t a b f l p s; -#X obj 201 443 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X msg 264 393 list one 2 3; -#X msg 303 423 1 2 3; -#X text 17 55 atoms (basic data types):; -#X text 17 80 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 421 197 int; -#X obj 429 177 / 5.23; -#X floatatom 429 149 5 0 0 0 - - -; -#X floatatom 462 217 5 0 0 0 - - -; -#X floatatom 421 217 5 0 0 0 - - -; -#X obj 511 147 tosymbol; -#X obj 575 148 fromsymbol; -#X obj 658 147 list2symbol; -#X obj 662 189 ftos; -#X obj 617 56 symbol; -#X obj 580 100 int; -#X obj 699 56 pointer; -#X obj 440 100 bang; -#X obj 478 101 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 499 56 float; -#X text 21 547 There a number of objects which are used for storing -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 608 100 lister; -#X text 540 57 aka; -#X obj 566 56 f; -#X obj 470 531 pddp/pddplink all_about_lists_vs_anythings.pd -text -all_about_lists_vs_anythings; -#X obj 470 552 pddp/pddplink all_about_symbol_construction.pd -text -all_about_symbol_construction; -#X obj 470 573 pddp/pddplink all_about_data_structures.pd -text all_about_data_structures -; -#X text 495 101 (aka [bng]); -#X text 23 324 "anything" allows anything to pass through unchanged. -It is not a data type tho.; -#X text 14 163 "symbols" need to be declared explicitly. "floats" do -not need to be declared explicitly \, but can be:; -#X text 173 232 casting as a "symbol"; -#X text 21 529 CASTING AND STORAGE OBJECTS; -#X text 411 487 FOR MORE INFO:; -#X text 410 127 EXAMPLES OF CASTING; -#X text 405 56 atom objects:; -#X text 412 78 other data types:; -#X text 11 440 "pointer"; -#X obj 44 480 trigger anything bang float list pointer symbol; -#X obj 44 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 98 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 154 499 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 211 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 267 499 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X obj 323 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X text 213 55 "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 445 506 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 636 506 pd empty data types; -#X text 568 604 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; -#X connect 7 0 4 0; -#X connect 11 0 10 0; -#X connect 12 0 10 0; -#X connect 16 0 18 0; -#X connect 17 0 16 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 72 0 73 0; -#X connect 72 1 74 0; -#X connect 72 2 75 0; -#X connect 72 3 76 0; -#X connect 72 4 77 0; -#X connect 72 5 78 0; -#X restore 290 119 pd old; -#X obj 43 203 pddp/pddplink ../1.manual/x2.htm#s3.1; -#X text 194 202 <- fix this; +#N canvas 0 0 448 248 10; +#X obj 1 1 cnv 15 445 20 empty \$0-pddp.cnv.header messages 20 10 1 +18 -261106 -33289 0; +#X obj 407 2 pddp/pddplink http://puredata.info/dev/pddp -text pddp +; +#N canvas 14 48 428 289 What_is_a_message_in_Pd? 0; +#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 +1 18 -261106 -33289 0; +#X text 7 1 What is a message in Pd?; +#X text 19 126 1) A selector \, which must be a symbol atom.[1]; +#X text 19 243 [1] The exceptions to this are implicit float and list +messages. See the next subpatch for details.; +#X text 19 106 Messages in Pd are made up of the following components: +; +#X text 19 183 Messages divide into two groups: those with selectors +that have a predefined meaning and behavior in Pd \, and everything +else. See the other subpatches for more on how Pd processes messages. +; +#X text 19 36 Objects in Pd send each other various data in the form +of messages. Messages can transport all kinds of information: float +\, symbol \, and pointer atoms \, groups of floats and symbols \, etc. +Understanding how to build and work with messages is a key to understanding +Pd.; +#X text 19 146 2) Zero or more arguments \, which may be any atom type +that Pd can understand.; +#X restore 43 42 pd What_is_a_message_in_Pd?; +#N canvas 18 112 428 500 Predefined_messages_in_Pd 0; +#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 +1 18 -261106 -33289 0; +#X text 7 1 Predefined messages in Pd; +#X text 20 131 2) symbol message - the selector "symbol" \, followed +by a single symbol atom.; +#X obj 1 274 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 +1 18 -261106 -33289 0; +#X text 20 216 5) pointer message - the selector "pointer" \, followed +by a pointer atom.; +#X text 20 186 4) list - the selector "list" \, followed by two or +more atoms of any type (these are the elements of the list).; +#X text 20 166 3) bang message - the single selector "bang".; +#X text 20 246 6) signal - an audio signal; +#X text 7 274 Implicit float and list Messages; +#X text 20 37 In Pd \, when an object receives a message to an inlet +\, it looks at the selector to figure out what to do next. So that +objects can easily communicate with one another \, Pd has several predefined +messages:; +#X text 20 344 1) A single float atom has an implicit "float" selector. +; +#X msg 41 370 1; +#X msg 181 370 float 1; +#X text 71 370 is the same as...; +#X text 20 394 1) a message that starts with a float atom and is followed +by one or more atoms has an implicit "list" selector. Thus "1 2 3" +or "1 4 63" \, and even "1 foo fee four" are list messages.; +#X text 81 460 is the same as...; +#X msg 41 460 2 3 4; +#X msg 191 460 list 2 3 4; +#X text 20 97 1) float message - this message has the selector "float" +\, followed by a single float atom like 12 \, -4 \, or 1.8.; +#X text 20 309 Since numbers are used so often in Pd \, two shortcuts +are provided to make it easier to type and read them:; +#X restore 43 69 pd Predefined_messages_in_Pd; +#X obj 43 183 pddp/pddplink all_about_atoms.pd; +#N canvas 19 160 428 264 User_defined_messages_in_Pd 0; +#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 +1 18 -261106 -33289 0; +#X text 7 1 User-defined messages in Pd; +#X text 20 79 1) single selector messages - these are messages made +up of a single symbol atom \, like "set" \, "clear" \, or "flush". +; +#X text 20 37 User defined messages \, also referred to as "anythings" +\, are messages with selectors other than those predefined by Pd (listed +in the previous subpatch). These include:; +#X obj 20 231 pddp/pddplink all_about_lists_vs_anythings.pd; +#X text 20 212 For more information about "anythings" \, see:; +#X text 20 110 2) custom selector + 1 or more arguments - messages +with a custom selector followed by one or more atoms of any type. Examples +include "set 3 4 5" \, "threshold 30 74" \, and "foo bar 3 four".; +#X text 20 165 These messages are also referred to as meta-messages +\, selector series \, and anythings. (Additionally \, a message like +"foo 1 2 3" could be called a "foo message").; +#X restore 43 94 pd User_defined_messages_in_Pd; +#X obj 1 226 cnv 15 445 20 empty \$0-pddp.cnv.footer empty 20 12 0 +14 -233017 -33289 0; +#N canvas 44 246 494 344 META 0; +#X text 12 105 HELP_PATCH_AUTHORS Dave Sabine \, May 5 \, 2003 . Jonathan +Wilkes revised the patch to conform to the PDDP template for Pd version +0.42.; +#X text 12 85 LIBRARY PDDP; +#X text 12 5 GENRE all_about_pd; +#X text 12 45 KEYWORDS needs_work; +#X text 12 25 NAME list float symbol; +#X text 12 65 DESCRIPTION message syntax in Pd; +#X restore 392 228 pd META; +#X obj 6 228 pddp/pddplink pddp/help.pd -text help; +#X text 42 153 Messages are made up of atoms. Make sure you understand +atoms before reading about messages.; +#N canvas 20 104 428 468 Distinguishing_Message_Types 0; +#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 20 10 +1 18 -261106 -33289 0; +#X msg 23 72 foo; +#X msg 23 140 symbol foo; +#X symbolatom 22 378 10 0 0 0 - - -; +#X msg 22 254 symbol clear; +#X msg 46 310 clear; +#X text 109 260 like this one and pass it to the outlet after; +#X text 108 246 The [pipe] object will take a symbol message; +#X text 91 297 On the other hand \, the "clear" message tells the; +#X text 19 403 It's helpful to consider the following: if Pd didn't +make a distinction between "symbol clear" and "clear" \, how would +[pipe] know whether you want to send the word "clear" to the outlet +\, or trigger the "clear" function described above?; +#X text 90 312 [pipe] object to forget all stored message and; +#X text 90 327 refrain from outputting anything.; +#X obj 22 351 pipe s 3000; +#X text 95 351 <-- wait 3 seconds \, then output the message; +#X text 7 1 Understanding Message Types; +#X text 20 35 Remember that messages in Pd can consist of a single +symbol atom. Consider the following:; +#X text 19 201 This distinction is important: some objects \, for example +\, have one behavior for symbol messages \, and a different behavior +for custom messages.; +#X text 109 274 the specified duration (3 seconds).; +#X text 19 93 Above is a message with the selector "foo". You might +also refer to this as a custom message \, the symbol atom "foo" \, +or even a "foo message". The message has no arguments.; +#X text 19 159 Above is a message with the selector "symbol". The first +(and only) argument is "foo". This is a "symbol message" \, one of +Pd's built-in message types.; +#X connect 4 0 12 0; +#X connect 5 0 12 0; +#X connect 12 0 3 0; +#X restore 43 120 pd Distinguishing_Message_Types; +#N canvas 24 124 428 150 Quick_Quiz! 0; +#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0 +14 -261106 -33289 0; +#X text 7 2 Messages- Related Objects; +#X msg 22 43 list quiz: What type of message is this?; +#X obj 22 99 bng 15 250 50 0 empty empty list 0 25 0 8 -262144 -1 -1 +; +#X obj 63 99 bng 15 250 50 0 empty empty bang 0 25 0 8 -262144 -1 -1 +; +#X obj 104 99 bng 15 250 50 0 empty empty float 0 25 0 8 -262144 -1 +-1; +#X obj 146 99 bng 15 250 50 0 empty empty symbol 0 25 0 8 -262144 -1 +-1; +#X obj 187 99 bng 15 250 50 0 empty empty secret 0 25 0 8 -262144 -1 +-1; +#X obj 229 99 bng 15 250 50 0 empty empty none_of_the_above 0 25 0 +8 -262144 -1 -1; +#X obj 22 70 route list bang float symbol secret; +#X text 276 42 <- Click to find out; +#X connect 2 0 9 0; +#X connect 9 0 3 0; +#X connect 9 1 4 0; +#X connect 9 2 5 0; +#X connect 9 3 6 0; +#X connect 9 4 7 0; +#X connect 9 5 8 0; +#X restore 103 228 pd Quick_Quiz!; +#N canvas 0 0 878 627 old 0; +#X obj 433 459 route; +#X floatatom 113 135 5 0 0 1 "float" - -; +#X symbolatom 204 135 10 0 0 1 "symbol" - -; +#X obj 116 231 symbol; +#X symbolatom 116 278 0 0 0 0 - - -; +#X msg 125 255 word; +#X msg 116 213 test; +#X msg 99 191 symbol this; +#X text 190 190 set type directly; +#X text 157 255 does not work (check console messages); +#X floatatom 35 253 5 0 0 0 - - -; +#X msg 40 232 12; +#X msg 23 212 float 83; +#N canvas 534 126 490 340 Related_Objects 0; +#X obj 32 54 ftos; +#X obj 68 54 list2symbol; +#X text 23 22 data type conversion; +#X obj 155 55 tosymbol; +#X obj 219 55 fromsymbol; +#X obj 36 252 lister; +#X obj 34 98 atoi; +#X obj 30 138 list2int; +#X obj 94 137 l2i; +#X obj 96 163 a2l; +#X obj 29 164 any2list; +#X obj 158 138 list2symbol; +#X obj 158 159 symbol2list; +#X obj 247 138 l2s; +#X obj 247 158 s2l; +#X obj 123 252 list; +#X restore 447 604 pd Related_Objects; +#X text 407 245 Many objects cast the data they receive when they output +it:; +#X text 526 326 Some objects do not cast the data:; +#X obj 424 297 trigger anything; +#X msg 424 272 this is a list without a cast; +#X obj 424 320 print; +#X text 410 360 Some objects need to have the data explicitly declared +in order to handle it. These are mostly symbol handling objects.; +#X text 410 426 Objects which route data generally can handle explicitly +or implicitly defined data.; +#X obj 480 459 trigger; +#X obj 538 459 niagara; +#X obj 426 403 select; +#X obj 15 18 cnv 15 750 20 empty empty all_about_data_types 20 10 1 +18 -233017 -66577 0; +#X obj 731 19 pddp/pddplink http://puredata.info/dev/pddp -text pddp +; +#X text 11 311 "anything"; +#X text 11 427 "list"; +#X text 11 413 "float"; +#X text 11 454 "symbol"; +#X text 11 400 "bang"; +#X msg 111 359 anything 1 two three; +#X msg 262 359 one 2 3; +#X obj 167 442 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 171 416 t a b f l p s; +#X obj 201 443 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 264 393 list one 2 3; +#X msg 303 423 1 2 3; +#X text 17 55 atoms (basic data types):; +#X text 17 80 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 421 197 int; +#X obj 429 177 / 5.23; +#X floatatom 429 149 5 0 0 0 - - -; +#X floatatom 462 217 5 0 0 0 - - -; +#X floatatom 421 217 5 0 0 0 - - -; +#X obj 511 147 tosymbol; +#X obj 575 148 fromsymbol; +#X obj 658 147 list2symbol; +#X obj 662 189 ftos; +#X obj 617 56 symbol; +#X obj 580 100 int; +#X obj 699 56 pointer; +#X obj 440 100 bang; +#X obj 478 101 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 499 56 float; +#X text 21 547 There a number of objects which are used for storing +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 608 100 lister; +#X text 540 57 aka; +#X obj 566 56 f; +#X obj 470 531 pddp/pddplink all_about_lists_vs_anythings.pd -text +all_about_lists_vs_anythings; +#X obj 470 552 pddp/pddplink all_about_symbol_construction.pd -text +all_about_symbol_construction; +#X obj 470 573 pddp/pddplink all_about_data_structures.pd -text all_about_data_structures +; +#X text 495 101 (aka [bng]); +#X text 23 324 "anything" allows anything to pass through unchanged. +It is not a data type tho.; +#X text 14 163 "symbols" need to be declared explicitly. "floats" do +not need to be declared explicitly \, but can be:; +#X text 173 232 casting as a "symbol"; +#X text 21 529 CASTING AND STORAGE OBJECTS; +#X text 411 487 FOR MORE INFO:; +#X text 410 127 EXAMPLES OF CASTING; +#X text 405 56 atom objects:; +#X text 412 78 other data types:; +#X text 11 440 "pointer"; +#X obj 44 480 trigger anything bang float list pointer symbol; +#X obj 44 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 98 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 154 499 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 211 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 267 499 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 323 500 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 213 55 "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 445 506 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 636 506 pd empty data types; +#X text 568 604 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; +#X connect 7 0 4 0; +#X connect 11 0 10 0; +#X connect 12 0 10 0; +#X connect 16 0 18 0; +#X connect 17 0 16 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 72 0 73 0; +#X connect 72 1 74 0; +#X connect 72 2 75 0; +#X connect 72 3 76 0; +#X connect 72 4 77 0; +#X connect 72 5 78 0; +#X restore 290 119 pd old; +#X obj 43 203 pddp/pddplink ../1.manual/x2.htm#s3.1; +#X text 194 202 <- fix this; diff --git a/doc/pddp/all_about_send_n_receive.pd b/doc/pddp/all_about_send_n_receive.pd index 48f6bdc6..0ff547ac 100644 --- a/doc/pddp/all_about_send_n_receive.pd +++ b/doc/pddp/all_about_send_n_receive.pd @@ -47,21 +47,21 @@ far beyond the scope of a single patch.; #X obj 16 262 send one_send; #X obj 16 306 receive one_send; #X obj 19 244 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 0; +-1 -1 3800 0; #X obj 153 262 send one_send; #X obj 156 244 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 0; +-1 -1 1200 0; #X obj 291 262 send one_send; #X obj 294 244 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 0; +-1 -1 3200 0; #X obj 19 327 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; +-1 -1 3200 1; #X obj 153 306 receive one_send; #X obj 156 327 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; +-1 -1 3200 1; #X obj 291 306 receive one_send; #X obj 294 327 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 --1 -1 0 1; +-1 -1 3200 1; #X text 17 289 All [receive]s of the same name will receive the "messages": ; #X text 17 224 You can have multiple [send]s with the same name:; -- cgit v1.2.1