js live.object slow?
Hi,
Im trying to replicate the live.object functionality with JS.
Im sending multiple ids with parameter values into this script, but the JS is really slowing down after a few parameters are being moved.
var myval=0;
if (jsarguments.length>1)
myval = jsarguments[1];
function list()
{
var a = arrayfromargs(arguments);
var path = "id " + a[0] ;
var api = new LiveAPI( this.patcher, path );
api.set('value', a[1]);
}
Anyone know why this is? Can JS just not handle lots of information coming in at once? Is there any way to improve the speed? Ive tried qlim and speedlim, but those just stop the parameters from moving when the JS gets overloaded.
I wouldn't create the LiveAPI object every time - this is not a particularly cheap operation (iirc) - you should probably store a list of LiveAPI objects for an id and re-use them when you need it.
Saying that though, I used to do this and in the end I stopped using js for updates back to live - it's just nowhere near as efficient as using a live.object from MAX
btw, how many things are you trying to update at once?