<?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: Execution order with [js] mixed up / depending on if manual or metro bang</title>
		<atom:link href="http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 00:16:28 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-62686</guid>
					<title><![CDATA[Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-62686</link>
					<pubDate>Fri, 30 Mar 2012 20:51:35 +0000</pubDate>
					<dc:creator>evsc</dc:creator>

					<description>
						<![CDATA[
						<p>I am observing a weird delay issue involving a javascript object. I wonder if its due to a setting on my computer / some maxmsp settings, or if its a bug in the system. I would be grateful if someone could copy the code below and verify if it behaves the same way for them. </p>
<p>I use a js-object, and for some reason the execution of the javascript seems to be delayed depending on if i trigger the execution with a manual bang or a bang coming from a metro object. And i can&#8217;t explain why &#8230;</p>
<div><span id="toggle62686-0" class="patchtoggle" onmousedown="toggleMaxPatch('post62686-0', 'er62686-0');">&#8211; Pasted Max <span id="maxversion62686-0"></span> Patch, click to <span id="er62686-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A607.3ocyVF1axBCDG%2B0rj8c3BuZKwGGETP7IYI6ywCKKUnh0.WIPw4lYe2ef%0Ah3Pm5Pcp6ElKd8n89%2Bq8t1E2dil9HwbVlNLD9GnosnvilxWoGsZGZ5wz49Qz%0ALUf59h3XFJ06rbPIatTMvCO.SoynY9o7DILlGwF5gd33bzWxEHDmE9BGk2M6%0AdObgGJxkQL4cFcfY2%2BWO7COb0TFwQluHGUyqcs2wBThzXlZwdJkSiV8AXdb0%0AzoRQiZ27.UrhQS%2BisdyoIi%2BtZZHlcWEbBU5Ogigujx7kUHgzypXbf3ZqL8MJ%0AMCb6Z.O2Xk4X8BSTN%2B31aJsElNmNTGQwP3UtbBDyjoB3QnPnI4Rn3KXYk%2BAD%0AiAQZ.KcH.l.Y6Pz7GAh8OFH5NPQsAMPnUuKNBioXNMJ5sMAHGWAOBXdNgWui%0AAdNkCClVma3grWKxwuxtjTdCjdR525XzeO0wFKhasxKfgwET%2BuGAgoh7jFGM%0AZMDL2BD9bZpBT9VBqRo55cJ98ovNXHY5nL1VeCjLOZHMJWJE3NTKYap0Y2xs%0Arprgb2srrq0yEdqWtV2zSaWu%2Bt4fp9pxbBa9DWmqTExzLHPHmvy5NM6vo0VO%0A0ruhjihQKqILUcQrct3Lp5pahggwODgLZcc0gbWS0sLlpqbbHms1HRQXXD6.%0AjKwc%2BkO6sKRkppdDxA2EoJL0qA17UxpkpbfMjZlHO0uN6V1xGZrdArLIGoku%0AHtQPVqGzDdP.CW6lzXdPhnPsKyC34cy%2B1mZsJ2LuJ4V4ldKxMiqC3LZUx0%2B5%0Ajb8%2B8tqV9hfe2fi7sI2oStRGEl%2BCCSJdU.%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post62686-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode62686-0">----------begin_max5_patcher----------
607.3ocyVF1axBCDG+0rj8c3BuZKwGGETP7IYI6ywCKKUnh0.WIPw4lYe2ef
h3Pm5Pcp6ElKd8n89+q8t1E2dil9HwbVlNLD9GnosnvilxWoGsZGZ5wz49Qz
LUf59h3XFJ06rbPIatTMvCO.SoynY9o7DILlGwF5gd33bzWxEHDmE9BGk2M6
dObgGJxkQL4cFcfY2+WO7COb0TFwQluHGUyqcs2wBThzXlZwdJkSiV8AXdb0
zoRQiZ27.UrhQS+isdyoIi+tZZHlcWEbBU5Ogigujx7kUHgzypXbf3ZqL8MJ
MCb6Z.O2Xk4X8BSTN+31aJsElNmNTGQwP3UtbBDyjoB3QnPnI4Rn3KXYk+AD
iAQZ.KcH.l.Y6Pz7GAh8OFH5NPQsAMPnUuKNBioXNMJ5sMAHGWAOBXdNgWui
AdNkCClVma3grWKxwuxtjTdCjdR525XzeO0wFKhasxKfgwET+uGAgoh7jFGM
ZMDL2BD9bZpBT9VBqRo55cJ98ovNXHY5nL1VeCjLOZHMJWJE3NTKYap0Y2xs
rprgb2srrq0yEdqWtV2zSaWu+t4fp9pxbBa9DWmqTExzLHPHmvy5NM6vo0VO
0ruhjihQKqILUcQrct3Lp5pahggwODgLZcc0gbWS0sLlpqbbHms1HRQXXD6.
jKwc+kO6sKRkppdDxA2EoJL0qA17UxpkpbfMjZlHO0uN6V1xGZrdArLIGoku
HtQPVqGzDdP.CW6lzXdPhnPsKyC34cy+1mZsJ2LuJ4V4ldKxMiqC3LZUx0+5
jb8+8tqV9hfe2fi7sI2oStRGEl+CCSJdU.
-----------end_max5_patcher-----------</code></pre></div>
</div>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226388</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226388</link>
					<pubDate>Sat, 31 Mar 2012 02:03:26 +0000</pubDate>
					<dc:creator>Christopher Dobrian</dc:creator>

					<description>
						<![CDATA[
						<p>This is probably relevant:<br />
<a HREF="http://www.cycling74.com/docs/max6/dynamic/c74_docs.html#jsthreading">Controlling a Function’s Thread of Execution</a><br />
&#8230;most notably the line that reads,<br />
&#8220;By default, the js object executes all Javascript code in the low-priority thread. In particular, if it finds itself running in the high-priority thread, it will defer execution of whatever it was supposed to do to the low-priority thread.&#8221;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226389</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226389</link>
					<pubDate>Sat, 31 Mar 2012 05:54:39 +0000</pubDate>
					<dc:creator>nicolas danet</dc:creator>

					<description>
						<![CDATA[
						<p>Hello,</p>
<p>have a look on <code>immediate</code> method. </p>
<p>If i remember correctly something like :</p>
<p><code>msg_int.immediate = 1;</code></p>
<p>oops &#8230; have a look on previous post link ;-)</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226390</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226390</link>
					<pubDate>Sat, 31 Mar 2012 14:39:27 +0000</pubDate>
					<dc:creator>evsc</dc:creator>

					<description>
						<![CDATA[
						<p>This sounds like it should be the solution!</p>
<p>Sadly, including </p>
<p>msg_int.immediate = 1;</p>
<p>into the javascript keeps crashing Max. When i hit the bang manually, all is fine. But it crashes when i try to activate the toggle button of the metro object.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226391</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226391</link>
					<pubDate>Sat, 31 Mar 2012 16:04:18 +0000</pubDate>
					<dc:creator>evsc</dc:creator>

					<description>
						<![CDATA[
						<p>Seems to behave differently on Windows and OSX.<br />
According to different posts on this forum.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226392</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226392</link>
					<pubDate>Sat, 31 Mar 2012 16:04:47 +0000</pubDate>
					<dc:creator>Andrew Pask</dc:creator>

					<description>
						<![CDATA[
						<p>The immediate method is deprecated in Max6.</p>
<p>Calls to it in JS code will be ignored. Sorry about the confusion, we&#8217;ll tidy up the docs.</p>
<p>It shouldn&#8217;t crash either, we&#8217;ll have a look.</p>
<p>-A</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226393</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226393</link>
					<pubDate>Sat, 31 Mar 2012 16:07:02 +0000</pubDate>
					<dc:creator>evsc</dc:creator>

					<description>
						<![CDATA[
						<p>Still on Max 5.1.4 (on Windows 7).</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226394</guid>
					<title><![CDATA[Re: Execution order with [js] mixed up / depending on if manual or metro bang]]></title>
					<link>http://cycling74.com/forums/topic/execution-order-with-js-mixed-up-depending-on-if-manual-or-metro-bang/#post-226394</link>
					<pubDate>Sat, 31 Mar 2012 16:25:24 +0000</pubDate>
					<dc:creator>Andrew Pask</dc:creator>

					<description>
						<![CDATA[
						<p><a href='http://cycling74.com/forums/users/evsc/' rel='nofollow' class='bbp-mention-link evsc'>@evsc</a></p>
<p>Yes, unfortunately you may be looking at one of the reasons why we deprecated it.<br />
JS in Max5 had a multi threaded implementation which had problems, and when we upgraded JS for Max6 it was deemed more trouble than it was worth.JS in Max 6 is single threaded.</p>
<p>Your patch behaves exactly as it should, both with Overdrive on and off. JS always executes in the low priority thread. Ui interactions also always occur in the low priority thread, which is why you see a difference between the button press and the metro with Overdrive on.</p>
<p>Cheers</p>
<p>Andrew</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

