<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: patcherargs in nested abstractions &#8211; what&#039;s happening here?</title>
		<atom:link href="http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 05:55:10 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-26502</guid>
					<title><![CDATA[patcherargs in nested abstractions &#8211; what&#039;s happening here?]]></title>
					<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-26502</link>
					<pubDate>Wed, 21 Jun 2006 04:39:02 +0000</pubDate>
					<dc:creator>johnpitcairn</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;ve made a little send abstraction [s.] that concatenates multiple arguments into a send name, ie [s. A B] makes [s A.B] inside the abstraction, using a loadbanged patcherargs object.</p>
<p>This works fine when used in a patch or subpatches inside that, but when it&#8217;s used inside another abstraction [s.test] that is instantiated in the parent patch, I&#8217;m getting doubled messages.</p>
<p>If I concatenate conventional numbered arguments for the [s.] abstraction, ie [loadmess #1 #2], it works correctly, and I have been using that for some time. But I want to allow for an arbitrary number of arguments, thus the use of patcherargs.</p>
<p>So it&#8217;s something to do with patcherargs when used in nested abstractions. What&#8217;s happening? Is it supposed to happen? Any workarounds?</p>
<p>test patch:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 294 221 50 196617 print E.F;<br />
#P newex 294 192 50 196617 r E.F;<br />
#P comment 293 58 61 196617 this doesn&#8217;t;<br />
#P message 200 89 28 196617 stop;<br />
#P button 178 89 15 0;<br />
#P newex 178 126 61 196617 metro 999;<br />
#N vpatcher 20 74 620 474;<br />
#P inlet 81 121 15 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 81 162 50 196617 s. C D;<br />
#P connect 1 0 0 0;<br />
#P pop;<br />
#P newobj 178 155 61 196617 p subpatch;<br />
#P newex 74 219 50 196617 print AB;<br />
#P newex 74 190 50 196617 r A.B;<br />
#P message 96 90 28 196617 stop;<br />
#P button 74 90 15 0;<br />
#P newex 74 127 61 196617 metro 999;<br />
#P newex 74 155 50 196617 s. A B;<br />
#P newex 179 221 50 196617 print CD;<br />
#P newex 179 192 50 196617 r C.D;<br />
#P message 315 90 28 196617 stop;<br />
#P button 293 90 15 0;<br />
#P newex 293 127 61 196617 metro 999;<br />
#P newex 293 155 71 196617 s.test E F;<br />
#P comment 109 58 100 196617 both these work fine;<br />
#P connect 2 0 1 0;<br />
#P connect 18 0 19 0;<br />
#P connect 5 0 6 0;<br />
#P connect 11 0 12 0;<br />
#P connect 14 0 13 0;<br />
#P connect 15 0 14 0;<br />
#P connect 16 0 14 0;<br />
#P connect 4 0 2 0;<br />
#P connect 3 0 2 0;<br />
#P connect 10 0 8 0;<br />
#P connect 9 0 8 0;<br />
#P connect 8 0 7 0;<br />
#P window clipboard copycount 20;</p>
<p>[s.test] abstraction:</p>
<p>#P inlet 103 167 15 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 103 198 50 196617 s. $1 $2;<br />
#P connect 1 0 0 0;<br />
#P window clipboard copycount 2;</p>
<p>[s.] abstraction:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P message 268 83 58 196617 separator .;<br />
#P newex 198 37 50 196617 loadbang;<br />
#P newex 198 82 64 196617 patcherargs;<br />
#P newex 198 124 50 196617 tosymbol;<br />
#P inlet 30 37 15 0;<br />
#P objectname inlet;<br />
#P newex 31 297 24 196617 b 1;<br />
#P message 31 320 157 196617 script connect inlet 0 snd 0;<br />
#N thispatcher;<br />
#Q end;<br />
#P newobj 198 361 64 196617 thispatcher;<br />
#P newex 198 254 270 196617 prepend script new snd newex 30 60 150 196617 s;<br />
#P connect 7 0 6 0;<br />
#P connect 7 0 8 0;<br />
#P fasten 0 0 3 0 203 285 36 285;<br />
#P connect 0 0 1 0;<br />
#P fasten 2 0 1 0 36 349 203 349;<br />
#P connect 5 0 0 0;<br />
#P connect 6 0 5 0;<br />
#P connect 8 0 5 0;<br />
#P connect 3 0 2 0;<br />
#P window clipboard copycount 9;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79352</guid>
					<title><![CDATA[Re: patcherargs in nested abstractions &#8211; what&#039;s happening here?]]></title>
					<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79352</link>
					<pubDate>Wed, 21 Jun 2006 08:25:36 +0000</pubDate>
					<dc:creator>Léopold Frey</dc:creator>

					<description>
						<![CDATA[
						<p>John Pitcairn a écrit :<br />
> I&#8217;ve made a little send abstraction [s.] that concatenates multiple arguments into a send name, ie [s. A B] makes [s A.B] inside the abstraction, using a loadbanged patcherargs object.<br />
><br />
> This works fine when used in a patch or subpatches inside that, but when it&#8217;s used inside another abstraction [s.test] that is instantiated in the parent patch, I&#8217;m getting doubled messages.<br />
><br />
> If I concatenate conventional numbered arguments for the [s.] abstraction, ie [loadmess #1 #2], it works correctly, and I have been using that for some time. But I want to allow for an arbitrary number of arguments, thus the use of patcherargs.<br />
><br />
> So it&#8217;s something to do with patcherargs when used in nested abstractions. What&#8217;s happening? Is it supposed to happen? Any workarounds?<br />
>   </p>
<p>Hi John</p>
<p>when you 2xClick on [r E.F] the popup shows 2 [s E.F].</p>
<p>I think you&#8217;re object is instantiated once when the patch s.test is <br />
loaded and another time when max give it&#8217;s arguments to s.test,<br />
though I can&#8217;t manage to see anything in the max window. weird, maybe <br />
someone else has an answer for this behaviour ?</p>
<p>A workaround is to delete you&#8217;re object before creating a new one<br />
(though in you&#8217;re saved abstraction there is no object &#8220;snd&#8221;)<br />
so create a dummy one in you&#8217;re abstraction, delete it, it works. see <br />
patch below.</p>
<p>[s.]</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 30 61 73 196617 s AEAEAEAEA;<br />
#P objectname snd;<br />
#P newex 194 261 38 196617 t b s b;<br />
#P message 268 308 85 196617 script delete snd;<br />
#P message 268 83 58 196617 separator .;<br />
#P newex 198 37 50 196617 loadbang;<br />
#P newex 198 82 64 196617 patcherargs;<br />
#P newex 198 124 50 196617 tosymbol;<br />
#P inlet 30 37 15 0;<br />
#P objectname inlet;<br />
#P newex 31 297 24 196617 b 1;<br />
#P message 31 320 157 196617 script connect inlet 0 snd 0;<br />
#N thispatcher;<br />
#Q end;<br />
#P newobj 198 361 64 196617 thispatcher;<br />
#P newex 198 221 270 196617 prepend script new snd newex 30 60 150 196617 s;<br />
#P connect 10 2 9 0;<br />
#P connect 7 0 6 0;<br />
#P connect 7 0 8 0;<br />
#P connect 9 0 1 0;<br />
#P fasten 2 0 1 0 36 349 203 349;<br />
#P connect 10 1 1 0;<br />
#P connect 5 0 0 0;<br />
#P connect 6 0 5 0;<br />
#P connect 8 0 5 0;<br />
#P connect 0 0 10 0;<br />
#P connect 3 0 2 0;<br />
#P connect 10 0 3 0;<br />
#P connect 4 0 11 0;<br />
#P window clipboard copycount 12;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79353</guid>
					<title><![CDATA[Re: patcherargs in nested abstractions &#8211; what&#039;s happening here?]]></title>
					<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79353</link>
					<pubDate>Wed, 21 Jun 2006 09:21:50 +0000</pubDate>
					<dc:creator>johnpitcairn</dc:creator>

					<description>
						<![CDATA[
						<p></p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79354</guid>
					<title><![CDATA[Re: patcherargs in nested abstractions &#8211; what&#039;s happening here?]]></title>
					<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79354</link>
					<pubDate>Wed, 21 Jun 2006 14:34:42 +0000</pubDate>
					<dc:creator>grg</dc:creator>

					<description>
						<![CDATA[
						<p>
Am 21.06.2006 um 11:21 schrieb John Pitcairn:<br />
> Weird indeed. I did test with print statements of course, and that <br />
> seems to indicate loadbang/patcherargs only fires once. If it&#8217;s <br />
> somehow sending again all by itself, or the loadbang is firing twice, <br />
> invisibly, I&#8217;d call that a bug.</p>
<p>hey John,</p>
<p>in the example you posted, all 3 versions output twice for me. I think <br />
the scripted send object is simply created twice (sometimes). Why <br />
loadbang patcherargs if it outputs on load anyway? Loadbanging <br />
something that loadbangs itself turns out to be nondeterministic.</p>
<p>using this as &#8220;s.&#8221; works for me:</p>
<p>cheers, g.</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P message 328 90 58 196617 separator .;<br />
#P newex 258 64 27 196617 t l b;<br />
#P newex 258 39 64 196617 patcherargs;<br />
#P newex 258 131 50 196617 tosymbol;<br />
#P inlet 90 44 15 0;<br />
#P objectname inlet;<br />
#P newex 91 304 24 196617 b 1;<br />
#P message 91 327 157 196617 script connect inlet 0 snd 0;<br />
#N thispatcher;<br />
#Q end;<br />
#P newobj 258 368 64 196617 thispatcher;<br />
#P newex 258 261 270 196617 prepend script new snd newex 30 60 150 <br />
196617 s;<br />
#P connect 7 1 8 0;<br />
#P fasten 2 0 1 0 96 356 263 356;<br />
#P fasten 0 0 3 0 263 292 96 292;<br />
#P connect 0 0 1 0;<br />
#P connect 5 0 0 0;<br />
#P connect 8 0 5 0;<br />
#P connect 7 0 5 0;<br />
#P connect 6 0 7 0;<br />
#P connect 3 0 2 0;<br />
#P window clipboard copycount 9;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79355</guid>
					<title><![CDATA[Re: patcherargs in nested abstractions &#8211; what&#039;s happening here?]]></title>
					<link>http://cycling74.com/forums/topic/patcherargs-in-nested-abstractions-whats-happening-here/#post-79355</link>
					<pubDate>Wed, 21 Jun 2006 22:37:03 +0000</pubDate>
					<dc:creator>johnpitcairn</dc:creator>

					<description>
						<![CDATA[
						<p>Huh. Yeah. From the reference manual:</p>
<p>&#8220;Out left outlet: A list of the parent patcher&#8217;s arguments are sent out the left outlet when the patcher is loaded.&#8221;</p>
<p>I think perhaps the help file could use a small modification, because there&#8217;s no mention of that therein &#8211; it looks like patcherargs needs a bang to output. You wouldn&#8217;t notice the auto-output unless the Max window is visible and you&#8217;re paying attention to it.</p>
<p>Thanks for the help.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

