jklabs :: MaxLink

about news downloads reference applications faq credits

MaxLink class functions 0.3b

MaxLink(Object parent, String name)
MaxLink link = new MaxLink(this, "test_sketch");
Constructor. Takes a reference to the parent object (the sketch) and a reference name (usually the name of the sketch).

declareInlet(String varName)
link.declareInlet("xPosition");
Creates an inlet in the corresponding Max object that maps to the specified variable. The variable must be declared as public (i.e. public float varName;).

declareInlet(String varName, String setterFunctionName)
link.declareInlet("xPosition", "setX");
Creates an inlet in the corresponding Max object and sets a function to call when input is received in the inlet. The setter function must be public, and have a single parameter of type equal to varName's class. (That is, if xPosition is a float, the setter function should be public void setX(float newX).)

declareMaxFunction(String functionName)
link.declareMaxFunction("printVars")
Declares a Processing function to be accessible from Max. The function must be public, and not have any parameters.

ouput(int i)
link.output(42);
Sends an int out of the default (leftmost) outlet.

ouput(float f)
link.output(27.33);
Sends a float out of the default (leftmost) outlet.

ouput(String s)
link.output("hi max!");
Sends a String out of the default (leftmost) outlet.

ouput(int outletNumber, int i)
link.output(0, 42);
Sends an int out of the specified outlet.

ouput(int outletNumber, float f)
link.output(1, 27.33);
Sends a float out of the specified outlet.

ouput(int outletNumber, String s)
link.output(2, "hi max!");
Sends a String out of the specified outlet.