I'm having a problem with splitting strings in Javascript in Max/MSP.
outlet is the Max/MSP version of printf etc.
The string splits weirdly, but it seems to only output both words comma seperated.
function sample_callback(args) // Callback
{
var keyword=args;
var trackname=keyword.toString().split(" ");
var name = trackname[0]; // trackname[1] outputs nothing.
outlet(0, name);
}
Any help is greatly received.
sample_callback
, and the definition ofoutlet
. BTW: if you're coming from a C/C++ background, bear in mind that JS has more in common with Scheme/Lisp, so treat functions as objects (pass them as arguments/return values at will) – Pisanokeyword.toString()
? – Greedy