Forums > Java

Receiving object values

April 13, 2009 | 5:29 pm

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


April 15, 2009 | 6:08 am
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.



Ch
April 15, 2009 | 8:28 pm

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.


April 15, 2009 | 8:43 pm
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.



Ch
April 15, 2009 | 8:49 pm

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


Viewing 5 posts - 1 through 5 (of 5 total)