Forums > Max For Live

Pattrstorage and Preset in M4L

April 14, 2013 | 2:36 am

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

Attachments:
  1. testpattr.amxd

April 15, 2013 | 7:10 pm

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?


April 15, 2013 | 7:31 pm

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


April 15, 2013 | 7:41 pm

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. "


April 15, 2013 | 9:15 pm

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


April 15, 2013 | 9:29 pm

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?


April 15, 2013 | 9:46 pm

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

[attachment=221096,5434]

Attachments:
  1. Bildschirmfoto20130415um23.30.01.png

April 15, 2013 | 10:05 pm

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!


Viewing 8 posts - 1 through 8 (of 8 total)