multiple inlet jitter object in javascript...(jit.lumakey in js)


    Jan 24 2009 | 10:56 pm
    How does one express the different inputs in the matrixcalc() function?
    This question came up as I tried to debug why my below patch isn't working. Really, I don't even really need multiple inlets, as I'm trying to use jit.lumakey in mode 1....
    Here's my patch and JS:
    /*save as moviekey.js and put in search path */
    autowatch = 1;
    editfontsize = 12;
    var outmatrix = new JitterMatrix();
    outmatrix.adapt=1;
    var dummatrix = new JitterMatrix();
    dummatrix.adapt=1;
    var lumakey = new JitterObject("jit.lumakey");
    lumakey.mode = 1;
    lumakey.fade = 0.1;
    lumakey.lum = 0;
    var matrixname = "movmatrix";
    var usethismatrix = "";
    function jit_matrix(inname){
    outmatrix.setinfo(inname);
    lumakey.matrixcalc(inname,outmatrix);
    outlet(0,"jit_matrix",outmatrix.name);
    }

    • Jan 25 2009 | 10:41 am
      well, I'm not 100% sure on this, but you should be able to send array
      of matrix names as input to matrixcalc:
      lumakey.matrixcalc( [inname, in2name] , outputmatrix);
      hth,
      nesa
    • Jan 25 2009 | 4:41 pm
      yes, that helps. thanks for the clue. for the record, here's a script that works:
      autowatch = 1;
      editfontsize = 12;
      var outmatrix = new JitterMatrix(4,"char",320,240);
      outmatrix.adapt=1;
      var dummatrix = new JitterMatrix(4,"char",320,240);
      dummatrix.adapt=1;
      var lumakey = new JitterObject("jit.lumakey");
      lumakey.mode = 1;
      lumakey.fade = 0.1;
      lumakey.lum = 0;
      lumakey.adapt = 1;
      var matrixname = "movmatrix";
      var usethismatrix = "";
      function jit_matrix(inname){
      outmatrix.setinfo(inname);
      dummatrix.setinfo(inname);
      lumakey.matrixcalc([inname,dummatrix],outmatrix);
      outlet(0,"jit_matrix",outmatrix.name);
      }