send message to line


    Oct 08 2006 | 4:03 pm
    HEllo,
    I made a script which make a string like :
    function bang(){
    var a="0 100 0 200";
    outlet(0,a);
    }
    and I send it to a line~ object in order to make a complex (or not) envelop to drive a *~ object.
    every time i get the message:
    error: line~doesn't understand "0 100 0 200"
    If I make a messagebox with "0 100 0 200" in it and send it to the line~, no problem.
    WHat is the way to format it with js?
    David from France

    • Oct 08 2006 | 4:12 pm
      On 8 oct. 06, at 18:03, martinex wrote:
      > I made a script which make a string like :
      >
      > function bang(){
      > var a="0 100 0 200";
      > outlet(0,a);
      > }
      >
      > and I send it to a line~ object in order to make a complex (or not)
      > envelop to drive a *~ object.
      >
      > every time i get the message:
      > error: line~doesn't understand "0 100 0 200"
      Hi,
      As the error message suggests, you're sending a wrong message to the
      line~ object. You need to send a "list" (an Array in js), or send the
      values directly.
      function bang() {
      outlet(0, 0, 100, 0, 200);
      }
      or
      function bang() {
      // array solution 1
      var a = [ 0, 100, 0, 200 ]; // create an array of for elements
      outlet(0, a);
      }
      or
      function bang() {
      // array solution 2
      var a = new Array(4);
      a[0] = 0;
      a[1] = 100;
      a[2] = 0;
      a[3] = 200;
      outlet(0, a);
      }
      Best,
      ej from France too (the world is really small, isn't it?)
    • Oct 08 2006 | 4:20 pm