Forums > Java

Sending a message from MXJ to JS


Nat
February 17, 2006 | 11:51 pm

Hello, I have an MXJ connected to a JS and I need them to communicate.

In my JS script I have a function called "get_min_max" that I want to use to gather 2 values from MXJ. In MXJ I am trying to send out this message through an outlet but from what I understand, the whole message is treated as a symbol so JS doesn’t understand it. Here is the message I am trying to send (using a cable between MXJ and JS) :

outlet(0,"get_min_max "+low_sample+" "+high_sample);

get_min_max being the name of the function and low_sample and high_sample being the 2 arguments I want to send. Any efficient way of doing this ?

Thanks,

Nat


February 18, 2006 | 12:03 am

Atom[] myout = new Atom[2];

myout[0] = Atom.newAtom(min);
myout[1] = Atom.newAtom(max);
outlet(0,"get_min_max ",myout);


February 18, 2006 | 12:04 am

once java 1.5 is a little more entrenched on OS X
we can look at providing outlet(String msg, …)
type of functions.
topher



Nat
February 18, 2006 | 12:55 am

Thanks Topher !

Had forgotten about Atoms, will have to dig deeper into that !

Nat


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