[PD] trouble with data structures

Frank Barknecht fbar at footils.org
Mon Jun 5 16:05:57 CEST 2006


Hallo,
Frank Barknecht hat gesagt: // Frank Barknecht wrote:
> You forgot to attach the patch, but I guess what's happening is some
> error in traversing the data structures in the patch. 

Okay, I've seen your patch now and indeed what's happeing is what I've
suspected. One additional note: If you use [pointer] with one or more
type arguments as suggested, you'l probably want to make sure to skip
unwanted types and autoamtically advance the traversal with a "next"
message. You can do this as in attached patch.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 483 432 690 306 10;
#N canvas 0 0 450 300 a 0;
#X msg 195 146 traverse pd-data \, bang;
#X obj 195 170 pointer;
#X obj 118 105 inlet;
#X obj 87 51 struct a float x;
#X obj 116 197 append a x;
#X obj 118 126 t b b;
#X obj 116 160 random 100;
#X obj 121 236 drawnumber x 0 0 900 a=;
#X connect 0 0 1 0;
#X connect 1 0 4 1;
#X connect 2 0 5 0;
#X connect 5 0 6 0;
#X connect 5 1 0 0;
#X connect 6 0 4 0;
#X restore 471 177 pd a;
#N canvas 0 0 450 300 b 0;
#X msg 195 146 traverse pd-data \, bang;
#X obj 195 170 pointer;
#X obj 118 105 inlet;
#X obj 118 126 t b b;
#X obj 116 160 random 100;
#X obj 87 51 struct b float x;
#X obj 116 197 append b x;
#X obj 121 236 drawnumber x 0 0 90 b=;
#X connect 0 0 1 0;
#X connect 1 0 6 1;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 0 0;
#X connect 4 0 6 0;
#X restore 470 204 pd b;
#X obj 454 149 until;
#N canvas 0 0 450 300 data 0;
#X restore 586 191 pd data;
#X obj 509 148 s pd-data;
#X msg 509 126 clear;
#X obj 40 102 pointer a;
#X msg 40 68 traverse pd-data \, next;
#X obj 40 192 get a x;
#X floatatom 40 217 5 0 0 0 - - -;
#X msg 69 171 next;
#X obj 69 150 b;
#X obj 123 131 bng 15 250 50 0 empty empty END 0 -6 0 8 -262144 -1
-1;
#X text 437 240 struct a and b;
#X msg 220 68 traverse pd-data \, next;
#X floatatom 220 217 5 0 0 0 - - -;
#X msg 249 171 next;
#X obj 249 150 b;
#X obj 303 131 bng 15 250 50 0 empty empty END 0 -6 0 8 -262144 -1
-1;
#X obj 220 102 pointer b;
#X obj 220 192 get b x;
#X text 217 39 Get first "b" pointer;
#X text 41 39 Get first "a" pointer;
#X obj 454 95 t b b;
#X obj 454 70 loadbang;
#X text 577 224 data subpatch;
#X msg 454 127 5;
#X text 113 170 get next "a";
#X text 296 171 get next "b";
#X msg 529 78 bang;
#X connect 2 0 0 0;
#X connect 2 0 1 0;
#X connect 5 0 4 0;
#X connect 6 0 8 0;
#X connect 6 1 11 0;
#X connect 6 2 12 0;
#X connect 7 0 6 0;
#X connect 8 0 9 0;
#X connect 10 0 6 0;
#X connect 11 0 10 0;
#X connect 14 0 19 0;
#X connect 16 0 19 0;
#X connect 17 0 16 0;
#X connect 19 0 20 0;
#X connect 19 1 17 0;
#X connect 19 2 18 0;
#X connect 20 0 15 0;
#X connect 23 0 26 0;
#X connect 23 1 5 0;
#X connect 24 0 23 0;
#X connect 26 0 2 0;
#X connect 29 0 23 0;


More information about the Pd-list mailing list