Sending a message from MXJ to JS

Feb 17, 2006 at 11:51pm

Sending a message from MXJ to JS

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

#24481
Feb 18, 2006 at 12:03am

Atom[] myout = new Atom[2];

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

#70904
Feb 18, 2006 at 12:04am

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

#70905
Feb 18, 2006 at 12:55am

Thanks Topher !

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

Nat

#70906

You must be logged in to reply to this topic.