pattr and "set $1" message

Mar 5, 2008 at 7:48pm

pattr and "set $1" message

i get an error message when using the “set $1″ message with pattr whereas the same message works fine with pvar.

“? warning: set: bad number”

#36202
Mar 5, 2008 at 7:50pm

oops…. my message has been truncated , here is the entire message :

i get an error message when using the “set $1″ message with pattr whereas the same message works fine with pvar.

“warning: set: bad number”

#124081
Mar 5, 2008 at 7:51pm

the patch i ment to attach in my post

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 276 202 20 196617 64;
#P message 260 202 14 196617 0;
#P message 260 220 39 196617 set $1;
#P newex 260 242 49 196617 pvar bob;
#P message 264 153 50 196617 0;
#P newex 264 127 62 196617 prepend set;
#P message 280 62 20 196617 64;
#P message 264 62 14 196617 0;
#P message 264 80 39 196617 set $1;
#P user hslider 34 163 18 128 128 1 0 0;
#P objectname bob;
#P newex 264 101 75 196617 pattr bob_ bob;
#X prestore 1 0 0;
#P objectname bob_;
#P comment 34 148 100 196617 name : bob;
#P connect 1 0 6 0;
#P connect 6 0 7 0;
#P connect 9 0 8 0;
#P connect 10 0 9 0;
#P connect 11 0 9 0;
#P connect 3 0 1 0;
#P connect 5 0 3 0;
#P connect 4 0 3 0;
#P window clipboard copycount 12;

#124082
Mar 5, 2008 at 8:14pm

easily solved by looking at the help file.
pvar and pattr are not the same object.
get rid of the the “set $1″ message to the pattr.

#124083
Mar 5, 2008 at 8:47pm

thanks rob, i know that pvar and pattr are not the same, i was just wondering why the ” set $1″ message does not work in pattr’s case .
i have modules with many pattr objects nested . the ui they refer to need to be resetted once in a while therefore these uis need to receive messages such as “set 0″ ( for a slider or a numberbox for instance), as my pattr architecture is more or less established i was planning to do these resets via the pattr objects … which does not work and i just wanted to avoid using pvar for that purpose .
so why does the “set $1″ message not work with pattr ?

Quote: robtherich wrote on Wed, 05 March 2008 21:14
—————————————————-
> easily solved by looking at the help file.
> pvar and pattr are not the same object.
> get rid of the the “set $1″ message to the pattr.
—————————————————-

#124084
Mar 5, 2008 at 10:25pm

Quote: (karrrlo) wrote on Wed, 05 March 2008 21:47
—————————————————-
> so why does the “set $1″ message not work with pattr ?

It just doesn’t: the pattr architecture doesn’t support it.

In Max 5, pattr has a new @thru attribute, which prevent output from the object until it receives a bang. This may solve some of your problem.

But it seems to me that you want to be looking at pattrforward, which you can use to send arbitrary messages to named objects, rather than pattr, which is used to handle state.

jb

#124085
Mar 5, 2008 at 11:12pm

Quote: Jeremy Bernstein wrote on Wed, 05 March 2008 23:25
—————————————————-
> Quote: (karrrlo) wrote on Wed, 05 March 2008 21:47
> —————————————————-
> > so why does the “set $1″ message not work with pattr ?
>
> It just doesn’t: the pattr architecture doesn’t support it.

oh ok, good to know

>
> In Max 5, pattr has a new @thru attribute, which prevent output from the object until it receives a bang. This may solve some of your problem.

great ! cant wait for max5 :-)

>
> But it seems to me that you want to be looking at pattrforward, which you can use to send arbitrary messages to named objects, rather than pattr, which is used to handle state.

of course , i always forget about pattrforward which i have been pointed to several times on this forum , my bad .
anyway thanks for help Jeremy

>
> jb
—————————————————-

#124086
Mar 5, 2008 at 11:27pm

karl-otto von oertzen schrieb:
> the ui they refer to need to be resetted once in a while therefore
> these uis need to receive messages such as “set 0″ ( for a slider or
> a numberbox for instance)

I use pattrforward for this purpose, pattr is saving a state, its not
sending a message to the object its bound to…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#124087

You must be logged in to reply to this topic.