Update of /cvsroot/pure-data/abstractions/footils/list-abs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3929
Modified Files: list-centroid-help.pd Log Message: data structure centroid
Index: list-centroid-help.pd =================================================================== RCS file: /cvsroot/pure-data/abstractions/footils/list-abs/list-centroid-help.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** list-centroid-help.pd 21 Apr 2007 13:14:48 -0000 1.1 --- list-centroid-help.pd 21 Apr 2007 15:59:51 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- + #N struct 1002-centroid float x; #N canvas 285 188 596 561 10; #X floatatom 129 468 5 0 0 0 centroid - -; *************** *** 52,55 **** --- 53,175 ---- In this case , no result will be sent to the first outlet , instead the second outlet will bang and a console warning will be issued.; + #N canvas 318 53 641 556 graphical-centroid 0; + #N canvas 0 0 450 300 randlist 0; + #X obj 134 129 until; + #X msg 246 151 set; + #X msg 134 193 add2 $1; + #X obj 112 101 t b f b; + #X obj 135 249 outlet; + #X obj 112 31 inlet; + #X obj 134 151 random 100; + #X obj 134 171 / 100; + #X msg 112 59 10; + #X connect 0 0 6 0; + #X connect 1 0 4 0; + #X connect 2 0 4 0; + #X connect 3 0 4 0; + #X connect 3 1 0 0; + #X connect 3 2 1 0; + #X connect 5 0 8 0; + #X connect 6 0 7 0; + #X connect 7 0 2 0; + #X connect 8 0 3 0; + #X restore 79 388 pd randlist; + #X msg 79 414 0.95 0.59 0.63 0.68 0.98 0.2 0.58 0.51 0.28 0.25; + #X msg 79 366 bang; + #X obj 79 447 list prepend 0; + #X obj 79 470 s $0-tab; + #N canvas 0 0 450 300 (subpatch) 0; + #X array $0-tab 10 float 0; + #X coords 0 1 9 0 200 140 1; + #X restore 79 105 graph; + #N canvas 0 0 694 427 $0-c 0; + #X scalar 1002-centroid 3.60177 ;; + #X coords 0 0 20 140 200 140 1; + #X restore 79 105 pd $0-c; + #X floatatom 339 346 5 0 0 0 - - -; + #X obj 339 313 list-centroid; + #N canvas 336 319 712 355 $0-centroid 0; + #X obj 19 329 outlet; + #X obj 19 86 route change; + #X obj 228 62 drawpolygon 900 2 x(0:10)(0:10) 0 x(0:10)(0:10) 140; + #X obj 19 62 struct $0-centroid float x; + #X connect 1 0 0 0; + #X connect 3 0 1 0; + #X restore 453 315 pd $0-centroid; + #X obj 339 367 set $0-centroid x; + #N canvas 0 0 503 429 create 0; + #X msg 242 258 traverse pd-$1 , bang; + #X obj 242 238 symbol $0-c; + #X msg 107 79 0; + #X obj 242 278 pointer; + #X msg 243 178 clear; + #X obj 243 205 s pd-$0-c; + #X obj 107 302 append $0-centroid x; + #X obj 107 114 t a b b; + #X obj 107 50 loadbang; + #X obj 107 326 outlet; + #X connect 0 0 3 0; + #X connect 1 0 0 0; + #X connect 2 0 7 0; + #X connect 3 0 6 1; + #X connect 4 0 5 0; + #X connect 6 0 9 0; + #X connect 7 0 6 0; + #X connect 7 1 1 0; + #X connect 7 2 4 0; + #X connect 8 0 2 0; + #X restore 468 339 pd create; + #X obj 339 127 metro 50; + #X obj 339 102 tgl 15 0 empty empty show-centroid 17 7 1 10 -258699 + -262144 -1 1 1; + #N canvas 473 338 450 300 countto 0; + #X obj 131 154 f 0; + #X obj 156 153 + 1; + #X msg 174 113 0; + #X obj 131 183 outlet; + #X obj 131 59 inlet; + #X obj 131 116 until; + #X obj 131 96 t a b; + #X connect 0 0 1 0; + #X connect 0 0 3 0; + #X connect 1 0 0 1; + #X connect 2 0 0 1; + #X connect 4 0 6 0; + #X connect 5 0 0 0; + #X connect 6 0 5 0; + #X connect 6 1 2 0; + #X restore 362 195 pd countto; + #X obj 362 219 tabread $0-tab; + #X obj 362 249 list prepend; + #X obj 452 249 t a; + #X msg 362 175 10; + #X obj 339 148 t b b b; + #X obj 339 274 list; + #X text 77 30 Switch on the "show-centroid"-metro and play with the + values in the array.; + #X obj 79 344 loadbang; + #X connect 0 0 1 0; + #X connect 1 0 3 0; + #X connect 2 0 0 0; + #X connect 3 0 4 0; + #X connect 7 0 10 0; + #X connect 8 0 7 0; + #X connect 9 0 10 1; + #X connect 11 0 10 1; + #X connect 12 0 19 0; + #X connect 13 0 12 0; + #X connect 14 0 15 0; + #X connect 15 0 16 0; + #X connect 16 0 17 0; + #X connect 16 0 20 1; + #X connect 17 0 16 1; + #X connect 18 0 14 0; + #X connect 19 0 20 0; + #X connect 19 1 18 0; + #X connect 19 2 16 1; + #X connect 20 0 8 0; + #X connect 22 0 2 0; + #X restore 392 510 pd graphical-centroid; + #X text 321 510 Also see:; #X connect 1 0 6 0; #X connect 2 0 6 0;