Here's a prototype using data structures. It has "springs" instead of hard proportions, but it obeys the limits of the slider, which gets closer to an rslider. I think there's a hack to get it to obey hard proportions. Also, I'm just working with one scalar so I'm not sure if I've got class-wide state in the patch (as opposed to "per-scalar" state by storing it as fields in the struct).
Of course this is one of those Pd-style prototypes where it becomes increasingly difficult to do anything beyond the prototype. Try to encapsulate it in an abstraction and you deal with gop resizing issues and state-saving issues. For that matter, try making it resizable and you give up the hard boundaries since quanta values don't accept variables. -Jonathan
#N struct rslider float x float y float min float max float slider ; #N canvas 55 40 450 300 10; #N canvas 214 83 606 534 rslider 0; #X obj 126 53 struct rslider float x float y float min float max float slider; #X obj 126 423 filledpolygon 900 0 1 min(0:1)(0:100) 0 min(0:1)(5:105) 5 min(0:1)(5:105) 0 slider(0:1)(10:110) 0 slider(0:1)(10:110) 5 slider(0:1)(20:120) 5 slider(0:1)(20:120) 0 max(0:1)(25:125) 0 max(0:1)(25:125) 5 max(0:1)(30:130) 0 max(0:1)(25:125) -5 max(0:1)(25:125) 0 slider(0:1)(20:120) 0 slider(0:1)(20:120) -5 slider(0:1)(10:110) -5 slider(0:1)(10:110) 0 min(0:1)(5:105) 0 min(0:1)(5:105) -5; #X obj 126 95 route change; #X obj 126 219 -; #X obj 126 165 change; #X obj 126 188 t a a; #X obj 181 288 +; #X obj 126 288 +; #X obj 126 328 set rslider min max; #X obj 126 117 trigger anything anything; #X obj 126 241 t a a; #X obj 126 143 get rslider slider min max; #X obj 127 389 drawpolygon 0 1 -1 -7 132 -7 132 7 -1 7 -1 -7; #X connect 0 0 2 0; #X connect 2 0 9 0; #X connect 3 0 10 0; #X connect 4 0 5 0; #X connect 5 0 3 1; #X connect 5 1 3 0; #X connect 6 0 8 1; #X connect 7 0 8 0; #X connect 9 0 11 0; #X connect 9 1 8 2; #X connect 10 0 7 0; #X connect 10 1 6 0; #X connect 11 0 4 0; #X connect 11 1 7 1; #X connect 11 2 6 1; #X restore 245 105 pd rslider; #X obj 257 199 s foo; #X obj 257 221 namecanvas foo; #X scalar rslider 62 105 0.38 0.77 0.56 \;; #X msg 257 177 scalar rslider2 20 20; #X connect 4 0 1 0;
_______________________________________________ [email protected] mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
