JavaScript in Max

Two sides to javascript: core and client-side. Max only deals with core JavaScript since client-side generally deals with web pages. Additionally, the Max version of js has some extra features to incorporate inlets, outlets, and Max messages.

Command + Double-Click on the js object in max opens the js coding window. The default object has one inlet and outlet, but can add more by typing things like “outlets = 2;” .

 

Create functions to handle incoming messages:

function name_of_function_corresponding_to_desired_input_message ()

{

output(0, “Desired Output String”);

}

 

Save script as a .js file somewhere in the max search path, then create a js object with the filename as an argument

Bookmark the permalink.

Comments are closed