This will not work in GOP abstraction as it relies on Editmode. Attached is another xy-controller also "true cross platform". It's done with data structures and fully $0-localized.
great. I like it a lot.
Also should serve as some more advertising for my data structures workshop which probably has a hard time finding an audience, as it's in parallel with the sexy PiDiP workshop. ;)
I'll be there! (cross platform is my 1st priority when using pd : I'm on win/linux and most of my patch should be used on osX...) data structure is something that I want to learn for long time...
cyrille
Only thing: It's hard to hit the controller point with the mouse sometimes (send a bang to reinit then) and the controller currently can go outside the patch area. It's easy to restrict it, though, but I was too lazy to implement this.
Ciao
#N struct 1014-grob-lib-x float x float y array numbers 1014-num-x ; #N struct 1014-num-x float y float x; #N canvas 400 535 211 225 10; #N canvas 621 141 450 300 ds 0; #X text 39 20 A library of graphical objects; #N canvas 525 556 648 345 grob-lib-x 0; #X text 42 137 Arrays are painted using "plot" drawing instructions: ; #X text 44 21 This declares an array named "numbers" whose elements are described by the template "num". Note that array declarations take three arguments: the word "array" , the name of the array and the name of the elements.; #X obj 57 166 plot numbers 0 0 0 0; #X obj 65 100 struct $0-grob-lib-x float x float y array numbers $0-num-x ; #X restore 86 107 pd grob-lib-x; #X text 222 107 num-x plotted; #X text 188 77 float with x and y fields; #N canvas 686 559 581 359 num-x 0; #X text 80 32 The num-x float has an and an x field.; #X text 112 154 A red box visualizes the float values:; #X obj 135 95 struct $0-num-x float y float x; #X obj 91 184 filledpolygon 900 555 1 -5 0 0 5 5 0 0 -5; #X restore 85 77 pd num-x; #X restore 209 186 pd ds; #N canvas 0 0 520 404 engine 0; #X obj 289 112 makefilename pd-%s; #X obj 289 88 symbol $0-p; #X msg 243 59 bang; #X msg 289 139 traverse $1 , bang; #X obj 289 161 pointer; #X obj 472 188 makefilename pd-%s; #X obj 472 164 symbol $0-p; #X msg 472 139 bang; #X msg 472 222 ; $1 clear; #X obj 182 207 append $0-grob-lib-x x y; #X obj 79 199 pointer; #X msg 136 206 bang; #X floatatom 130 317 5 0 0 0 - - -; #X floatatom 257 316 5 0 0 0 - - -; #X obj 65 245 element $0-grob-lib-x numbers; #X msg 65 222 0; #X obj 145 290 get $0-num-x x y; #X obj 195 119 t b b b b; #X obj 176 23 inlet; #X obj 123 48 inlet; #X obj 160 345 outlet; #X obj 226 349 outlet; #X obj 216 325 * -1; #X obj 18 145 metro 100; #X msg 177 163 100; #X msg 230 160 100; #X connect 0 0 3 0; #X connect 1 0 0 0; #X connect 2 0 17 0; #X connect 3 0 4 0; #X connect 4 0 9 2; #X connect 5 0 8 0; #X connect 6 0 5 0; #X connect 7 0 6 0; #X connect 9 0 14 1; #X connect 11 0 10 0; #X connect 14 0 16 0; #X connect 15 0 14 0; #X connect 16 0 12 0; #X connect 16 0 20 0; #X connect 16 1 13 0; #X connect 16 1 22 0; #X connect 17 0 24 0; #X connect 17 1 25 0; #X connect 17 2 1 0; #X connect 17 3 7 0; #X connect 18 0 2 0; #X connect 19 0 23 0; #X connect 22 0 21 0; #X connect 23 0 15 0; #X connect 24 0 9 0; #X connect 25 0 9 1; #X restore 219 104 pd engine; #X obj 165 1 tgl 15 1 empty empty poll -25 10 0 8 -262144 -1 -1 1 1 ; #X obj 211 139 outlet; #X obj 277 143 outlet; #X msg 264 66 bang; #X obj 260 27 loadbang; #X obj 241 14 inlet; #X obj 3 18 cnv 15 200 200 empty empty empty 20 12 0 14 -62784 -66577 0; #N canvas 0 0 450 300 1014-p 0; #X scalar 1014-grob-lib-x 100 100 ; 0 0 ; ;; #X coords 0 200 200 0 200 200 1; #X restore 3 18 pd $0-p; #X connect 1 0 3 0; #X connect 1 1 4 0; #X connect 2 0 1 0; #X connect 5 0 1 1; #X connect 6 0 5 0; #X connect 7 0 5 0; #X coords 0 0 1 1 204 220 1;
#N struct 1014-grob-lib-x float x float y array numbers 1014-num-x ; #N struct 1014-num-x float y float x; #N canvas 122 69 512 495 10; #X floatatom 56 339 5 0 0 0 - - -; #X floatatom 251 344 5 0 0 0 - - -; #X msg 70 46 bang; #X text 114 46 reinit; #X obj 56 107 doll; #X connect 2 0 4 0; #X connect 4 0 0 0; #X connect 4 1 1 0;