<?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[&quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;)]]></title><description><![CDATA[<p>Following up on some posts from the &quot;Symbols explicit&quot; thread, where there were some questions about concrete use cases.</p>
<p>To be honest, I'm not sure how clear this is going to be, because the best way to make it clear is to build it in Pd, and I don't have time to do something complicated.</p>
<p>Anyway... consider a &quot;data stream&quot; interface. Some part of the code asks the stream for the next value, and -- in text languages -- <em>the value is returned to the caller</em>. There may be dozens of places that need to access the stream, and the rule is, whoever asked gets the result.</p>
<p>I had mentioned parsing. If the input string is held in a stream wrapper (in SC, <code>CollStream</code>), then this object can be passed around the system as a function/method argument, and everywhere that needs the next character can just ask for it.</p>
<p>The challenge, then, in graphical patchers is that there is no concept of returning a value to the caller. A message traversing a patch cable is calling into the next object. &quot;Returning from a function&quot; is, in patching terms, backtracking to a prior object to see if it has more output cables that haven't been handled yet. But data don't travel backward up the stack, only down.</p>
<p>A file handle can be treated as a stream. Here, Pd recognizes the issue and allows shared file handles to be &quot;define&quot;-d: [file define xyz], and then every &quot;caller&quot; can have its own [file handle xyz].</p>
<p>If the data source is in memory, though, then the current position in the stream has to be maintained within the abstraction -- and there can be only one of those, because Pd/Max don't have a concept of a pointer to an abstraction that's loaded somewhere else. E.g., a really simple data queue (didn't implement &quot;rewind&quot; here) -- as an abstraction, everything would have to go through this.</p>
<p><img src="/uploads/files/1744253281563-pd-simple-queue.png" alt="pd-simple-queue.png" class="img-responsive img-markdown" /></p>
<p>So then there has to be a way to request a value <em>from a specific part of the patch</em> and get back to that part of the patch.</p>
<p><img src="/uploads/files/1744253344292-pd-dispatch.png" alt="pd-dispatch.png" class="img-responsive img-markdown" /></p>
<p>... where oid said, &quot;In that situation I would say that [pd my-stateful-thing] should have a send method&quot; -- seems to me that's what the above <em>is</em> (just not folded into the subpatch).</p>
<blockquote>
<p>Regarding your live-coding dialect, would be curious to see it if you shared it anywhere.</p>
</blockquote>
<p><a href="https://github.com/jamshark70/ddwChucklib-livecode" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode</a> -- see <a href="https://github.com/jamshark70/ddwChucklib-livecode/blob/master/cl-manual.pdf" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode/blob/master/cl-manual.pdf</a> for full documentation.</p>
<p>The parser (with heavy use of CollStream throughout) is at <a href="https://github.com/jamshark70/ddwChucklib-livecode/blob/master/parsenodes.sc" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode/blob/master/parsenodes.sc</a></p>
<p>Example: <div class="embed-container"><iframe src="//www.youtube.com/embed/jGAztgg9ut0" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></p>
<blockquote>
<p>Most of what I do in pd is designing languages</p>
</blockquote>
<p>Quite curious about that. Anything public to see?</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 07:07:58 GMT</lastBuildDate><atom:link href="http://forum.pdpatchrepo.info/topic/15085.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Apr 2025 02:49:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Thu, 10 Apr 2025 02:49:37 GMT]]></title><description><![CDATA[<p>Following up on some posts from the &quot;Symbols explicit&quot; thread, where there were some questions about concrete use cases.</p>
<p>To be honest, I'm not sure how clear this is going to be, because the best way to make it clear is to build it in Pd, and I don't have time to do something complicated.</p>
<p>Anyway... consider a &quot;data stream&quot; interface. Some part of the code asks the stream for the next value, and -- in text languages -- <em>the value is returned to the caller</em>. There may be dozens of places that need to access the stream, and the rule is, whoever asked gets the result.</p>
<p>I had mentioned parsing. If the input string is held in a stream wrapper (in SC, <code>CollStream</code>), then this object can be passed around the system as a function/method argument, and everywhere that needs the next character can just ask for it.</p>
<p>The challenge, then, in graphical patchers is that there is no concept of returning a value to the caller. A message traversing a patch cable is calling into the next object. &quot;Returning from a function&quot; is, in patching terms, backtracking to a prior object to see if it has more output cables that haven't been handled yet. But data don't travel backward up the stack, only down.</p>
<p>A file handle can be treated as a stream. Here, Pd recognizes the issue and allows shared file handles to be &quot;define&quot;-d: [file define xyz], and then every &quot;caller&quot; can have its own [file handle xyz].</p>
<p>If the data source is in memory, though, then the current position in the stream has to be maintained within the abstraction -- and there can be only one of those, because Pd/Max don't have a concept of a pointer to an abstraction that's loaded somewhere else. E.g., a really simple data queue (didn't implement &quot;rewind&quot; here) -- as an abstraction, everything would have to go through this.</p>
<p><img src="/uploads/files/1744253281563-pd-simple-queue.png" alt="pd-simple-queue.png" class="img-responsive img-markdown" /></p>
<p>So then there has to be a way to request a value <em>from a specific part of the patch</em> and get back to that part of the patch.</p>
<p><img src="/uploads/files/1744253344292-pd-dispatch.png" alt="pd-dispatch.png" class="img-responsive img-markdown" /></p>
<p>... where oid said, &quot;In that situation I would say that [pd my-stateful-thing] should have a send method&quot; -- seems to me that's what the above <em>is</em> (just not folded into the subpatch).</p>
<blockquote>
<p>Regarding your live-coding dialect, would be curious to see it if you shared it anywhere.</p>
</blockquote>
<p><a href="https://github.com/jamshark70/ddwChucklib-livecode" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode</a> -- see <a href="https://github.com/jamshark70/ddwChucklib-livecode/blob/master/cl-manual.pdf" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode/blob/master/cl-manual.pdf</a> for full documentation.</p>
<p>The parser (with heavy use of CollStream throughout) is at <a href="https://github.com/jamshark70/ddwChucklib-livecode/blob/master/parsenodes.sc" rel="nofollow">https://github.com/jamshark70/ddwChucklib-livecode/blob/master/parsenodes.sc</a></p>
<p>Example: <div class="embed-container"><iframe src="//www.youtube.com/embed/jGAztgg9ut0" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></p>
<blockquote>
<p>Most of what I do in pd is designing languages</p>
</blockquote>
<p>Quite curious about that. Anything public to see?</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Thu, 10 Apr 2025 02:49:37 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Thu, 10 Apr 2025 21:21:45 GMT]]></title><description><![CDATA[<p>I gotta say I'm kinda lost <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/15085/return-to-caller-followup-from-symbols-explicit/2</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/2</guid><dc:creator><![CDATA[porres]]></dc:creator><pubDate>Thu, 10 Apr 2025 21:21:45 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Thu, 10 Apr 2025 21:54:49 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>seems to me that's what the above <em>is</em> (just not folded into the subpatch).</p>
</blockquote>
<p>You already have the send method, you just are not using it, [list store] gives it to you for free, as do [float], [int] and [value] , [text] and [array] have the send method to get a pointer to their data. I find it difficult to think of a situation were we can not build our abstractions around these objects and easily get access to the internal state of an abstraction to send data backwards or even &quot;rewind&quot; the patch but you have to plan it that way. Am I missing something? I am good at missing the point when it comes to contrived examples and fail to see beyond the example.</p>
<p><img src="/uploads/files/1744321485435-untitled.png" alt="Untitled.png" class="img-responsive img-markdown" /></p>
<p>Not sure about pointers to abstractions, think I would need an example of your use case to address that.</p>
<blockquote>
<p>Quite curious about that. Anything public to see?</p>
</blockquote>
<p>Current project is actually getting a few of them into a shareable state, required me making a set of abstractions which is essentially a dialect of Tk since interacting with a text based language is awkward at best in pd. Believe the last hurdle in those abstractions has been passed and will finish them all up and document/upload them this coming week so I can get onto reworking the languages to use the Tk abstractions. They will get posted in the abstraction section as they become usable, I suspect only the Tk abstractions will have any real interest but I am curious to see if anyone uses my languages or they get people to develop their own languages. Thanks for the links, will dig into them this weekend.</p>
<p>Edit: forgot pic. And I did not quite plan that one out well, could easily cause an infinite loop or overflow depending on where [s backwards] actually sends to earlier in the patch. But I think it shows the logic?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/3</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/3</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Thu, 10 Apr 2025 21:54:49 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 03:11:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p>You already have the send method, you just are not using it,</p>
</blockquote>
<p>Here, though, if [list store] holds the queue's contents, then it's necessary to perform an operation to pop the top value off of the queue. Calling &quot;send xxx&quot; on the [list store] will send the entire queue contents to the target, but we don't want that. We want just the top value. Otherwise it's just a variable, it's not a queue.</p>
<p>After performing that operation ([list split 1] in my example), then you just have a datum, and the way to send a datum to a receiver is [send].</p>
<p>Part of the problem is that <a href="https://www.programiz.com/python-programming/iterator" rel="nofollow">iterators are commonplace in object oriented programming</a>, where patching doesn't easily support this idea of &quot;invoke the iterator from anywhere.&quot; If your primary frame of reference is patching, then this is going to seem a bit vague or weird.</p>
<p>A simpler scenario: if you have a note sequence, but you want 3 different players to request notes from the stream following their own independent timing. I guess that a more typical Pd approach would be a master [metro] driving the sequence, with logic below the sequencer to route the values among the different players. But that isn't independent timing -- each player needs its own [metro], and a way to pull from the stream. In SC:</p>
<pre><code>(
var noteSequence = Pshuf([48, 52, 53, 57, 59, 62, 64, 67, 72, 74, 79], inf).asStream;

~threePlayers = Ppar(
    Array.fill(3, { |i|
        \instrument, [\synth1, \synth2, \synth3][i],
        // one stream, shared among voices
        \midinote, noteSequence,
        \dur, Pexprand(0.2, 0.8, inf),  // independent per voice
    }),
    inf
).play;
)
</code></pre>
<p>I guess I'll have to build it out in Pd for this to make any sense, but I can't do it right now.</p>
<blockquote>
<p>Not sure about pointers to abstractions, think I would need an example of your use case to address that.</p>
</blockquote>
<p>Purely hypothetical, not worth pursuing.</p>
<blockquote>
<p>Current project is actually getting a few of them into a shareable state, required me making a set of abstractions which is essentially a dialect of Tk since interacting with a text based language is awkward at best in pd.</p>
</blockquote>
<p>Looking forward to examples -- I can't quite get the gist from this.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/4</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/4</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Fri, 11 Apr 2025 03:11:27 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 03:52:21 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>If your primary frame of reference is patching, then this is going to seem a bit vague or weird.</p>
</blockquote>
<p>Give us a working patch in SuperCollider with an example, not too complicated thoufh <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
<blockquote>
<p>I guess I'll have to build it out in Pd for this to make any sense, but I can't do it right now.</p>
</blockquote>
<p>I could build it too, but give us a patch that actually makes sound please. Again, try to be as minimal as you can</p>
<p>If I get it, you got one sequence and 3 independent playing from this sequence. I can envision a simple [clone] with 3 instances...</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/5</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/5</guid><dc:creator><![CDATA[porres]]></dc:creator><pubDate>Fri, 11 Apr 2025 03:52:21 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 04:09:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Right, like I said, I am terrible with contrived examples, I need context, I always confuse myself trying to deal with the unknown context. The only reason you have no iterator is because you are using [list split], [text] or [array] would be more suitable here, could move the headaches somewhere else but in my experience those headaches are from fighting data flow. [list] objects are not meant for sharing data and they are inefficient at it, could end up with loads of needless memory reallocations, [text] is not much better but when it reallocates you are only reallocating one object instead of two in your example abstraction and how many others in the rest of the patch?<br />
<img src="/uploads/files/1744343890635-tg.png" alt="tg.png" class="img-responsive img-markdown" /><br />
I will read your link in the morning in case I am still missing the point, so feel free to ignore explaining it to me if that is the case and your link explains it.</p>
<blockquote>
<p>Looking forward to examples -- I can't quite get the gist from this.</p>
</blockquote>
<p>You can do stuff like unpack the canvas from the patch window and fill the window with Tk widgets instead, or have the Tk widgets and the canvas tiled or tabbed, make new windows, embed other patches into your current patch, lots of fun stuff. The abstractions do all the hard work and setup the stuff for communicating with your patch.</p>
<p>Edit: That was a silly place to connect the [text get].</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/6</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/6</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Fri, 11 Apr 2025 04:09:40 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 07:53:57 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Had some free time before bed so read your link, don't see anything there which would not translate to pd/data flow without issue.</p>
<blockquote>
<p>each player needs its own [metro], and a way to pull from the stream.</p>
</blockquote>
<p>like this?<br />
<img src="/uploads/files/1744356899953-a.png" alt="a.png" class="img-responsive img-markdown" /><br />
All of this can easily be worked with each instrument being an abstraction using the right inlet on the array get or arguments or sending the pointer. Skipped some of the details but duration and getting the stream into the individual abstractions is straight forward enough and more of the same. I can't tell if I am missing something, life outside of data flow has become weirdly abstract for me, I am one of those sorts who really took to it. I am very interested in know what I am missing if I am missing something, I have been trying to cure my data flow myopia, it has become a bit of a disability in the last year or two.</p>
<p>Edit: Or is it that you just don't like that each needs its own metro? If so I think your issue is not with patchers/data flow but low level languages, pd is low level. But that is what abstraction and externals are for.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/7</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/7</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Fri, 11 Apr 2025 07:53:57 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 09:53:59 GMT]]></title><description><![CDATA[<p>reading this thread, what i understand so far is this is about calling some function, store its output and retrieve it at a given point... Something like this in pd? <img src="/uploads/files/1744364599189-image.png" alt="image.png" class="img-responsive img-markdown" /> do i miss something?<br />
`</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/8</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/8</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Fri, 11 Apr 2025 09:53:59 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 10:30:49 GMT]]></title><description><![CDATA[<p>Seems to me English is not up to the challenge here.</p>
<p>So here is what I mean:</p>
<p><img src="/uploads/files/1744366522750-pd-3-players.png" alt="pd-3-players.png" class="img-responsive img-markdown" /></p>
<p><img src="/uploads/files/1744366538606-pd-stream.png" alt="pd-stream.png" class="img-responsive img-markdown" /></p>
<p><a href="/uploads/files/1744366559178-triple-arp.pd">triple-arp.pd</a> -- plugdata, and uses else and/or cyclone for audio, apologies to vanilla-land.</p>
<p>The notes are to play in the same order continuously, but distributed among the three players. If I print out the symbols being accessed and add note indices, it's:</p>
<p>next: symbol instr3 -- play note 0<br />
next: symbol instr2 -- note 1<br />
next: symbol instr1 -- note 2<br />
next: symbol instr1 -- note 3<br />
next: symbol instr2 -- note 4<br />
next: symbol instr1 -- note 5<br />
next: symbol instr3 -- note 6<br />
next: symbol instr2 -- note 7<br />
next: symbol instr1 -- note 8<br />
next: symbol instr1 -- note 9<br />
next: symbol instr2 -- note 10<br />
next: symbol instr3 -- note 11 etc.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/porres">@porres</a> 's &quot;one sequence and 3 independent playing from this sequence. I can envision a simple [clone] with 3 instances...&quot; sounds like it will clone the sequence -- that's not the same thing.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> 's version will skip notes, because it's advancing through the stream on a fast timing that is independent of the three players' timing (and the order isn't deterministic -- whereas SC's Pshuf repeats the same shuffled ordering). That's also a misinterpretation. The advancement through the stream should be passive, in response to requests from the players.</p>
<p>(&quot;Why would you want to do that?&quot; Why not... it's a reasonable algorithm.)</p>
<p>Now, why do I care about this? Because I've done a lot with state-machine parsers and found it to be really nice to have, for instance (and speculating in Pd terms) an abstraction that parses an identifier, and another abstraction that parses a number, and another that parses some kind of bracketed group containing identifiers and numbers, etc. How do these different parts of the patch know where you are in the source string? This is easy if there is a shared object that streams out the characters one by one, and the character goes to the part of the patch that requested it. Distributing a single stream among multiple players is just a different version of the same problem -- I was hoping that putting it in musical terms would make it clearer, but that seems not quite to have worked.</p>
<p>It's mainly out of curiosity to see how patching handles this.</p>
<ul>
<li>I'm suggesting [send] with a variable target: the request tells the stream where to send its &quot;next&quot; result.</li>
<li>Or <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/solipp">@solipp</a> has suggested to spray the value everywhere in the patch that it might be needed, and then the caller bangs only the one it's interested in.</li>
</ul>
<p>I feel a bit like the &quot;spray everywhere&quot; solution would require more object copy/paste -- mine just has &quot;; next symbol instr1&quot; where the other needs a [t], a [s], a [r], and an [f]. Also my [pd stream], if it used a list instead of an array, could be type-agnostic. (I only used an array here to avoid more lectures about the perils of list manipulations, which are not quite relevant I think.) But YMMV.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/9</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/9</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Fri, 11 Apr 2025 10:30:49 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 11:58:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a></p>
<blockquote>
<p>I feel a bit like the &quot;spray everywhere&quot; solution would require more object copy/paste -- mine just has &quot;; next symbol instr1&quot; where the other needs a [t], a [s], a [r], and an [f].</p>
</blockquote>
<p>well, you can wrap it into a subpatch and copy/paste that : )<br />
Essentially both methods are not complicated, they just have to be implemented in a low level language as <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> pointed out.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/10</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/10</guid><dc:creator><![CDATA[solipp]]></dc:creator><pubDate>Fri, 11 Apr 2025 11:58:27 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Fri, 11 Apr 2025 17:09:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>Seems to me English is not up to the challenge here.</p>
</blockquote>
<p>We just needed to identify the actual issue here, which is not patching but low level language. To do the sorts of things you want to do means you have to define an interface and a protocol, those things which high level languages like SC take care of for you. Pd has no concept of an instrument and if you want to use such a paradigm it is up to you to implement it. One way would be to send the instruments args to a master abstraction which then takes the necessary actions, a quick and simple example which is not fully fleshed out but should show the logic:<br />
<img src="/uploads/files/1744390733432-d.png" alt="d.png" class="img-responsive img-markdown" /><br />
Started adding in my $0s halfway through. You would probably want a [text] in [register] to keep track of all this stuff and it can also keep track of values you can query for in the various abstractions and what not through their send methods. [stream] would need some more logic, needs a [receive] to start/stop it and probably would want a way to change its settings as well as an [iemguts/canvasdelete] so you can clean things up as your patch changes. [synth1] seems pretty complete and a solid instrument, I wouldn't change it.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/11</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/11</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Fri, 11 Apr 2025 17:09:02 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 01:27:20 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Does this behave like a shared stateful function that returns to the caller? <a href="/uploads/files/1744421171887-returntocaller.pd">returnToCaller.pd</a><img src="/uploads/files/1744421201249-screenshot-2025-04-11-212225.png" alt="Screenshot 2025-04-11 212225.png" class="img-responsive img-markdown" /></p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/12</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/12</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Sat, 12 Apr 2025 01:27:20 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 01:34:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p>We just needed to identify the actual issue here, which is not patching but low level language. ... Pd has no concept of an instrument... it is up to you to implement it.</p>
</blockquote>
<p>The instrument isn't the point (and [pd instr1] etc. in my example <em>is</em> an implementation, though a minimally simple one).</p>
<p>But... as I read your design... if I &quot;; register asStream synth1&quot; then synth1 gets a new instance of the stream abstraction, and if I subsequently &quot;; register asStream synth2&quot; then synth2 gets a <em>separate</em> instance of the stream abstraction... which is precisely <em>not</em> what I'm talking about.</p>
<p>In SC, if I define multiple sequences based on patterns, then each sequence makes its own stream:</p>
<pre><code>(
var pattern = Pn(Pseries(0, 1, 15), inf);

var seq = Pfindur(24, Ppar([
    // this can be written with less code,
    // but I'd better expand it out because
    // the shorter version hides the multiple
    // references to 'pattern'
    Pbind(
        \instrument, \instr1,
        \degree, pattern,
        \dur, 0.25
    ),
    Pbind(
        \instrument, \instr2,
        \degree, pattern,
        \dur, 0.25 * 4/3,
    ),
    Pbind(
        \instrument, \instr3,
        \degree, pattern,
        \dur, 0.25 * 4/5
    )
]));

m = SimpleMIDIFile.fromPattern(seq, inTracks: 3, inTempo: 60, trackNames: [\instr1, \instr2, \instr3]);

m.write(&quot;~/tmp/parallel-streams2.mid&quot;.standardizePath);
)
</code></pre>
<p><img src="/uploads/files/1744421558181-parallel-streams.png" alt="parallel-streams.png" class="img-responsive img-markdown" /></p>
<p>If, on the other hand, a single stream is made at the top, and shared among the sub-sequences, then the notes are interleaved in time order.</p>
<pre><code>(
var stream = Pn(Pseries(0, 1, 15), inf).asStream;

var seq = Pfindur(24, Ppar([
    Pbind(
        \instrument, \instr1,
        \degree, stream,
        \dur, 0.25
    ),
    Pbind(
        \instrument, \instr2,
        \degree, stream,
        \dur, 0.25 * 4/3,
    ),
    Pbind(
        \instrument, \instr3,
        \degree, stream,
        \dur, 0.25 * 4/5
    )
]));

m = SimpleMIDIFile.fromPattern(seq, inTracks: 3, inTempo: 60, trackNames: [\instr1, \instr2, \instr3]);

m.write(&quot;~/tmp/shared-stream.mid&quot;.standardizePath);
)
</code></pre>
<p><img src="/uploads/files/1744421567231-shared-stream.png" alt="shared-stream.png" class="img-responsive img-markdown" /></p>
<p>The latter is what I'm after (and is in fact what my example patch does). And it's not even that I care that much about the musical result, but that this is a musical context for a general programming problem.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/13</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/13</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 12 Apr 2025 01:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 01:37:09 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/jameslo">@jameslo</a> said:</p>
<blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Does this behave like a shared stateful function that returns to the caller?</p>
</blockquote>
<p>It does (and is basically identical to the approach in my example patch above).</p>
<p>So perhaps this really is the best way.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/14</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/14</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 12 Apr 2025 01:37:09 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 01:51:40 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>(and is basically identical to the approach in my example patch above).</p>
</blockquote>
<p>Oh sorry, I missed that. TBH I've been barely hanging on <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /> I'll go back and read why you were hesitant about endorsing this approach. But don't you think that in the end, all languages have things that are convenient and things that are inconvenient, and so....so what? Before I retired I was studying functional programming languages like Haskell, and I didn't get far enough along to understand how the hell you could program without state! I understood that it was great for multiprocessing, but wow.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/15</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/15</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Sat, 12 Apr 2025 01:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 02:17:59 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>The latter is what I'm after</p>
</blockquote>
<p>Oh, that is simple enough to do, just replace the [f ] in the stream abstraction with a [v ] shared between the abstractions like the array. Getting there?<br />
<img src="/uploads/files/1744423825056-maybe.png" alt="maybe.png" class="img-responsive img-markdown" /><br />
Obviously you would want asStream to create the [array define]s as needed and the symbols for the array and value having their own iterators so it can manage multiple streams but that is simple enough. Oh, and register its array and value symbols so you can grab them as needed and append to the array and what not.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/16</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/16</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sat, 12 Apr 2025 02:17:59 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 02:41:54 GMT]]></title><description><![CDATA[<p>Also thought of [v]</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/17</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/17</guid><dc:creator><![CDATA[porres]]></dc:creator><pubDate>Sat, 12 Apr 2025 02:41:54 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 10:17:22 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> the [v] for the index is interesting. I wouldn't have thought of that.</p>
<p>(I guess?) I still lean slightly toward the targeted-send approach, over the spray-everywhere approach. One reason is, if you're using lists, sending a sub-list to one place is likely to be more efficient than sending it to potentially dozens of places. It's a valid concern, about redundant list allocations; one way to deal with that is to be less promiscuous about sending data to places where they won't be used.</p>
<p>I do appreciate everyone's indulgence. I've certainly gotten more comfortable with patching over the years, but I'm never quite sure if what I'm doing is really idiomatic.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/18</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/18</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sat, 12 Apr 2025 10:17:22 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sat, 12 Apr 2025 21:59:02 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Value has been mentioned multiple times in both threads <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /> It has been fun. I took a break from my projects and threw together asStream, it will be awhile before I get back around to it but here it 99% complete, there is a stupid error on the append so it is actually insert and for some reason I just can not figure out it is not resetting the [v] when it completes. You can solve those if you care. Oh, and it spits out an extra repeated number second to last, at least with my simple test, not sure why but worst case a [change] between the [array get]  and [s] in stream.pd will fix that. Report back if you figure out why it is not resetting to zero, driving me nuts but  I have other things to do. Patch in next post.</p>
<p>Not sure what you mean by &quot;spray everywhere,&quot; these are targeted approaches and there is no copying. Does reallocate on resizing the array but that could be avoided easily enough, just use an array bigger than you will ever need and only use what you need.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/19</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/19</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sat, 12 Apr 2025 21:59:02 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 11:25:45 GMT]]></title><description><![CDATA[<p>Realized my errors finally, extra output was because I forgot to add a [- 1] after a [list length]. The [v ] not resetting was order of operations but decided that the logic of automatically resetting to zero was flawed so now it resets only if you send [start( when it is at the end up the array. The stupidest mistakes are always the hardest to see. Fixed and added an optional delay before the metro so they don't have to all start at the same time. Fixed [append( as well and give it a right inlet for appending without the [append list( which is probably how it should be? Still could use some logic to make sure you don't duplicate streams and perhaps the ability to configure individual streams but that is for someone else or some other day. Added some usage notes in the patch.</p>
<p>Improved version below.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/20</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/20</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sun, 13 Apr 2025 11:25:45 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 04:33:38 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p>Added some usage notes in the patch</p>
</blockquote>
<p>don't see it, where are the help files?</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/21</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/21</guid><dc:creator><![CDATA[porres]]></dc:creator><pubDate>Sun, 13 Apr 2025 04:33:38 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 07:19:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> Value has been mentioned multiple times in both threads <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/grinning.png" title=":)" alt=":)" /></p>
</blockquote>
<p>I know, and I've used value in other places. I hadn't thought to connect it to the current index, though.</p>
<blockquote>
<p>Not sure what you mean by &quot;spray everywhere,&quot; these are targeted approaches and there is no copying.</p>
</blockquote>
<p>Sure, that's a misreading. I see also (on closer inspection) that folding the metro into the stream abstraction makes the stream effectively its own caller, sidestepping the return to caller problem. Though this means that your approach could be used only in self-timed situations, where SC streams and Python iterators are more general.</p>
<p>Haskell people like to say that a programming language isn't worth learning if it doesn't change the way you think. Pd has actually done that for me, to some extent.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/22</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/22</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Sun, 13 Apr 2025 07:19:27 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 12:07:28 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/porres">@porres</a> No help file, usage notes in asStream.pd, this thread is the documentation. If I ever get it to the point where I don't think there will be any major changes I will upload it with help files over in Abstractions. But a new version, reworked it as an array object since that is what it really is.  Also added looping. Still needs lots of work to be a useful abstraction for more than learning from, it is kind of fun though and eventually I will develop it more.</p>
<p><a href="/uploads/files/1744540833447-asstream.pd">asStream.pd</a><br />
<a href="/uploads/files/1744540278027-stream.pd">stream.pd</a></p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> said:</p>
<blockquote>
<p>Though this means that your approach could be used only in self-timed situations,</p>
</blockquote>
<p>Just need to change [obj 10 10 stream $1 $2 $3...( to [obj 10 10 $1 $2 $3...( and add in some simple logic and now asStream can load the abstraction you specify through methods/arguments. As I said earlier, you design the interface and the protocol which is what those sends and receives and values and dollar arguments in asStream are, an interface and protocol for communicating with the stream.pd abstraction or any other abstraction designed to work with that interface. Object names themselves can also be filled in through arguments, [$1 $2] can be either a metro or a receive or anything else but [$1 $2 ....] are actually [list]s so they only give you two inlets and one outlet, if you need more than that you need to resort to editing the abstraction in a text editor, patch it together with any object with suitable io and then open it in a text editor and edit that object into $1 $2... And there is plain old dynamic patching to programmatically create the required patch. Lots of option and they can all be mixed.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/23</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/23</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sun, 13 Apr 2025 12:07:28 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 15:25:37 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a> said:</p>
<blockquote>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/porres">@porres</a> No help file, usage notes in asStream.pd, this thread is the documentation.</p>
</blockquote>
<p>You see, I'm interested in this thread, I suggested that it would be created. I'm interested in the problem and how to make it work in Pd. I read the thread. This that you're sharing is not enough for me. I get that you may be satisfied and that you worked a lot and just about as much as you care on this, but I just wanted to make this clear. Ok, I know, I could do more of my homework, but I'm born and bred in Pd-land, all this just sounds way too complicated and like explaining 'snow' to me, who's also born and bred in a tropical country (I was at the beach yesterday by the way), so more help would be appreciated.</p>
<p>I have brought myself into such Pd x SC challenge other times, it's not the first time that things don't get too conclusive. I hear that it's impossible to do something &quot;x&quot;, or too hard, and I hear about complex programming paradigms, and then it comes down to a simple solution like using [value]. My idea is to maybe try and expand Pd to improve it and open it up to what some people that come from elsewhere struggle with, and maybe offer a new object in my ELSE library... but all I'm getting so far from this thread is that you can share the index of an array with [value] in multiple subpatches or abstractions.</p>
<p>I was interested in studying this abstraction and see if maybe I could add it if I really got what it did and what it is for, but for now it's just quite abstract and over my head.</p>
<p>cheers</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/24</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/24</guid><dc:creator><![CDATA[porres]]></dc:creator><pubDate>Sun, 13 Apr 2025 15:25:37 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Sun, 13 Apr 2025 23:01:42 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/porres">@porres</a> I am more than happy to answer any questions you have about using it or how it works. As I said in the other thread, I hate doing documentation, it tends to turn into a rabbit hole for me and eat up a good deal of time; once I start thinking about usage I start seeing how some things are not right in the abstraction and I start fiddling which means a change to the docs and it quickly turns into a feedback loop. That small change to the manual I suggested in the other thread caused/required me to reread much of section 2 and reread a few sections many times even though I had it all typed out after reading two short section once.</p>
<p>I don't think extending pd would solve this issue, the question was not really how to do this in an isolated situation but about the methodology. How do you do something like <code>functionA (functionB (1 2) 849 functionC ($1 $2) asdf)</code> in pd? In a one off situation it is generally a fairly simple problem to solve but to make it so at anytime you can do the equivalent of <code>[abstractionA [abstractionB 1 2] 849 [abstractionC $1 $2] asdf]</code> is a much more complicated issue and one which externals don't solve and often make it seem more complicated than it actually is because they have a tendency to make pd feel like a higher level language than it is, keep the user from ever really learning the nuances and techniques of the low level dataflow paradigm that is pd. The one off solutions which often come up in these threads result in what I think <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> refers to as &quot;spray everywhere,&quot; to try and build that solution into every abstraction so you can use it everywhere but to get the equivalent of abstractions calling abstractions would require you to fill your abstractions with [v ]s and [send]s and [receives]s in the vain attempt to cover every possible situation and very complicated/convoluted bit of inter abstraction communication. All my posts since the first asStream screenshot post have been about methodology, how to build higher level paradigms in a low level language like pd and avoid spraying everywhere, this is what asStream is meant to show. Like any well founded low level language pd is quite good about giving you the tools to build out higher level functionality and adapt it into your own language. At least that is what I got from this thread.</p>
<p>asStream has the potential to be a really useful abstraction but still has some issues, I can help you understand it and flesh it out, just ask your questions, they will probably make it a better abstraction than either of us could make on our own. As an exercise I will attempt to repatch it in your heavily subdivided patching style on my next break from my projects, I will probably fail but it will be interesting, I get the logic of the style but it obfuscates the dataflow for me and anytime I want to understand the work of a subdivider I have to remove all that subdivision, I can't even see how it could be subdivided into discrete, well named subpatches of highly singular/specialized function, for me it already is that.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/25</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/25</guid><dc:creator><![CDATA[oid]]></dc:creator><pubDate>Sun, 13 Apr 2025 23:01:42 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Mon, 14 Apr 2025 01:27:01 GMT]]></title><description><![CDATA[<p>FWIW, I interpreted &quot;spray everywhere&quot; to mean that Pd &quot;functions&quot; spray their return values to every place that could potentially need it, depending on the control flow. That's a common way of dealing with Pd's lack of intrisic &quot;return to caller&quot; when there are just a few callers.</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/26</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/26</guid><dc:creator><![CDATA[jameslo]]></dc:creator><pubDate>Mon, 14 Apr 2025 01:27:01 GMT</pubDate></item><item><title><![CDATA[Reply to &quot;Return to caller&quot; (followup from &quot;symbols explicit&quot;) on Mon, 14 Apr 2025 01:28:25 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/porres">@porres</a></p>
<blockquote>
<p>for now it's just quite abstract and over my head</p>
</blockquote>
<p>I made a concrete example -- with scores! <img class="emoji emoji-extended" src="http://forum.pdpatchrepo.info/plugins/nodebb-plugin-emoji-extended/images/wink.png" title="wink" alt=":wink:" /> If the programming-ese terminology is too difficult, maybe focus on that example.</p>
<blockquote>
<p>I hear that it's impossible to do something &quot;x&quot;, or too hard, and I hear about complex programming paradigms, and then it comes down to a simple solution like using [value].</p>
</blockquote>
<p>That's a good point. Sometimes it takes effort to find the simplest way.</p>
<p><a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/oid">@oid</a></p>
<blockquote>
<p>I don't think extending pd would solve this issue</p>
</blockquote>
<p>Yeah, the core of the issue is that Pd's stack works differently from most text languages since Fortran.</p>
<p>Tbh I think variable-target [send] is fine, once it's been established that [send] is going to be involved in pretty much any Pd solution. &quot;Return to caller&quot; as in any structured or object-oriented language is nicer, but [send] is not bad.</p>
<blockquote>
<p>what I think <a class="plugin-mentions-a" href="http://forum.pdpatchrepo.info/user/ddw_music">@ddw_music</a> refers to as &quot;spray everywhere,&quot;</p>
</blockquote>
<p>Here, I'm referring specifically to <a href="https://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/8" rel="nofollow">https://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/8</a> , where the [send] pushes the value out to all matching receivers -- to every potential caller -- where it's swallowed by an [f]'s cold inlet, and only the specific caller pushes the value forward. If you have 50 potential callers, then the data have to be replicated 50 times.</p>
<p>If the data are sub-lists instead of single floats, that would be a lot of multiple allocation. My/jameslo's solution doesn't do that; nor does yours.</p>
<blockquote>
<p>to get the equivalent of abstractions calling abstractions would require you to fill your abstractions with [v ]s and [send]s and [receives]s in the vain attempt to cover every possible situation</p>
</blockquote>
<p>[list-map] in list-abs shows a nice approach, though, decoupling the iteration logic from the user-operation: the abstraction outputs a trigger to perform the operation, and then the result of that operation is put back into the abstraction to finish the job. That could inspire a super-minimalist approach (which has the benefit of assuming nothing about the returned value's type, whereas most other solutions posted here seem to assume it will always be a single float):</p>
<p><img src="/uploads/files/1744593937202-pd-call-return.png" alt="pd-call-return.png" class="img-responsive img-markdown" /></p>
<p>Now, I didn't think of this until the discussion went through a few iterations... see porres's comment about the eventual solution often being much simpler than the problem seems at first.</p>
<p>hjh</p>
]]></description><link>http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/27</link><guid isPermaLink="true">http://forum.pdpatchrepo.info/topic/15085/return-to-caller-followup-from-symbols-explicit/27</guid><dc:creator><![CDATA[ddw_music]]></dc:creator><pubDate>Mon, 14 Apr 2025 01:28:25 GMT</pubDate></item></channel></rss>