Sending messages to an inlet of an object using javascript

    Jun 28 2013 | 12:55 pm
    Hi I'm struggling with a patch I'm writing. It generates a load of elements and I need to send a list to an inlet object in order to initialise everything. the message() function looks like it should work but I keep getting messages saying that inlet does not understand the message. Can anyone point out what I'm dong wrong? This is the code I am using:
    pan[i].subpatcher().getnamed("inlet").message("id "+a[(2*i)+2]);
    Many thanks in advance

    • Jun 28 2013 | 1:19 pm
      if your message stands for list then u need to separate these guys with comma eg : message("id",1,2,3,4) ;
    • Jun 28 2013 | 1:25 pm
      Hi Krisw I've tried that as well, the code I posted was after a few desperate changes. I still get exactly the same message. I could rewrite it using a spray but it would just be so much more elegant to be able to send the message directly from javascipt.
    • Jun 28 2013 | 1:30 pm
      perhaps that INLET wont pass that message through , im not sure (i cant check it now ) but inlet may think that you dedicated this message only for him . but i might be wrong . . . experiment with receive (give it a JS name) send to it your message , if it doesnt work try without "id" but prepend it after the receive object . sorry i cant check it now
    • Jun 28 2013 | 1:32 pm
      Ok thanks for your help. I have a feeling that there must be some kind of prefix that needs to be there so Max knows the message is for the actual object and not the object box but I can't find what it might be.
    • Jun 28 2013 | 1:34 pm
      let me know if you will find out , im interested
    • Jun 28 2013 | 3:39 pm
      The inlet object has indeed no input (it is an input) and doesn't understand any message.
      You may want to send your message to the object(s) connected to inlet's output. Or connect js' output to the input of the subpatch...
    • Jun 28 2013 | 3:43 pm
      You are completely correct that is a mistake on my part. Basically what i was trying to do was send a message to the inlet of a bpatcher and in my frustration switched to trying send it to the inlet itself. But i was having exactly the same problem in that it said it didn't understand the message. I'll have another try.
    • Jun 28 2013 | 3:47 pm
      patrick has good suggestion to connect JS directly to bpatcher .
      also u can send list's to a RECEIVE (with scripting name) then prepend that list with "id" into bpatcher . i just tried that
    • Jun 28 2013 | 4:11 pm
      Yeah that's what I've ended up doing ti was just a bit ugly as there are several objects that need to be connected and I need to use a spray etc. I just thought it would be an easy solution but anyway thanks for the help guys :)