I have a bunch of declared attributes that i am trying to make visible to a pattrstorage that will save within the set automatically.
that is a somewhat convoluted question, i think. sorry.
I tried attaching a pattr to the js, to no avail. i tried an array passed in setvalueof and getvalueof.
What should i do to make jsattributes work with pattrstorage
Re: What should i do to make jsattributes work with pattrstorage
I had problems with that bit earlier in my js career. I think that you can only actually save one attribute per js with a linked pattr. I merely seperate an array with a symbol, and parse it back in when I reload the patch. Have a look at my collstore js, it might be a possible solution for you:
http://cycling74.com/forums/topic.php?id=29649
There's also a link on my blog page.
Cheers
http://cycling74.com/forums/topic.php?id=29649
There's also a link on my blog page.
Cheers
http://www.aumhaa.com for Monomod and other m4l goodies.
Re: What should i do to make jsattributes work with pattrstorage
!!!!!!. After rereading your post, i think I should clarify....i am completely ok with saving one attribute per pattr, but i am having trouble getting it to actually save and recall. with one pattr per attribute, if i hit pattrstorage with grab, it sees all of the new values. But that seems to do me no good.
But thank you for the excellent patch, I may resort to it if a few other options don't pan out.
But thank you for the excellent patch, I may resort to it if a few other options don't pan out.
Re: What should i do to make jsattributes work with pattrstorage
and to be even more clearer...i don't even need the pattrstorage if it can be avoided.
Re: What should i do to make jsattributes work with pattrstorage
Right....sorry, I didn't mean that my patch itself was the solution, just that the method I used for linking the js to a pattr worked. There is no need for custom get/set attribute functions if you are only linking it to a single variable. By default, getvalueof() will be called when the pattr requests it. setvalueof() is called when the pattr pushes a value to the js (most often, when the patch loads). If you call notifyclients() whenever the js receives a new value, then the pattr will call getvalueof() to request the new value. Take a look at those two functions in the script I linked, I think you will see what I mean. Without seeing exactly what you're doing, that's all I have to offer. Maybe you already have that bit working....I think I misread your initial post, as well. I had a good deal of trouble when I first started trying to link pattrs to js's, and almost gave up. Now that I have it working, it works well and is very efficient.
You shouldn't need a pattrstorage, just a pattr that is parameter-enabled.
You shouldn't need a pattrstorage, just a pattr that is parameter-enabled.
http://www.aumhaa.com for Monomod and other m4l goodies.
Re: What should i do to make jsattributes work with pattrstorage
Turns out I had the answer after all. My problem was that I was binding directly to the attribute. If I bound to a number object via the middle outlet and set that from my js, I was fine. I was trying to avoid this method for some silly forgotten reason. I think I had it in my head that binding to the attribute should have been easier.
( on second thought, the real culprit is my time away from js-max-patching)
( on second thought, the real culprit is my time away from js-max-patching)