Pattrstorage and Preset in M4L
I'd like to save presets inside an amxd file, what works well, if i don't use "pattrstorage", but only the "preset" object connected to UI elements (saved presets shows up when loading the device, as they are included in the patcher). But when I add a "pattrstorage" object and connect the "preset" object to it (via the pattrstorage attribute), then the presets won't be included in the patcher, patchstorage object won't save its state in the patcher, only the last state to use as initial state when loading the device...
Do i make something wrong, or misunderstood its way of working? Is there a workaround to solve this?
I need the "pattrstorage" connected to the "preset" object, because i use the recallmulti message heavily in my current patch...
I've attached a demo device how i try to use it!
thanx in adv,
Kevin
In the pattrstorage help there is a tab for M4L sayin': "Paste the patch below into a Max for Live device, then store a preset in the pattrstorage and save the device. The resulting preset will be embedded in the device, so there's no need to save the presets as a separate external file." But i can't get this to work somehow if it's connected to a "preset" object... should the preset object be disconnected to get this work with the patch previously posted?
Hmmm. Don't think M4L can work with the orig. (pre-MaxForLive) Max/Msp Presets object, nor does the presets object know of the pattr world: the " presets" in the demo patch are numbered, and stored in pattrstorage, written as json: not associated with memory spots in the presets object...the presets obj and pattrstorage are different "preset" mechanisms: one is old school Max./msp (presets) and the new M4L API and the Live automation does not see the internal preset values in the presets obj.
They are not meant to work together, and I do not know what the results of trying to get them to work together would be, except frustrating?
good luck,
cfb
aka
j2k
hmmm... sorry, i'm not totally understand what you tried to tell...
Do you say pattrstorage can't save it's several saved states (presets) in the amxd file, only in a JSON external file?
then what is it in the helpfile of pattrstorage:
"Paste the patch below into a Max for Live device, then store a preset in the pattrstorage and save the device. The resulting preset will be embedded in the device, so there's no need to save the presets as a separate external file."
it says for me, pattrstorage can save it's presets into the amxd file. Am i wrong?
also i don't understand wh you say this: "They are not meant to work together, and I do not know what the results of trying to get them to work together would be, except frustrating?"
the "preset" object is an UI for pattrstorage object. From the help: "It can also be used as a user interface link to a named pattrstorage object. "
You cannot save state in a Max for Live device, because it cannot alter its state while it is running in the MFL runtime (inside Live).
You can however, save pattrstorage data as a blob, so that the data it contains is saved as a parameter in the live set you are in. Data is saved with the set, not the device.
If you wish to save data with the device, you need to open it in the editor and create some initial state for it.
You may save pattrstorage data with its file saving mechanism as JSON files, but then you have to deal with carrying them around so that they are available for your device, or creating some kind of file opening thing to restore the JSON data into pattrstorage
-A
Thanx, so then if i want to have prepared states for the pattrstorage object (prepared presets), then i need to initialize it when loading up the device! Unlinke the Preset object, what can save it's current states in the patcher itself (and works perfectly with M4L), so the device loads up with the presets.
thanx guys for the help!
Althought still it's interesting why in the pattrstorage.maxhelp file there is the last tab saying: "Paste the patch below into a Max for Live device, then store a preset in the pattrstorage and save the device. The resulting preset will be embedded in the device, so there's no need to save the presets as a separate external file."
Is this speaking about the initial state not all the saved presets?
The saved presets should be saved as well. There's a problem in the help file, in that a semi-necessary option is not displayed outside of the Live context. After you paste the patcher into your device, open the pattrstorage object's inspector and check the "Auto-update Parameter Initial Value" box. Then you can save some presets, save the device and the presets will be available from within Live (via pattrstorage/preset).
Not sure if this is more than a documentation bug at this point, but we'll take a look at it. Sorry for the confusion.
Best, Jeremy
Ahh Jeremy, thanx a lot, perfect now! This Auto-Update parameter solved it! :) now i can save initial presets inside the amxd file, what the user can overwrite and save the states in his project file!
This was what i tried to do exactly!
thanx again!
I too had struggled with the desire to save presets in a M4L device without external files.
Presets stored in pattrstorage will always be saved with the Live Set inside the device when pattrstorage attributes are set as follows:
Parameter Mode Enable: @parameter_enable 1
(hidden): Initial Enable 1
Auto-update Parameter Initial Value: @paraminitmode 1
setting the 'Initial Enable' attribute cannot be done dynamically but is necessary to not be prompted to save the preset file externally.
just another note for this thread, don't use the three dashes in your pattrstorage names. seems to break the whole process and is also not needed!
I've edited the documentation from stretta's GitHub about how to access BEAP patches through Live's library outside from that respective Live Set, read under "Saving BEAP Presets with MaxForLive in Ableton" tab.
Does this parameter, "Auto-update Parameter Initial Value" have a different name in older versions of Max? Or did it simply not exist yet? (I'm using Max 5.)
EDIT: Nevermind, I just needed to enable "Parameter Mode Enable" to make the option visible.
I am trying to do the same in Max 4 Live with version 7.2.5. I copy paste the pattrstorage example from the help file into my Max 4 Live patch. As soon as I click on "Auto-update Parameter Initial Value" I get a beachball and Max then crashes. What can I do?
I am running the latest Max 7.2.5 in Ableton Live 9.6.1.
Could it be related to the fact that I have the same component in several tracks? Does pattrstorage automatically use unique names for instances of the same Max 4 Live component?
Thanks, Armin.
Hey Armin,
maybe not directly linked to your problem, but interesting for all :
When I tried to use the M4L-example I always got crashes aswell, that were caused by stackoverflows.
After some grey hair I saw, that the number object that is used to recall presets in the example has a scripting name on its own - so when you recall preset 1 it triggers the number box with 1 which recalls preset 1 and so on.... Little mistake by cycling74 I guess, but maybe this helps someone else in the future!
best regards
hoowdie
update:
the initial settings for [pattrstorage] should/can be instantiated as follows (including hidden param attributes):
Parameter Mode Enable: @parameter_enable 1
Initial Enable: @_parameter_initial_enable 1
Auto-update Parameter Initial Value: @paraminitmode 1
Order, Names and the likes can also be set as seen in the screenshot.
PS: when parameters outsite the reach/range of parameter mode enabled objects need to be stored (like symbols/text) within a M4L-device, this can be achieved by a [pattrstorage] with the above parameter attributes and visible [pattr] objects @parameter_enable 0 (anything can be stored in them and they are managed by the [pattrstorage] object which is available to the API and storable).

Anybody storing Dict's inside Pattrstorage successfully?
I created a new topic regarding this specific question:
Dict's in Ableton