object_attr_touch() , notify/redraw connected attrui

Feb 24, 2012 at 4:04pm

object_attr_touch() , notify/redraw connected attrui

is there a way to tell an attribute that it has been modified not by the setter?
so that for example attrui objects connected to my object would get notified and redrawn with the new value, although i used another function to change the value?

i found object_attr_touch() in the sdk, but it is not implemented.

Feb 25, 2012 at 11:06am

What do you mean by it’s not implemented?

With Max 6.0.4 SDK you should be able to do something like this:

// anywhere, decide you need to change the toto attribute (who binds to the j_toto variable in your object structure
// instead of calling object_attr_setlong((t_object *)x, gensym("toto"), 74) which would call the settr, you can set the value directly
x->j_toto = 74;

// and call
object_attr_touch((t_object *)x, gensym("toto")); // so the toto attribute notify anyone who want to know

In Max 5, you’ll have to get the attribute object and then send the attr_modified notification.


Feb 26, 2012 at 10:16am

object_attr_touch() is documented, but I get a compiler error.
I’m using the latest sdk.

ndefined symbols for architecture i386:
“_object_attr_touch”, referenced from:
_note_notify in note~globalUtilities.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status


Feb 26, 2012 at 5:05pm

Hi Thomas,

that’s weird… I am calling object_attr_touch() without problems…
I am on MacOS 10.7.2 using Max/MSP SDK 6.0.0
I found other functions that are not exported, but object_attr_touch() works perfectly over here.

Could it be a problem with SDK 6.0.4 only ?

- Luigi

Feb 26, 2012 at 6:09pm

It’s working for me using Max 6.0.4 SDK.

In Max 5, you can do something like this:

t_object *attr = object_attr_get(x, gensym("yourattr"));

if (attr) {
object_notify(x, gensym("attr_modified"), attr);

Feb 27, 2012 at 12:56pm

thanks and sorry to both of you.
my fault, had a mess with my search paths, it is working with SDK 6.04.


You must be logged in to reply to this topic.