pattrstorage and preset to save snapshots
I have a hard time wrapping my mind around how pattrstorage works in conjunction with the presets object. What I try to do:
Each time I load a new device, the preset slots should be empty. Now I change values and add presets to the device one by one.
When I save the device with an Ableton set, I want those snapshots to be saved with it. But only in this instance of the device. So snapshots that save with the Ableton file. But not global presets.
Is this possible or is there a better way of doing this?
I also struggle wrapping my head around the way pattrstorage and presets and saves and Live interact.
Each time I load a new device, the preset slots should be empty. Now I change values and add presets to the device one by one. When I save the device with an Ableton set, I want those snapshots to be saved with it. But only in this instance of the device. So snapshots that save with the Ableton file. But not global presets.
If the "empty" presets.json data already loads into a Live set with every "new" instance of your M4L device (loaded from your Live "User Library"), after you've added a few pattrstorage presets to some instance in some song, save a copy of the .amxd file (the M4L device) inside Live's (your) "current project" and also save the (now not empty) presets.json file in the same folder. (whether or not the pattrstorage object automatically saves (preset) changes to the .json file when you save the patch is a configurable option, configure it to ask you every time so you can be sure to save changes to the local song project preset.json file and not the "global" one.) You don't need to save a Live device preset inside your user library or the project, that gets confusing fast, just leverage the device parameter details that get saved with the .als file. Now, "swap" the M4L device in the Live set; delete the one that loaded from your User Library, and drag in the one you just saved with the project (it should already have the presets you just created and saved), then save the Live project and restart Live. Next time the project loads, it should load the local project version of both the .amxd and .json files located "inside" the project folder structure.
Of course, "unhooking" from global presets (Live's User Library) in this way means you also get to self-manage things like updating the M4L device version from 1.0 to 2.0 say in every Live set where you "unhooked" and saved a separate copy of the 1.0 .amxd device file with the song project.
There might be a better way. But this is more or less how I've been managing one-off custom M4L devices that belong with specific Live projects only, and don't belong generally available in my (global) Live User Library eco-system. It's not easy to maintain this kind of silo though because both Live and Max (for Live) strongly prefer saving .amxd files (M4L devices) in your Live User Library, But the "save in current project" model seems to be working for me.
That's sounds very intense. I was hoping this is something more easily done, as I wanted it to be part of a device that I can distribute. Thank you though, I think I have a better understanding of this now.
I've got it to work exactly how I wanted. pattrstorage with parameter mode enabled, initial enabled and Auto-update Parameter initial value enabled. Also means no need to also save any Json file anywhere.