is it possible for M4L presets to be saved automatically when saving the Live Set?

Mark's icon

i'm using a number of pattrstorage presets in an M4L device which i would like to be saved automatically when i save the Live Set.
is this possible somehow?

Jan M's icon

Hi Mark, it is possible. Here as a good in detailed tutorial how to work with presets/pattr/pattrstorage in M4L:

https://cycling74.com/tutorials/max-for-live-tutorial-adding-pattr-presets-to-your-live-session

Mark's icon

hey jan!
thanks for pointing me to this nice tutorial but i didn't see anything relevant to my question.
i will try to explain again in case i was not clear:

what is happening now:
i save a preset slot.
i change the values of some of the connected objects.
i save the Live Set, but i forget to save the preset slot again.
the new values will be saved with the Live Set, but NOT in the preset.
this means that if i select the preset slot again, it will contain the old values, and not the ones saved with the Live Set.

what i want:
when i save a Live Set, to force somehow the pattrstorage to save its current state in it's currently selected preset slot.

i'm not sure if this is possible, but will be very happy if anyone knows how to do it.

Jan M's icon

Ah - now i get it. AFAIK there is now straight forward way to detect when a Live set is saved in MaxForLive. You could try some hacks by capturing the the save-shortcuts plus try prompting to so safe the presets on [closebang]. Still I can see several scenarios where this would not work and/or be problematic.
I can see that this feature may be useful for a personal workflow. From a more general software architectural point of view I would consider it almost a "design flaw" as the basic idea of a preset it that they are independent from the saved state of the software. This state is already stored with the Live Set..... (just thinking out loudly)

Mark's icon

"From a more general software architectural point of view I would consider it almost a "design flaw" as the basic idea of a preset it that they are independent from the saved state of the software"
yes, this would be the norm for most scenarios (audio plugins for example).
but i am building an interface for a controller in which i will be switching presets frantically in live situations so it would defeat the point to have to remember and save a preset every time i tweak/finetune some value.

i'm thinking that if it's not possible to do what i want (in a reliable manner), then maybe i can try to do the opposite ie:
make a button that will:
1. save ALL presets and THEN
2. save the Live Set
and then just get used to saving my projects with this button instead.
i will first have to find out if it is possible to trigger a Live Set Save with maxforlive.

but now that max8 is supposed to have tighter integration with Live, perhaps it wouldn't be so difficult to add an option to save presets automatically when saving a Live Set?
( FEATURE REQUEST )

anyway, thanks for the quick response Jan

Jan M's icon

your usage/idea makes sense to me! you could define a slot number in your devices as the one always storing the last state of the device (e.g. slot 1). And in addition to that you could add a "master device" with a button to recall slot 1 in related all presets (just sending a bang with [send/receive].

Mark's icon

sorry, i don't understand exactly what you mean

Mark's icon

so i noticed the savebang] object, but this works when the max patcher window is saved, not when the Live Set is saved.
Is there any chance they may have made something similar for M4L usage?

Alexis Baskind's icon

Dear all,
I'm reactivating this somehow old post since I'd like to achieve exactly the same result, meaning being able to detect in a M4L device when the live set is being saved, and this right before it's being saved (in order to make a small modification/update on the snapshot before it's being written).

Any hope?

All the best,
Alexis

Ferenc Fabian's icon

if anyone solves this issue, please let us know :D but thanks for this conversation and the link for the article @Jan, it was very helpful!

Baek Santarek's icon

bump, I am also interested in this feature.

elisabeth homeland's icon

Hey there,

Today I ran into this limitation, and I created a patch that notifies itself when the LiveSet been saved, and saves a json file (extracted from a {dict} into the LiveSet's project directory.

Here's a rough explanation about how it works:

  • I periodically observe the Live set's name/path to see if anything changed.

  • I use node.JS to check if the .als file "LastModified" attribute changed or not.

  • If the user tries to quit Live and the save/discard prompt comes up, I also reveal a prompt to save the json file. (with keyboard input Esc/Enter) - If the project's directory been already created it'll save the file there, but if there's no project directory yet, then it'll save the json file to the desktop. (So the user can drop it into the newly created project directory after Live closed.)

In the actual example project I explain every part in a bit more detail.

I haven't tried it on Windows yet, but it should work the same.

Cheers,
Nándor from ElisabethHomeland

ObserveLiveSetSaveAndSaveAFIle.amxd
amxd

Ferenc Fabian's icon

Thanks for the patch!