saving parameter settings in standalone app

Stef Haynes's icon

Hi all, I'm creating a standalone app, and I'd like the user to be able to save all of their parameters (button states, integer values, slider positions, etc). What's the best way to do this when creating a standalone application? It would be great if the parameter settings could be automatically persisted after the app is closed and re-opened, but if they user needs to hit a "save" button, that would be fine too.

btw, all my UI objects are recognized by pattrstorage, and I can do this just fine when it's just a patcher, but none of the methods I've tried seem to work after I build it as a standalone application.

Any help is much appreciated!!

Source Audio's icon

All it need is correct path to write and read preset file.

I would suggest to pick location which is granted in most cases no matter which OS,

like user's documents folder.

you can use ~ as shortcut to user folder.

example :

write ~/Documents/MyApp_Presets.json

loadbang ~/Documents/MyApp_Presets.json

to absolutepath.

if found, read the file, and recall preset 1.

If not, use default values and store 1 , then

write file to start with.

I personally dislike any autostore - write options.

it fails anyway in most cases, unless you disable app quit

using shortcuts and menu, and use dedicated button

to first write settings and then quit app.

Stef Haynes's icon

Thanks very much!!

Source Audio's icon

P.S.

you can bundle messages into comma separated ones, like

store 1, write ~/Documents/Presets.json

or

read ~/Documents/Presets.json, 1

in most cases max objects follow such orders taking care that

functions proceed only when previous ones succeeded.