From 9b0b047298aaad0d8f4d9c89809e3601d9de171d Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 6 Feb 2006 01:32:20 +0000 Subject: added examples generated from writing about defining all the types within Pd svn path=/trunk/; revision=4554 --- .../list_must_have_2_or_more_elements.pd | 45 ++++++++ .../messageoddness/routing_by_data_types.pd | 115 +++++++++++++++++++++ doc/additional/messageoddness/undefined_series.pd | 55 ++++++++++ doc/additional/messageoddness/what_is_a_symbol.pd | 86 +++++++++++++++ 4 files changed, 301 insertions(+) create mode 100644 doc/additional/messageoddness/list_must_have_2_or_more_elements.pd create mode 100644 doc/additional/messageoddness/routing_by_data_types.pd create mode 100644 doc/additional/messageoddness/undefined_series.pd create mode 100644 doc/additional/messageoddness/what_is_a_symbol.pd (limited to 'doc/additional/messageoddness') diff --git a/doc/additional/messageoddness/list_must_have_2_or_more_elements.pd b/doc/additional/messageoddness/list_must_have_2_or_more_elements.pd new file mode 100644 index 00000000..3bfa0ea7 --- /dev/null +++ b/doc/additional/messageoddness/list_must_have_2_or_more_elements.pd @@ -0,0 +1,45 @@ +#N canvas 0 22 454 304 10; +#X floatatom 243 167 5 0 0 0 - - -; +#X symbolatom 291 166 10 0 0 0 - - -; +#X obj 196 187 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 +-1 -1; +#X obj 196 143 route bang float symbol list; +#X obj 243 187 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 +-1 -1; +#X obj 291 187 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 +-1 -1; +#X obj 339 187 bng 15 250 50 0 empty empty list -2 23 1 12 -262144 +-1 -1; +#X obj 387 187 bng 15 250 50 0 empty empty undefined -18 23 1 12 -262144 +-1 -1; +#X text 24 35 There are no 0- or 1-element lists. These are immediately +converted to other types:; +#X msg 195 75 list; +#X msg 202 96 list 2; +#X msg 207 115 list word; +#X floatatom 11 147 5 0 0 0 - - -; +#X symbolatom 77 147 10 0 0 0 - - -; +#X obj 11 165 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 77 165 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 19 244 Therefore \, the definition of list is: a series of +elements with a selector of "list" and 2 or more elements. (But don't +forget! A series whose element is a float has an implied "list" selector!) +; +#X connect 0 0 4 0; +#X connect 1 0 5 0; +#X connect 3 0 2 0; +#X connect 3 1 0 0; +#X connect 3 2 1 0; +#X connect 3 3 6 0; +#X connect 3 4 7 0; +#X connect 9 0 3 0; +#X connect 9 0 13 0; +#X connect 9 0 12 0; +#X connect 10 0 3 0; +#X connect 10 0 12 0; +#X connect 11 0 3 0; +#X connect 11 0 13 0; +#X connect 12 0 14 0; +#X connect 13 0 15 0; diff --git a/doc/additional/messageoddness/routing_by_data_types.pd b/doc/additional/messageoddness/routing_by_data_types.pd new file mode 100644 index 00000000..d63a1336 --- /dev/null +++ b/doc/additional/messageoddness/routing_by_data_types.pd @@ -0,0 +1,115 @@ +#N canvas 414 90 494 642 10; +#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; diff --git a/doc/additional/messageoddness/undefined_series.pd b/doc/additional/messageoddness/undefined_series.pd new file mode 100644 index 00000000..15aa4b91 --- /dev/null +++ b/doc/additional/messageoddness/undefined_series.pd @@ -0,0 +1,55 @@ +#N canvas 242 94 461 496 10; +#X floatatom 161 180 5 0 0 0 - - -; +#X symbolatom 209 179 10 0 0 0 - - -; +#X obj 114 200 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 +-1 -1; +#X obj 114 156 route bang float symbol list; +#X obj 161 200 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 +-1 -1; +#X obj 209 200 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 +-1 -1; +#X obj 257 200 bng 15 250 50 0 empty empty list -2 23 1 12 -262144 +-1 -1; +#X obj 305 200 bng 15 250 50 0 empty empty undefined -18 23 1 12 -262144 +-1 -1; +#X msg 151 83 lots of pie; +#X floatatom 191 405 5 0 0 0 - - -; +#X symbolatom 259 404 10 0 0 0 - - -; +#X obj 124 425 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 +-1 -1; +#X obj 191 425 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 +-1 -1; +#X obj 259 425 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 +-1 -1; +#X obj 328 425 bng 15 250 50 0 empty empty list -2 23 1 12 -262144 +-1 -1; +#X msg 156 104 is this a list 2?; +#X text 144 61 [route] says these are not lists:; +#X msg 147 29 list lots of pie; +#X text 268 30 a list; +#X obj 123 381 trigger bang float symbol list; +#X msg 124 274 list lots of pie; +#X text 251 274 a list; +#X msg 158 330 lots of pie; +#X msg 158 349 is this a list 2?; +#X text 15 316 [trigger] says these are not floats \, lists \, symbols +or lists; +#X connect 0 0 4 0; +#X connect 1 0 5 0; +#X connect 3 0 2 0; +#X connect 3 1 0 0; +#X connect 3 2 1 0; +#X connect 3 3 6 0; +#X connect 3 4 7 0; +#X connect 8 0 3 0; +#X connect 9 0 12 0; +#X connect 10 0 13 0; +#X connect 15 0 3 0; +#X connect 17 0 3 0; +#X connect 19 0 11 0; +#X connect 19 1 9 0; +#X connect 19 2 10 0; +#X connect 19 3 14 0; +#X connect 20 0 19 0; +#X connect 22 0 19 0; +#X connect 23 0 19 0; diff --git a/doc/additional/messageoddness/what_is_a_symbol.pd b/doc/additional/messageoddness/what_is_a_symbol.pd new file mode 100644 index 00000000..0ac20210 --- /dev/null +++ b/doc/additional/messageoddness/what_is_a_symbol.pd @@ -0,0 +1,86 @@ +#N canvas 242 94 904 607 10; +#X msg 48 59 symbol pie; +#X msg 67 111 pie; +#X text 127 59 a symbol; +#X floatatom 96 337 5 0 0 0 - - -; +#X symbolatom 144 336 10 0 0 0 - - -; +#X obj 49 357 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 -1 +-1; +#X obj 49 313 route bang float symbol list; +#X obj 96 357 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 +-1 -1; +#X obj 144 357 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 +-1 -1; +#X obj 192 357 bng 15 250 50 0 empty empty list -2 23 1 12 -262144 +-1 -1; +#X obj 240 357 bng 15 250 50 0 empty empty undefined -18 23 1 12 -262144 +-1 -1; +#X msg 86 240 lots of pie; +#X msg 132 473 word; +#X msg 140 492 symbol word; +#X text 166 473 not a symbol; +#X obj 132 538 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 205 538 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 133 517 select word; +#X text 15 445 [select] considers [word( as something other than a +symbol:; +#X msg 404 62 symbol pie; +#X msg 421 108 pie; +#X text 483 62 a symbol; +#X floatatom 467 370 5 0 0 0 - - -; +#X symbolatom 535 369 10 0 0 0 - - -; +#X obj 400 390 bng 15 250 50 0 empty empty bang -6 23 1 12 -262144 +-1 -1; +#X obj 467 390 bng 15 250 50 0 empty empty float -4 23 1 12 -262144 +-1 -1; +#X obj 535 390 bng 15 250 50 0 empty empty symbol -12 23 1 12 -262144 +-1 -1; +#X obj 604 390 bng 15 250 50 0 empty empty list -2 23 1 12 -262144 +-1 -1; +#X text 28 566 [select] requires a atom type selector in order to understand +the data (the float selector is implied); +#X text 54 89 [route] says these are not symbols:; +#X msg 74 131 word; +#X msg 91 261 is this a list 2?; +#X text 79 218 [route] says these are not lists:; +#X msg 82 186 list lots of pie; +#X text 203 187 a list; +#X msg 431 127 word; +#X text 424 88 [trigger] says these are not symbols (check Pd window): +; +#X obj 399 346 trigger bang float symbol list; +#X msg 443 252 list lots of pie; +#X text 570 252 a list; +#X msg 444 285 lots of pie; +#X msg 445 309 is this a list 2?; +#X connect 0 0 6 0; +#X connect 1 0 6 0; +#X connect 3 0 7 0; +#X connect 4 0 8 0; +#X connect 6 0 5 0; +#X connect 6 1 3 0; +#X connect 6 2 4 0; +#X connect 6 3 9 0; +#X connect 6 4 10 0; +#X connect 11 0 6 0; +#X connect 12 0 17 0; +#X connect 13 0 17 0; +#X connect 17 0 15 0; +#X connect 17 1 16 0; +#X connect 19 0 37 0; +#X connect 20 0 37 0; +#X connect 22 0 25 0; +#X connect 23 0 26 0; +#X connect 30 0 6 0; +#X connect 31 0 6 0; +#X connect 33 0 6 0; +#X connect 35 0 37 0; +#X connect 37 0 24 0; +#X connect 37 1 22 0; +#X connect 37 2 23 0; +#X connect 37 3 27 0; +#X connect 38 0 37 0; +#X connect 40 0 37 0; +#X connect 41 0 37 0; -- cgit v1.2.1