<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br>Hallo,<br>Libero Mureddu hat gesagt: // Libero Mureddu wrote:<br><br>&gt; Hi, here is a working example of the proportional canon patch.&nbsp;&nbsp;Now
<br>&gt; I have the following question: if I want to make this patch an<br>&gt; abstraction, and use more instances of it, how to avoid duplications<br>&gt; of the same &quot;send&quot;, coll, etc?<br>&gt;<br>&gt; I read the subpatch tutorial, but the mechanism is not really clear.
<br><br>I don&#39;t know which tutorial you mean, but: subpatches are something<br>completely different from abstractions, so a subpatch tutorial won&#39;t<br>help you.</blockquote><div><br>Hi,<br>it is in Pd documentation browser -&nbsp; 
2.control examples - 12.PART2.subpatch.pd <br></div>Itīs the documentation, not a tutorial, sorry, I mismatched the words.<br><br>Thanks a lot for your message, now the use of $0 is quite clear.<br><br>Regards,<br><br>Libero
<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Subpatches are objects -- [pd] or [page] -- while abstractions are<br>files: Abstractions have to be saved into their own file, then you can
<br>call them by their filename minus the .pd ending in another patch,<br>also multiple times. When abstraction are used this way in another<br>file, people often call various occurences of the same abstraction<br>different &quot;instances&quot; of an abstraction.
<br><br>In each instance of an abstraction and actually in every seperate<br>patch file that you have opened, the special variable &quot;$0&quot; gets a<br>unique value. (Note that &quot;$0&quot; can only be used in object names, not in
<br>message boxes.)<br><br>So to avoid duplicate names for s/r, you can use names with &quot;$0&quot; in<br>your send/receive pairs:<br><br> |<br> [s $0-local]<br><br> [r $0-local]<br> |<br><br>This in practice is (almost) as local as a direct connection.
<br><br>You can use the same approach for [table $0-local-array] or [catch~<br>$0-left].&nbsp;&nbsp;For last year&#39;s versions of Pd (i.e. prior to 0.40) you<br>have to start your name with $0 for this to work, while current 0.4x
<br>versions of Pd also allow $0 inside a name like [r pd-$0-name].<br><br>To get back to subpatches for a moment: $0 is only unique in whole<br>patch *files* and in abstraction instances. If you use $0 in two<br>subpatches, that live in the same file, they will have the *same*
<br>value for $0.&nbsp;&nbsp;You cannot create a sender that is local only in a<br>subpatch with $0.<br><br>I don&#39;t know how [coll] deals with $0, I never use that object.<br><br>Ciao<br>--<br> Frank Barknecht&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _ ______footils.org_ __goto10.org__
<br><br></blockquote></div>