distinguishing pattrstorages in copies of the same device
If I have an M4L device with a psto in it, all copies of that device will share the data if the psto is named. If you want them to be unique, however, there's a bit of a problem: Obviously, you can't name it "---myStorage" as the number will not be predictable, and there's no way of assigning a unique argument to a live device.
It's kind of klugey, but I thought I could maybe use the track ID to generate a consistent name on device load, so psto on track 1 would be something like "myStorage_1", etc. However, as the arcana of storage inside Live is a bit of a mystery to me, I don't know if that would work, or if the psto name needs to be hard-coded.
Obviously, I could just try it, but I'm being lazy and thought someone out there might just have the answer....
Thanks!
\M
Hey Matthew, I think the fix for your case is to set your [pattrstorage] with @savemode 0 and enable its "Parameter Mode Enable" attribute. As a result the presets won't be stored in a file but in the Live set directly, so each instance of the device can have its own presets.
You can also make your device to ship with pre-existing presets if you want.
A few more hints here in the doc.
Hi Théophile!
Here's how I'm setting it up now, which is basically as you recommend:
@_parameter_initial_enable 1 @_parameter_invisible 1 @paraminitmode 1 @parameter_enable 1
Which I think I got from Gregory Taylor's article here: https://cycling74.com/articles/max-for-live-tutorial-adding-pattr-presets-to-your-live-session
According to Gregory, that effectively sets savemode to 0.
Note: You'll notice that when you click on the checkbox to set Parameter Mode Enable, the savemode and autorestore attributes will be greyed out when displayed. You may also notice that the values for the greyed out parameters are set to values of 1 rather than 0. The displayed values represent the default value of the attribute before it was disabled - the behavior of the pattrstorage object will be precisely as though you had set both attribute values to 0.
So, despite doing all of that, the psto's are sharing data, so something else is afoot, I think, and the only thing I can think of is the psto name. It's a fairly complex device, so maybe I should just do a stripped-down one & see what happens...
\M