Forums > Java

How to read value of a variable "value x" (without sending bang to a "v x" obj)

Oct 21 2010 | 5:37 am

I have multiple "v x" in my patches.
Now, in my mxj object, I need value of x.

I DON’T want to have a trigger at input of "v x" which sends the value out every time it changes.

I just want to read value of "x" when I need, synchronously.

How I can do this in mxj ?


Oct 24 2010 | 6:02 pm

it’s not pretty, but you could use this.getPatcher() to get the patcher your MXJ is in, then create a new val box with the same name as your other val using MaxPatcher.newObject() or newDefault, connecting it to an inlet on your MXJ, and then send it a bang. you would have to set up a method in your object to receive that message. you can then destroy the extra val object with MaxBox.remove().

Oct 28 2010 | 10:43 am

Hi, that’s what I want to avoid…
Strange that there is no way to access "v" value


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

Forums > Java