diff options
author | Guenter Geiger <ggeiger@users.sourceforge.net> | 2002-07-29 17:06:19 +0000 |
---|---|---|
committer | Guenter Geiger <ggeiger@users.sourceforge.net> | 2002-07-29 17:06:19 +0000 |
commit | 57045df5fe3ec557e57dc7434ac1a07b5521bffc (patch) | |
tree | 7174058b41b73c808107c7090d9a4e93ee202341 /pd/doc/7.stuff/data-structures/2.getting.data.pd | |
parent | da38b3424229e59f956252c3d89895e43e84e278 (diff) |
This commit was generated by cvs2svn to compensate for changes in r58,
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/; revision=59
Diffstat (limited to 'pd/doc/7.stuff/data-structures/2.getting.data.pd')
-rw-r--r-- | pd/doc/7.stuff/data-structures/2.getting.data.pd | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/pd/doc/7.stuff/data-structures/2.getting.data.pd b/pd/doc/7.stuff/data-structures/2.getting.data.pd new file mode 100644 index 00000000..bebd7371 --- /dev/null +++ b/pd/doc/7.stuff/data-structures/2.getting.data.pd @@ -0,0 +1,73 @@ +#N canvas 363 11 630 603 12; +#X text 311 559 updated for Pd version 0.32.; +#N canvas 42 312 598 266 stuff 0; +#X obj 353 159 pointer; +#X obj 117 103 t b b b; +#X msg 117 62 bang; +#X obj 117 31 loadbang; +#X text 151 62 click here to re-initialize; +#X text 126 206 Explained later...; +#X msg 20 139 50 250 30 9 \, 200 200 -20 900 \, 100 200 -50 30; +#X obj 20 162 append template2 x y z q; +#X msg 353 101 \; pd-data2 clear; +#X msg 353 137 traverse pd-data2 \, bang; +#X connect 0 0 7 4; +#X connect 1 0 6 0; +#X connect 1 1 9 0; +#X connect 1 2 8 0; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 6 0 7 0; +#X connect 9 0 0 0; +#X restore 506 310 pd stuff; +#X text 506 242 subpatches:; +#X obj 15 303 pointer; +#X msg 27 271 next; +#X text 75 301 <- object that outputs pointers to scalars; +#N canvas 13 22 345 271 data2 1; +#X restore 506 265 pd data2; +#N canvas 15 278 427 138 template2 0; +#X obj 60 46 filledpolygon 244 q 5 0 0 20 z 40 0; +#X obj 60 21 template float x float y float z float q; +#X text 13 79 The template for the two scalars \, as in the last patch +; +#X restore 506 288 pd template2; +#X obj 15 355 get template2 x y z q; +#X floatatom 15 384 5 0 0; +#X floatatom 76 384 5 0 0; +#X floatatom 137 384 5 0 0; +#X floatatom 199 385 5 0 0; +#X msg 15 246 traverse pd-data2; +#X obj 59 330 print; +#X text 100 330 <- this gets a bang when we reach the end; +#X text 211 353 <- this takes incoming pointers; +#X text 214 367 and outputs the values of x \, y \, z \, and q.; +#X text 172 245 <- go to head of list (click first); +#X text 68 273 <- output next item (click 4 times); +#X text 14 5 The simplest thing you can do with a collection of scalars +(a list) is to traverse it \, getting the numbers back out. This is +done using two objects \, "pointer" which does the traversal \, and +"get" which \, given a pointer to a scalar \, extracts numeric quantities +from it.; +#X text 14 85 You can send the "pointer" object a "traverse" message +to point it to the head of the list. The argument "pd-data2" indicates +the Pd window named "data2." The head of the list means \, not the +first scalar in the list \, but the position before the first scalar +\, which is a valid pointer in Pd but has no data or template.; +#X text 14 180 The "next" message tells the "pointer" object to go +to the next scalar in the list and output it. If there are no more +\, "pointer" outputs a bang at right.; +#X text 19 424 The "get" object takes a pointer \, checks that its +template agrees with what "get" is expecting \, i.e. \, "template2" +\, and if so outputs the values of x \, y \, z \, and q in the usual +reverse order.; +#X text 18 492 The pointer sent from "pointer" to "get" is an elementary +Pd type on a level with "float" and "symbol".; +#X connect 3 0 8 0; +#X connect 3 1 14 0; +#X connect 4 0 3 0; +#X connect 8 0 9 0; +#X connect 8 1 10 0; +#X connect 8 2 11 0; +#X connect 8 3 12 0; +#X connect 13 0 3 0; |