Struggling to save state

    Oct 29 2011 | 1:32 am
    Based on the tutorial I saw on basic use of pattrstorage and autopattr, I tried again to create a test example (see attached patch) that can just save the state of the dials when the patcher is closed and reload the values when the patcher is opened again.
    I must be missing something very basic but surely there ought to be a way to make this work. Would appreciate any insights. This is the only thing preventing me from finishing my project using Max for my live performances.
    Many thanks

    • Oct 29 2011 | 4:26 pm
      Anyone know what I did wrong?
    • Oct 29 2011 | 4:56 pm
      I used the message store instead of write and it seems to work. I put a del after the loadbang to give the patch time to do it's thing before reloading the patch. There are better ways I am sure but at least it works.
    • Oct 29 2011 | 5:15 pm
      You weren't saving into a slot of the pattrstorage and reloading This saves into slot 1, and restores that when re-opening. the savemode attribute is set to autosave.
    • Oct 29 2011 | 6:09 pm
      Chris, thank you for the patch but unfortunately, it does not work --- at least not on my Max 6 environment.
      I replaced my patch with your version and saved it. I then changed the dial positions and just closed the patcher. When I opened it again, the dials did not reflect my changes.
    • Oct 29 2011 | 6:12 pm
      @grizzle Your patch works but I get prompted to save the json data every time I close the patch after I make a change.
      My goal is that any changes I make are just silently saved and reloaded.
    • Oct 29 2011 | 6:16 pm
      However, if I insert the [delay] into the loadbang of Chris's patch, then it DOES work (yay) --- so the combination of both answers seems to address the problem.