<?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[abstractions-as-creation-arguments...Things I wish I knew before]]></title><description><![CDATA[<p>I've been programming pd for over five years and never knew this was possible.</p>
<p>Mark it up as &quot;There is always something new to learn&quot;.</p>
<p><img src="/uploads/files/1603210002260-screenshot_2020-10-20_10-51-21.png" alt="Screenshot_2020-10-20_10-51-21.png" class="img-responsive img-markdown" /></p>
<p><a href="/uploads/files/1603210143551-abstractions-as-creation-arguments.zip">abstractions-as-creation-arguments.zip</a></p>
<ul>
<li>Subpatches CAN have creation arguments and it is the same one as its parent</li>
<li>if the creation argument is a symbol and is the name of a .pd in the parent's folder, then that creation argument by itself IS that abstraction</li>
<li>the symbol creation argument by itself will be represented with its gui</li>
<li>creation arguments with relative paths ARE represented</li>
</ul>
<p>The implication being...rather than throwing abstractions around in your patch (by name), just include them as creation arguments and use the creation argument instead of the abstraction name.</p>
<p>&quot;Write once...&quot; and less(!) right?</p>
<p>Peace through sharing,<br />
S</p>
<p>p.s. I am 100% certain there are a lot of people who already knew this. Then, again,...<br />
you never know when you're going to learn something. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":-)" alt=":-)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before</link><generator>RSS for Node</generator><lastBuildDate>Tue, 06 Oct 2026 06:44:18 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/13087.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 20 Oct 2020 16:09:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 16:11:38 GMT]]></title><description><![CDATA[<p>I've been programming pd for over five years and never knew this was possible.</p>
<p>Mark it up as &quot;There is always something new to learn&quot;.</p>
<p><img src="/uploads/files/1603210002260-screenshot_2020-10-20_10-51-21.png" alt="Screenshot_2020-10-20_10-51-21.png" class="img-responsive img-markdown" /></p>
<p><a href="/uploads/files/1603210143551-abstractions-as-creation-arguments.zip">abstractions-as-creation-arguments.zip</a></p>
<ul>
<li>Subpatches CAN have creation arguments and it is the same one as its parent</li>
<li>if the creation argument is a symbol and is the name of a .pd in the parent's folder, then that creation argument by itself IS that abstraction</li>
<li>the symbol creation argument by itself will be represented with its gui</li>
<li>creation arguments with relative paths ARE represented</li>
</ul>
<p>The implication being...rather than throwing abstractions around in your patch (by name), just include them as creation arguments and use the creation argument instead of the abstraction name.</p>
<p>&quot;Write once...&quot; and less(!) right?</p>
<p>Peace through sharing,<br />
S</p>
<p>p.s. I am 100% certain there are a lot of people who already knew this. Then, again,...<br />
you never know when you're going to learn something. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":-)" alt=":-)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Tue, 20 Oct 2020 16:11:38 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 17:48:57 GMT]]></title><description><![CDATA[<p>@svanya said:</p>
<blockquote>
<p>Subpatches CAN have creation arguments and it is the same one as its parent</p>
</blockquote>
<p>I think this is wrong: writing $1 in any subpatch simple take the $1 from the main patch where your subpatch is located. Try to replace $1 with $2 in your main abstraction and see, you don&quot;t get &quot;e&quot; when asking for $1 but still &quot;3&quot;.</p>
<p>For the other points I agree, I also discovered them by practising.</p>
<p>@svanya said:</p>
<blockquote>
<p>I've been programming pd for over five years and never knew this was possible.<br />
Mark it up as &quot;There is always something new to learn&quot;.</p>
</blockquote>
<p>That's a positive point of view. I would say that, after 5 years, if you still discover things it might also means that pd has still some work to do on the documentation <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title=";)" alt=";)" /></p>
<p>Cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/2</guid><dc:creator><![CDATA[60hz]]></dc:creator><pubDate>Tue, 20 Oct 2020 17:48:57 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 18:15:12 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/60hz">@60hz</a><br />
Yes. My thinking was correct. But you said it much better:<br />
Subpatches can take creation arguments as they &quot;take the $1 from the main patch where your subpatch is located&quot;.</p>
<p>As to always able to learn...<br />
One of my core beliefs is &quot;No matter what field or great your expertise that is always more to be learned.&quot;.</p>
<p>Though I agree, while pd documentation is excellent in many ways, it also falls short in many others (ex. not writing the controls into the control properties, across the board).</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/3</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Tue, 20 Oct 2020 18:15:12 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 19:33:53 GMT]]></title><description><![CDATA[<p>@svanya Also check out [pdcontrol]. It is somewhat new and lets you also access creation arguments. <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/4</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Tue, 20 Oct 2020 19:33:53 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 19:44:21 GMT]]></title><description><![CDATA[<p>@svanya I think actually what you have found is that a sub-patch is just a &quot;hidden window&quot; within a patch.<br />
You can use an argument as its name [pd $1] but that only changes the name shown in top bar of the  window when you open it.<br />
The name is only a label...... a convenience.<br />
But on the bright side you have discovered how to assign a float to the name......<br />
<a href="/uploads/files/1603222889174-bright.zip">bright.zip</a><br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/5</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Tue, 20 Oct 2020 19:44:21 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 21:24:11 GMT]]></title><description><![CDATA[<p>Thanks for the pointers.</p>
<p>I am, however, way less excited about subpatches and way more about abstractions.</p>
<p>That they can be created by(symbol) creation arguments within the parent patch. That, I never knew.</p>
<p>So given, patchN.pd, bypass.pd, adsr.pd,  and patchN-help.pd (or grandparent), and object [patchN bypass adsr] inside a -help, objects [bypass] and [adsr] may be generated by only adding the objects [$1] and [$2] inside patchN.pd.</p>
<p>Subpatches aside, that alone for me is a huge game-changer.</p>
<p>I can organize All my abstractions by name when I declare an object, ex. [patchN abs1 abs2 abs3] and then just write those abs as [$1] [$2] [$3].</p>
<p>Which greatly improves the transparency for anyone wanting to digest my code.</p>
<p>When they see my abstraction declaration, they will know right up front what abstractions I am going to use inside it.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/6</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Tue, 20 Oct 2020 21:24:11 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 22:24:33 GMT]]></title><description><![CDATA[<p>@svanya This is a nice idea, anyhow for me it would seem more obfuscating than transparent to inspect some code and only find [$n] objects.</p>
<p>The approach also has some limits as you can only assign variables on the first level and abstractions cannot have creation arguments themselves. Or you have to write them as well in the main patch and the abstractions as [$1 $2 $3] and this would get completely confusing. Just my thoughts <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/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/7</guid><dc:creator><![CDATA[ingox]]></dc:creator><pubDate>Tue, 20 Oct 2020 22:24:33 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Tue, 20 Oct 2020 22:44:56 GMT]]></title><description><![CDATA[<p>What I mean is like this:</p>
<p><a href="/uploads/files/1603233883795-abstractions-as-creation-arguments2.zip">abstractions-as-creation-arguments2.zip</a></p>
<p>Which I think, for my sake at least, adds to greater transparency.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/8</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Tue, 20 Oct 2020 22:44:56 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Wed, 21 Oct 2020 02:18:22 GMT]]></title><description><![CDATA[<p>@svanya I would not do it that way personally, as like <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> says when someone wants to open your patch to see how it works they will have to mentally substitute &quot;$1&quot;, &quot;$2&quot; etc. for the objects, and have to remember what each one is as they look at your patch if they want to understand it.</p>
<p>what this IS useful for imo is if you have a bunch of objects with exactly the same interface and want to use arguments to choose which ones your abstraction will use. for instance, all relational objects have the same interface. Therefore I made an abstraction to pass numbers to the left outlet if they met a certain condition and the right outlet if not by using &quot;$1&quot; inside to be able to choose what relational object to use for the test:<br />
<img src="/uploads/files/1603245183447-screen-shot-2020-10-20-at-6.52.18-pm.png" alt="Screen Shot 2020-10-20 at 6.52.18 PM.png" class="img-responsive img-markdown" /></p>
<p>then when you use the object you can use e.g. <code>[passif == 5]</code> to pass the numbers out of the left outlet if they are equal to 5/the right inlet, and out the right outlet if not equal, or <code>[passif &lt; 5]</code> to pass out the left outlet if the numbers are less than 5/the right inlet, and out the right outlet if not less.</p>
<p>this could also be useful in a sorting algorithm in order to choose how to sort elements</p>
<p>another example might be if you had multiple objects that interpolate values, all with the same interface but with different interpolation methods. then you could do something like <code>[myabs~ linear]</code> to select linear interpolation, and <code>[myabs~ cubic]</code> to select cubic interpolation.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/9</guid><dc:creator><![CDATA[seb-harmonik.ar]]></dc:creator><pubDate>Wed, 21 Oct 2020 02:18:22 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Wed, 21 Oct 2020 04:13:33 GMT]]></title><description><![CDATA[<p>Two benefits, to designing this way, I thought of:</p>
<ol>
<li>when debugging, how significantly it would cut down the count when doing a Find for your abstractions</li>
</ol>
<p>and</p>
<ol start="2">
<li>when analyzing your code for precedence, the &quot;reader&quot;/student would no longer need to drill down to the individual level, but could stop at the parent.</li>
</ol>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/10</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Wed, 21 Oct 2020 04:13:33 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Wed, 21 Oct 2020 04:33:21 GMT]]></title><description><![CDATA[<p>Just something funny about this, since this really only applies to grandchildren....</p>
<p>I can't count how many times I have been at my parent's place over Christmas with my kids, my brother, and his, that I have heard my parents tell the children &quot;Take a number!&quot;.</p>
<p>😁</p>
<p>Grandchildren (by nature?) seem to lose their identity.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/11</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Wed, 21 Oct 2020 04:33:21 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Wed, 21 Oct 2020 09:10:52 GMT]]></title><description><![CDATA[<p>I feel like I should say...</p>
<p>I am applying this design concept to my current project. It's a step (drum) sequencer to which this concept applies nicely.</p>
<p>When I share it, one large part of the readme will talk about what I learned in trying this out.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/12</guid><dc:creator><![CDATA[sv]]></dc:creator><pubDate>Wed, 21 Oct 2020 09:10:52 GMT</pubDate></item><item><title><![CDATA[Reply to abstractions-as-creation-arguments...Things I wish I knew before on Wed, 21 Oct 2020 09:42:44 GMT]]></title><description><![CDATA[<p>@svanya Sorry, but I have to agree with <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ingox">@ingox</a> that this is going to make your patches much harder to read.<br />
Naming a sub-patch is for convenience only...... it serves no purpose other than to remind you what is inside.  The name must be typed.... yes.... but weeks later it is very useful.<br />
Often patches are posted as screenshots and send/receive names are hidden within GUIs...... and that is a problem.</p>
<p>In Windows we have a chance to decode the patch because the arguments are added to the title bar of the patch window, but I am not sure that is the case in some other OS's....?<br />
If the window is small and there are many arguments they will be off the right edge of the title bar.<br />
So in your first post we might only know the values of the $ arguments for the patch because you have made them visible with a [loadbang]<br />
Anyway, counting through the large number of arguments you might end up with and then mentaly applying that to the patch (just to know which abstraction [$55] refers to) could prove difficult for us grandparents while the toddlers are screaming their heads off......<br />
Even as you write your patch you will be scratching your head.  Imagine when you come back to it next year.<br />
David.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/13087/abstractions-as-creation-arguments-things-i-wish-i-knew-before/13</guid><dc:creator><![CDATA[whale-av]]></dc:creator><pubDate>Wed, 21 Oct 2020 09:42:44 GMT</pubDate></item></channel></rss>