Receiving object values

Apr 13, 2009 at 5:29pm

Receiving object values

Very simple question. I was wondering if there is a way to get values from an object you have created in a patcher? Say if I create a slider using java and then later change the sliders value by hand, is there a way for my mxj object to read this without using patchcords?

Thanks,

Alex

#43349
Apr 15, 2009 at 6:08am
ADwellingOx wrote on Mon, 13 April 2009 10:29
is a way to get values from an object you have created in a patcher? Say if I create a slider using java and then later change the sliders value by hand, is there a way for my mxj object to read this without using patchcords?

No, I don’t think this is currently possible with mxj.

You could connect the object to mxj by using the MaxPatcher.connect() method (possibly with a [prepend objectname] in between so you can keep track of what’s what).

Another option might be to connect a pattrstorage to mxj with an appropriate outputmode setting. Check out the pattrstorage help file, set the outputmode in the “misc” subpatch, and then change the number boxes to see how this works. This is probably what I would use if I were trying to do what you want.

#155490
Apr 15, 2009 at 8:28pm

Interesting. I like the pattrstorage trick Adam.

But about the “no patchcord at all” :

Quote:
No, I don’t think this is currently possible with mxj.

Do you know if it is possible in C?
Ch.

#155491
Apr 15, 2009 at 8:43pm
Ch wrote on Wed, 15 April 2009 13:28
But about the “no patchcord at all”

Do you know if it is possible in C?

Yes, if you really want no patchcords, C would be the way to go. There’s a notification system to handle this. I think you want something similar to the [pattr] object’s bindto feature. That’s implemented in C…

It may not work with every object, but it should be fine for the basic stuff like monitoring a slider value. I’m just learning this stuff myself, and it doesn’t seem to be well documented yet. If you download the SDK, the iterator example might get you started. Then you can try asking on the Dev forum if you get stuck.

#155492
Apr 15, 2009 at 8:49pm

Thanks for your answer! I’ll have a look at that.

#155493

You must be logged in to reply to this topic.