multi observer with js

Sep 14, 2012 at 7:07pm

multi observer with js

my js knowledge is very little but i figured how to observe multiple ids already .
i´d like to have an js object / observer thats capable of getting large lists of ids in its input, store those in an array, observe them and spit out the changed value and its id .got pointed in the right direction already but the script i wrote is crashing ableton when using track send ids and moving a send. maybe its also some inefficiency in the script i wrote . does not happen if i feed it with track_activator ids .
could someone else please have a look at that ?

here´s what i did:


function list()
var input;
input=arrayfromargs(arguments); // makes an array called "input" from the input list
post("the list contains",arguments.length, "elements"); // how many elements ( ids ) has our input list
post(input[0]); // post the first element (id) just to check its working

var api = new Array();

for (n=0;n
Sep 14, 2012 at 8:27pm

Never mind . Thank you apask. !!!
Works with all ids you feed it with ( as a list )

Here it is:

inlets = 1;

outlets = 2;

sendids = new Array();

prev = -1;

function list() {

    if (arguments.length) {

        nids = arguments.length;

        if (prev > nids) {

            sendids.length = 0;

            post("nids =", nids, "n");

        prev = nids;

        for (i = 0; i < nids; i++) {
            sendids[i] = new LiveAPI(callback, "id "+arguments[i]);
            sendids[i].property = "value";
            sendids[i].id = "id";
    function callback(args)
        outlet(0, args[1]);

You must be logged in to reply to this topic.