Feb 11, 2013 at 2:32pm
I’m getting the object like this
Then sending the message like this
I’m also sending a list of x+y coordinates, correctly formatted with commas, as far as I know.
I get this message – “function: doesn’t understand “sustain 3 0″”
Now if I do a bit of symbol fiddling in the Max environment I can get it to update the function object with the right values, but why can’t I do this directly from JS?
Feb 11, 2013 at 5:14pm
This will send the symbol sustain with 2 arguments.
Feb 12, 2013 at 12:21am
Thanks EJ, does that mean all objects I’m sending lists to should be formatted in this way?
Feb 12, 2013 at 1:49pm
Yes or you can pass an array which will be unrolled automatically.
You can also use the literal notation.
Feb 22, 2013 at 12:40am
I’ve another question which might come under this topic.
However when sending the same message to Pattrstorage using setstoredvalue, I seem to be setting things that I shouldn’t be.
The first four items in the array seem to start with the length(domain) of the Function object, two of the others might be the Lo and Hi Display Range. Also, Am I right in thinking that the array changes for a sustain point too? Does this make any sense?
Is there any documentation on how the Pattr system stores lists related to UI objects?
Mar 1, 2013 at 3:38pm
OK so it appears that,
 = domain length
Then what follows are the points of the function, and after each point a ’0′ or ’2′. Zero indicates no sustain, while 2 means sustain is on.
So an array with the following, creates an ADSR, with 270 being the length, and the range being from 0 – 1.
270, 0, 1, 0, 0, 0 , 15.97, 1, 0, 71.42, 0.62, 0, 179.38, 0.57, 2, 269.99, 0, 0
270(length), 0(lo), 1(hi), 0, 0, 0(point1), 15.97, 1, 0(point2), 71.42, 0.62, 0(point3), 179.38, 0.57, 2(point4 w sustain), 269.99, 0, 0(point5)
Please correct me if I’m wrong, but that’s working OK for me now.
You must be logged in to reply to this topic.