I have found Maelstorm's state saving abstractions, save me and my hero, to be quite useful in making presets for sequencers and other abstractions that have common items that need to be accessed with specific values. My current project is a revisitation of a sequencer that I built a while back, and I am attempting to improve it. I have successfully implemented the state saving abstraction so that it will work with my sequencer, albeit a few issues that I would like to work out.
a- The preset will be saved only until the patch is closed, even if you save the patch.
For instance, if I open up my sequencer and put in the first preset slot the values; 1, 2, 3 and then save it and then move to preset number two and put in the values; 4, 5, 6 and save it, it all works. I can switch between these two presets fine and have their individual values recalled. However, if I save the patch and call it test.pd, and then close out of pd and then re-open my patch, I am presented with values of all zeroes in both presets. The not-so-solution-solution leads to question two.
b- Messages can be saved, but this is not done automatically.
These presets can be remembered by the pd patch after inputting and saving them as above, when using Maelstorm's saver, if I go into the pd messages subpatch and the go and do a file>save. By doing this I can save the new values into the message box which can then be used later to recall the values, even after a patch is closed and opened back up. However, not all is good as this leads to a third issue.
c- This created message is not unique to the individual abstraction that it was saved in.
I figured this was due to the lack of using $0-, but I have since found out that this is not the case. Even if I create pd $0-messages in Maelstorm's saver, the changes, when saved, appear to be universal. For instance if I have the default values of a sequence set to 0, 0, 0 and then edit the sequence to have values of 1, 2, 3 and save them under preset one, then open up pd $0-messages and save it manually file>save, and then go and create a new sequence and select preset one which should have the defaults of 0, 0, 0; it is instead now set to 1, 2, 3!
I am at a loss of what to do here to resolve my issues, it seems that if I can solve this I will be content with my sequencer.
What I am looking for is a way to save presets to an individual abstraction, and have them recalled after a patch is opened without having to manually save the message subpatch. At the same time I would also like for the presets to be specific to that individual abstraction so that I can have two sequencers open and both on their respective 'preset one' but with two unique sequences.
I was thinking that this might be solved by creating dynamic abstractions a found in an earlier post by mod, but I wasn't sure how to get into that, or if it was actually going to solve anything.
I am attaching a .zip of the sequencer that I am trying to work on, as well as Maelstorm's saving patches. I don't believe that there is anything else in there that isn't included in pd-extended, but let me know.
Thank you for any advice or ideas you can offer, I really appreciate it!