<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[store.state] - patch-less state saving method for abstractions]]></title><description><![CDATA[<p>Hi everybody,</p>
<p>Pd 0.49.1 has a new object [savestate] for saving lists of parameters to the parent patch so that different instances of an abstraction are saved with different parameters. The help file for it shows a method of creating/unpacking the list which I think is a bit awkward for abstractions with lots of parameters as it requires a lot of patching and is dependant on the order of packing/unpacking.<br />
I have adapted the method used for <a href="https://forum.pdpatchrepo.info/topic/9887/save-presets-to-textfile" rel="nofollow">saving presets to a text file</a> to do the state saving in a very similar fashion here. Store.state-help.pd explains its workings as well as I could, hope it's clear enough.</p>
<p><a href="/uploads/files/1558131030776-store.state1.0.zip">store.state1.0.zip</a></p>
<p>In the future I'd like to merge this method and the text file preset saving to work alongside (where the presets are just multiple states, basically), but for most purposes I think the state saving is more useful and immediate than presets. At least for me, anyway.</p>
<p>This new object opens up interesting possibilities so any feedback or alternative methods are welcome.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 06:50:53 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/12066.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 May 2019 22:13:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Fri, 17 May 2019 22:14:04 GMT]]></title><description><![CDATA[<p>Hi everybody,</p>
<p>Pd 0.49.1 has a new object [savestate] for saving lists of parameters to the parent patch so that different instances of an abstraction are saved with different parameters. The help file for it shows a method of creating/unpacking the list which I think is a bit awkward for abstractions with lots of parameters as it requires a lot of patching and is dependant on the order of packing/unpacking.<br />
I have adapted the method used for <a href="https://forum.pdpatchrepo.info/topic/9887/save-presets-to-textfile" rel="nofollow">saving presets to a text file</a> to do the state saving in a very similar fashion here. Store.state-help.pd explains its workings as well as I could, hope it's clear enough.</p>
<p><a href="/uploads/files/1558131030776-store.state1.0.zip">store.state1.0.zip</a></p>
<p>In the future I'd like to merge this method and the text file preset saving to work alongside (where the presets are just multiple states, basically), but for most purposes I think the state saving is more useful and immediate than presets. At least for me, anyway.</p>
<p>This new object opens up interesting possibilities so any feedback or alternative methods are welcome.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Fri, 17 May 2019 22:14:04 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 19:22:55 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> i don't get it. The whole point of having an object like [savestate] is that you don't have to create abstractions with individual arguments for state saving...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/2</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Sun, 19 May 2019 19:22:55 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 20:01:05 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> Maybe I'm missing something but as far as I can see, [savestate] just saves a bunch of lists to the parent patch and links those lists to the instance that sent them, so that when you open the parent patch again each instance of the abstraction gets back its respective lists. But there is no built-in way to associate each list to the corresponding parameter, and whenever you open the parent patch each instance of [savestate] that you have in there receives all lists relative to that abstraction. How do you parse those saved lists? I think you have to either pack/unpack your parameters into a single list like in the help file, with each element of the list being a single parameter (which doesn't seem practical to me, especially if you want to save variable length arrays and text), or you can create one list for each parameter, but in that case you need to attach some sort of identifier to each list so that you know how to parse them. Something like this:<img src="/uploads/files/1558295610171-screenshot-2019-05-19-at-21.51.43.png" alt="Screenshot 2019-05-19 at 21.51.43.png" class="img-responsive img-markdown" /><br />
Which is exactly what I did, except that by making abstractions for this mechanism you don't have to copy/paste/rename it every time you add a new parameter to your abstraction.</p>
<p>Am I missing something? How is everybody using this object?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/3</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Sun, 19 May 2019 20:01:05 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 20:06:54 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> at least you need to route the values somehow to and from [savestate]? on the other hand it is possible to save [array] and [text] with the -k flag and toggles/sliders/Radio/numbers2 with init. but the difference to init and -k seems (from the doc): &quot;[savestate] output comes before [loadbang], this mechanism was suggested by Miller in the Pd list and allows to set default values for the controls which will be used whenever there is no state saving in the parent patch. If you open this file (store.state.pd) it'll load with these values.&quot;<br />
edit: wrote my answers before i saw the one from <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a>, so it is kind of redundant...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/4</guid><dc:creator><![CDATA[Jona]]></dc:creator><pubDate>Sun, 19 May 2019 20:06:54 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 20:46:34 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jona">@Jona</a> The main difference with the flags is that if you have an abstraction with the object [array define -k ..], the same content of the array is saved for all instances of the abstraction, whereas [savestate] allows you to save different values for each instance.</p>
<p>I can imagine some problems using the init option for sliders/toggles/radio etc and savestate at the same time, since those init values would override the savestate. For loadbang, Miller's trick is probably enough, but for init I wouldn't know. Probably best not to use it at all?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/5</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Sun, 19 May 2019 20:46:34 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 20:20:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> sorry, i got it wrong. Of course it's meant to be copied into the abstraction... I should study the helpfiles more carefully before i post.. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/blush.png" title="blush" alt=":blush:" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/6</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Sun, 19 May 2019 20:20:28 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Sun, 19 May 2019 20:48:29 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> No worries, I can see it's not very intuitive. Given the object's very limited documentation this is the most modular solution I can think of. I would be very interested to see some alternative uses.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/7</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Sun, 19 May 2019 20:48:29 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 20 May 2019 10:15:00 GMT]]></title><description><![CDATA[<p>Doing some more experimenting with the savestate object to save parameters which are not in an abstraction but in the parent patch, it seems that there is some odd behaviour in that when the patch is loaded and savestate receives the lists, they are available inside the abstraction but cannot be sent out to the parent patch directly via outlets, I wonder why that is. This is shown on the right hand side of store.state-help.pd.</p>
<p><a href="/uploads/files/1558347150599-store.state1.1.zip">store.state1.1.zip</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/8</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Mon, 20 May 2019 10:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 20 May 2019 13:01:23 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> interesting... it seems that initbang sneaked into pd-vanilla, at least you could use savestate in the same way: <a href="/uploads/files/1558357159295-savestate_as_initbang.zip">savestate_as_initbang.zip</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/9</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Mon, 20 May 2019 13:01:23 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 20 May 2019 13:17:41 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> Very nice, thanks!</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/10</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Mon, 20 May 2019 13:17:41 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 20 May 2019 13:35:51 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> that's why you don't get a result from the outlet. Like initbang, savestate sends the list &quot;before&quot; the abstraction is created/connected in the parent patch.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/11</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Mon, 20 May 2019 13:35:51 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 20 May 2019 14:08:01 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> Oh I see, yes that makes sense now. In fact I think it's more useful this way precisely because it works like initbang, and if you need to send stuff to the parent patch you can always do it with loadbang.</p>
<p>I have added some more abstractions for saving arrays and text which are in the parent patch, this should cover pretty much everything I think.</p>
<p><a href="/uploads/files/1558361280071-store.state1.2.zip">store.state1.2.zip</a></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/12</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Mon, 20 May 2019 14:08:01 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Tue, 29 Oct 2019 12:53:46 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> you mentioned saving multiple states in some kind of preset system, how would you go about doing this using the [savestate] method here?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/13</guid><dc:creator><![CDATA[boonier]]></dc:creator><pubDate>Tue, 29 Oct 2019 12:53:46 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 07:32:38 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/boonier">@boonier</a> I haven't had time to think about it, but in fact my feeling is that it wouldn't have any advantages at all. With presets you have to chose when to save a new one, compared to saving the &quot;state&quot; in which the abstraction was when you saved and closed the patch. At that point, I think it's more efficient if the presets are stored in text files so that they can be shared by all instances of the abstraction.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/14</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Wed, 30 Oct 2019 07:32:38 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 07:43:08 GMT]]></title><description><![CDATA[<p>[savestate] may allow to include the [text] to store the presets individually inside the abstraction, which could be beneficiary. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title=";)" alt=";)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/15</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Wed, 30 Oct 2019 07:43:08 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 09:21:19 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> said:</p>
<blockquote>
<p>At that point, I think it's more efficient if the presets are stored in text files so that they can be shared by all instances of the abstraction.</p>
</blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a> How would this work in the context of [savestate] - the text files would be loaded <em>into</em> each instance of the abstraction individually, or as one global preset load? (sorry I'm probably over-thinking it here!)</p>
<p>I had it in my mind as a global patch state, a bit like SSSAD which I used a lot in the past <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /> but I guess this how [savestate] is working anyway. A later development to the initial sssad work brought an abstraction (can't remember the author) called [presetstore] which allowed you to save multiple global states in one patch. I guess what I'm trying to avoid is saving multiple versions of one patch, as it seems inefficient to me.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> said:</p>
<blockquote>
<p>[savestate] may allow to include the [text] to store the presets individually inside the abstraction, which could be beneficiary. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title=";)" alt=";)" /></p>
</blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> that is a good point!</p>
<p>cheers all</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/16</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/16</guid><dc:creator><![CDATA[boonier]]></dc:creator><pubDate>Wed, 30 Oct 2019 09:21:19 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 11:09:30 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/boonier">@boonier</a> said:</p>
<blockquote>
<p>How would this work in the context of [savestate] - the text files would be loaded <em>into</em> each instance of the abstraction individually, or as one global preset load?</p>
</blockquote>
<p>They would be loaded only in the instance of the abstraction on which you save the presets. Think of it this way: the abstraction contains a [text] object, and you save its state (ie, the text it contains, whether it's a set of presets or a poem) which can be different for each instance of the abstraction. I can't see any advantages with this approach, but it may work for you.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/17</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/17</guid><dc:creator><![CDATA[weightless]]></dc:creator><pubDate>Wed, 30 Oct 2019 11:09:30 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 14:50:47 GMT]]></title><description><![CDATA[<p>Yes I agree that presets only local to a single instance of an abstraction is a bit limiting.</p>
<p>So it’s the multiple abstraction states saved as presets in the parent patch, that I can I can recall at any time, either by a little gui, or messages, that would be my preference.</p>
<p>I can’t see how I would achieve that on a global [savestate] level, unless I can poll all the [savestate]s inside the abstractions into a global text object and save that into a parent based save [savestate] maybe</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/18</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/18</guid><dc:creator><![CDATA[boonier]]></dc:creator><pubDate>Wed, 30 Oct 2019 14:50:47 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Wed, 30 Oct 2019 17:01:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/boonier">@boonier</a> said:</p>
<blockquote>
<p>I can’t see how I would achieve that on a global [savestate] level, unless I can poll all the [savestate]s inside the abstractions into a global text object and save that into a parent based save [savestate] maybe</p>
</blockquote>
<p>You can simply use [text define -k] and the contents will be saved together with the main patch, which is the equivalent function to what [savestate] does for abstractions.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/19</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/19</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Wed, 30 Oct 2019 17:01:02 GMT</pubDate></item><item><title><![CDATA[Reply to [store.state] - patch-less state saving method for abstractions on Mon, 30 Aug 2021 01:55:03 GMT]]></title><description><![CDATA[<p>thank you <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/weightless">@weightless</a>, this patch is awensome and saved my life.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/20</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/12066/store-state-patch-less-state-saving-method-for-abstractions/20</guid><dc:creator><![CDATA[tabache]]></dc:creator><pubDate>Mon, 30 Aug 2021 01:55:03 GMT</pubDate></item></channel></rss>