multi observer with js


    Sep 14 2012 | 7:07 pm
    hi. 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:
    inlets=1;
    outlets=2;
    
    function list()
    {
    var input;
    if(inlet==0)
    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 | 8:27 pm
      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]);
              outlet(1, this.id);
          }
      }
      
    • Oct 23 2020 | 9:43 pm
      this still works and is very useful, thanks!
    • Oct 24 2020 | 8:50 am
      nice. with max 8 ? - i haven´t used it since version 6 i think . what are you using it for ? you can easily modify it to observe other objects as well . if my memory is not wrong .
    • Oct 24 2020 | 10:16 am
      i use it in maxforlive (Max 8.1.5) with Live 10. Now i just have to figure out how to use it on more than one device :)
      My goal is to build a device that can save various states of all plug ins on a given track, Only changed values should be saved and recalled.
    • Oct 24 2020 | 11:46 am
      since the id numbers are specific for every single object there is no need to change anything . i guess . except giving it a name to identify your observed data . you might want to filter / group the ids after the object is spitting them out . this way you will have some kind of global observer for every device / id you are feeding in to it. you might run into problems depending on how many ids you are feeding . processing wise. i would create one multiobserver object per device to seperate the huge number of data you will get .
    • Oct 24 2020 | 11:47 am
      during the time i was playing around with this there was a device made called kapture that has similar capabilities.
    • Oct 24 2020 | 11:48 am
      https://www.ableton.com/de/packs/kapture/