Efficiency: communicating with UI objects remotely

Jan 9, 2007 at 5:52pm

Efficiency: communicating with UI objects remotely

I am creating a system for use in pluggo plug-ins that will allow for the pp and plugmultiparam objects to be in a separate subpatch. Right now, I am communicating with the UI through pattrstorage @outputmode 1 and routing the names of each interface object to the appropriate pp, etc. Then on the way back, I prepend the object name to the output of pp and send back to pattrstorage. I am curious if there is a more efficient way to do this without pattrstorage. Would using indivudually named pattr objects be more or less efficient? Any thoughts?

#29580
Jan 9, 2007 at 6:13pm

autopattr might qualify as more efficient,
but you shouldn’t need to worry too much about efficiency with pattr; i would personally be more worried about your synthesis.

btw: even if all of your UIobjects are at the top level, you can refer to that locale via pattrhub from a subpatch…
see the help file.

jl

p.s. in the future please post stuff like this to the pluggo forum…

#92845
Jan 9, 2007 at 6:15pm

As a side question, I am wondering if will changing the outputmode to 2, 3 , or 4 will speed things up by eliminating loops when interface objects are changed…

#92846
Jan 9, 2007 at 6:42pm

just depends on the functionality that you need.
if you were to post a patch illustrating this issue, it would be easier to help.
modes 2/3 seem reaonable for various setups pluggo; but it is difficult to conjecture without an example.

if you simply need to get info to the objs, then it would certainly speed things up.

jl

#92847
Jan 9, 2007 at 7:32pm

Here is the simplest way I can present the issue:

max v2;
#N vpatcher 97 53 488 274;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 73 88 70 196617 outputmode 4;
#P message 63 70 70 196617 outputmode 3;
#P message 54 52 70 196617 outputmode 2;
#P newex 245 147 53 196617 autopattr;
#X prestore dial 1 0 0;
#X prestore gain~ 1 0 91;
#X prestore uslider 1 0 0;
#P objectname u586000007;
#P user dial 251 93 40 40 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P objectname dial;
#P user gain~ 211 53 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~;
#N vpatcher 7 89 426 389;
#P window setfont “Sans Serif” 9.;
#P number 36 165 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 36 139 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P outlet 81 203 15 0;
#P window linecount 1;
#P newex 254 164 79 196617 prepend uslider;
#P newex 254 116 68 196617 route uslider;
#N pp 3 uslider 0 127;
#P newobj 254 139 93 196617 pp 3 uslider 0 127;
#P inlet 81 73 15 0;
#P newex 173 164 64 196617 prepend dial;
#P newex 173 116 53 196617 route dial;
#N pp 2 dial 0 127;
#P newobj 173 139 78 196617 pp 2 dial 0 127;
#P newex 81 164 72 196617 prepend gain~;
#P newex 81 116 61 196617 route gain~;
#N pp 1 gain~ 0 157;
#P newobj 81 139 86 196617 pp 1 gain~ 0 157;
#P connect 1 0 11 0;
#P connect 6 0 1 0;
#P connect 1 0 0 0;
#P connect 12 0 2 0;
#P connect 0 0 2 0;
#P connect 2 0 10 0;
#P fasten 5 0 10 0 178 193 86 193;
#P fasten 9 0 10 0 259 193 86 193;
#P fasten 6 0 4 0 86 101 178 101;
#P connect 4 0 3 0;
#P connect 3 0 5 0;
#P fasten 6 0 8 0 86 101 259 101;
#P connect 8 0 7 0;
#P connect 7 0 9 0;
#P pop;
#P newobj 54 138 74 196617 p pp’s-in-here;
#B color 5;
#P user uslider 308 52 23 106 128 1 0 0;
#P objectname uslider;
#P newex 54 116 138 196617 pattrstorage @outputmode 1;
#X client_rect 0 0 640 240;
#X storage_rect 0 0 640 240;
#P objectname u857000006;
#P connect 8 0 0 0;
#P connect 7 0 0 0;
#P connect 6 0 0 0;
#P fasten 2 0 0 0 59 160 46 160 46 112 59 112;
#P connect 0 0 2 0;
#P pop;

#92848
Jan 15, 2007 at 8:46am

i understand your issue a bit better now;
in regards to your original question, there are no loops involved in this process, per se.
you’re simply sending to/receiving from 2 destinations instead of 1.
unless you have a specific need for using an outputmode, i think it will be much more efficient to skip it altogether and go for something more direct (also saves on the usage of the route/prepend pair for each param):

#P window setfont Geneva 9.;
#P window linecount 1;
#P comment 47 170 17 11337737 -jl;
#P window setfont “Sans Serif” 9.;
#N pp 3 uslider 0 127;
#P newobj 439 60 93 9109513 pp 3 uslider 0 127;
#N pp 2 dial 0 127;
#P newobj 346 88 78 9109513 pp 2 dial 0 127;
#N pp 1 gain~ 0 157;
#P newobj 306 60 86 9109513 pp 1 gain~ 0 157;
#P window setfont Geneva 9.;
#P flonum 157 67 35 9 0. 1. 3 173 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 156 84 65 11337737 recall 1 2 $1;
#P message 107 80 41 11337737 store 2;
#P message 107 63 41 11337737 store 1;
#P window setfont “Sans Serif” 9.;
#P newex 213 141 53 9109513 autopattr;
#X prestore dial 1 0 14;
#X prestore gain~ 1 0 123;
#X prestore uslider 1 0 28;
#P objectname u945000010;
#P user dial 346 111 40 40 128 1 0 0 159 270 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P objectname dial;
#P user gain~ 306 83 24 100 158 0 1.071519 7.94321 10.;
#P objectname gain~;
#P user uslider 439 82 23 106 128 1 0 0;
#P objectname uslider;
#P newex 55 123 58 9109513 pattrstorage;
#X client_rect 0 0 640 240;
#X storage_rect 0 0 640 240;
#P objectname u203000013;
#P window setfont Geneva 9.;
#P number 27 50 35 9 1 4 3 173 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P message 27 71 70 9109513 outputmode $1;
#P window setfont Geneva 9.;
#P comment 45 154 149 11337737 outputmode is 0 (off) by default;
#P connect 1 0 3 0;
#P connect 2 0 1 0;
#P connect 9 0 3 0;
#P connect 8 0 3 0;
#P connect 10 0 3 0;
#P fasten 6 0 13 0 351 157 341 157 341 83 351 83;
#P fasten 4 0 14 0 444 210 431 210 431 55 444 55;
#P fasten 5 1 12 0 325 214 299 214 299 56 311 56;
#P connect 13 0 6 0;
#P connect 14 0 4 0;
#P connect 12 0 5 0;
#P connect 11 0 10 0;
#P window clipboard copycount 16;

#92849

You must be logged in to reply to this topic.