"Embed in patcher" and MaxforLive

Georges Michaud's icon

I would like the content of buffer objects like [table] or [funbuff] in a M4L device to be stored when I save the Live set and recalled when I open the set again. In Max we can use "embed": when you save the patch it saves the content of the buffer as well. But not in Live: when you save and open the set again the values are back to those that were saved first when saving the patch.

How to do that? The "write" and "load" messages are not a solution with [table] because it opens a window for the location of the file and it can make Max hang or Live crash. I didn't try with [funbuff] yet. Is this the only solution, using [live.thisdevice] to send "write" and "load" messages? Because I'm not sure I understand the way it works properly. Does it send a bang only when loading or also when saving (the documentation says "thus reloading")? How to get a bang only when loading and another one only when saving?

Thank you for your help.

11OLSEN's icon

For the [table] simply enable ParameterMode in the inspector. If you really want to use funbuf which has no parameter mode, you would have to mirror every change to it in another object eg [dict] which allows parameter mode. On device load you could then recall the funbuf from the dict. There's no save notification.

You save yourself work if you use objects that allow parameter mode from the start to store data with the set.

Additionally to the Live objects which are parameters by default, you can set the "parameter_enable" attribute for these objects:
jit.playlist live.arrows attrui button chooser crosspatch dial dict flonum function gswitch gswitch2 incdec itable js jsui kslider led matrixctrl mc.function multirange multislider nodes nslider number pattr pattrstorage pictctrl pictslider radiogroup rslider slider swatch tab table textbutton textedit toggle ubutton umenu amxd~ filtergraph~ gain~ mc.amxd~ mc.gain~ mc.playlist~ mc.table~ mc.vst~ mcs.amxd~ mcs.vst~ playlist~ table~ vst~.

Georges Michaud's icon

Thank you very much. I'm struggling with Max for Live as there is little documentation.
I had resorted to storing each of the values in separate [live.numbox] objects before sending them to [funbuff]. It worked but I didn't have a huge number of values to be stored.