<?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: Is &quot;setcell&quot; messages to jit.matrix defered?</title>
		<atom:link href="http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 17:17:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-27826</guid>
					<title><![CDATA[Is &quot;setcell&quot; messages to jit.matrix defered?]]></title>
					<link>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-27826</link>
					<pubDate>Wed, 27 Sep 2006 11:46:48 +0000</pubDate>
					<dc:creator>Trond Lossius</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m attempting to build an abstraction calculating running statistic <br />
values on a flow of floats, in a somewhat similar way to lp.stacey. I am <br />
using a jit.matrix as a circular buffer. However I notice that the <br />
setcell message that is used to feed a new value to the buffer doesn&#8217;t <br />
always seem to update the matrix fast enough for the new value to become <br />
part of the subsequent calculation. The problem only seems to happen if <br />
the incoming floats arrives from the timed scheduler.</p>
<p>Is the setcell message defered inside jit.matrix? If so, is there any <br />
way to push it to not defer it?</p>
<p>Steps to Reproduce:</p>
<p>1) Save the two patches below in the same folder as jmod.stats.mxt and <br />
jmod.stats.help respectively.<br />
2) Open jmod.stats.help<br />
3) Start metro and observe the jitter graph displayed, in particular for <br />
the time before the buffer is all filled up.</p>
<p>I sometimes see that the end of the buffer contains zero values, <br />
something it shouldn&#8217;t unless drunk is going all the way down. You can <br />
use the clear message to start over again.</p>
<p>4) Now stop metro and start qmetro instead. Using qmetro the patch no <br />
longer display any problems.</p>
<p>
Expected and actual results:</p>
<p>The trigger object inside jmod.stats.mxt is supposed to ensure that the <br />
new cell value is set before the matrix is banged and calculations <br />
performed. However it seems to happen every now and the that the new <br />
cell value has not been set before the matrix is banged. Thus if the <br />
counter has nit yet wrapper round, the last cell will contain 0. instead <br />
of the value it is supposed to have. The only possible explanation I can <br />
imagine is that setcell is defered inside jit.matrix, and thus might be <br />
performed after the matrix has been banged.</p>
<p>The fact that the problem only seems to happen if triggered using metro <br />
instead of qmetro seems to support this theory.</p>
<p>Probably this is a feature of the jit.matrix behaviour and not a bug, so <br />
my question is primarily if there&#8217;s a way I can avoid the problem <br />
without having to defer the input to the jmod.stats abstraction. I want <br />
to use this abstraction for e.g. processing of incoming midi/sensor <br />
data, so it is important to me to be able to keep stats calculations <br />
part of the scheduler it receives input from.</p>
<p>I&#8217;ve been testing this on PPC, Max 4.5.7. Overdrive on/off and scheduler <br />
in audio  interrupt doesn&#8217;t seem to have any implications for the behavior.</p>
<p>Thanks for any insight.<br />
Trond</p>
<p>Save as jmod.stats.mxt:</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P comment 665 565 133 196617 graph display for debugging;<br />
#P outlet 647 564 15 0;<br />
#P newex 185 426 29 196617 t b f;<br />
#P newex 283 483 27 196617 f;<br />
#N vpatcher 614 177 875 386;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P newex 50 80 147 196617 jit.expr @expr &#8220;in[0] * in[0]&#8220;;<br />
#P newex 64 137 29 196617 sqrt;<br />
#P newex 50 105 53 196617 jit.3m;<br />
#P newex 50 50 63 196617 jit.op @op -;<br />
#P inlet 50 30 15 0;<br />
#P inlet 103 30 15 0;<br />
#P outlet 64 159 15 0;<br />
#P connect 2 0 3 0;<br />
#P connect 3 0 6 0;<br />
#P connect 6 0 4 0;<br />
#P connect 4 1 5 0;<br />
#P connect 5 0 0 0;<br />
#P connect 1 0 3 1;<br />
#P pop;<br />
#P newobj 185 398 102 196617 p root_mean_square;<br />
#N vpatcher 20 74 620 474;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 174 155 33 196617 t dim;<br />
#P window linecount 0;<br />
#P newex 174 89 51 196617 t counter;<br />
#P newex 50 92 27 196617 i;<br />
#P newex 50 50 27 196617 t b i;<br />
#P newex 50 135 65 196617 maximum 1.;<br />
#P newex 50 114 27 196617 + 1;<br />
#P newex 67 71 40 196617 peak 0;<br />
#P inlet 97 30 15 0;<br />
#P inlet 50 30 15 0;<br />
#P outlet 50 157 15 0;<br />
#P connect 1 0 6 0;<br />
#P connect 6 0 7 0;<br />
#P connect 7 0 4 0;<br />
#P connect 4 0 5 0;<br />
#P connect 5 0 0 0;<br />
#P connect 6 1 3 0;<br />
#P connect 3 0 7 1;<br />
#P connect 2 0 3 1;<br />
#P connect 1 0 8 0;<br />
#P connect 5 0 9 0;<br />
#P pop;<br />
#P newobj 557 180 54 196617 p set_dim;<br />
#B color 13;<br />
#P inlet 22 28 15 0;<br />
#N comlet (float) standard deviation;<br />
#P outlet 311 547 15 0;<br />
#N comlet (float) mean;<br />
#P outlet 283 567 15 0;<br />
#N comlet (float) maximum;<br />
#P outlet 367 507 15 0;<br />
#N comlet (float) minimum;<br />
#P outlet 339 527 15 0;<br />
#N comlet (int) count;<br />
#P outlet 395 487 15 0;<br />
#P comment 412 488 35 196617 count;<br />
#P comment 356 528 50 196617 minimum;<br />
#P comment 384 508 53 196617 maximum;<br />
#P comment 300 568 33 196617 mean;<br />
#P comment 328 548 95 196617 standard deviation;<br />
#P message 506 253 41 196617 dim $1;<br />
#B color 13;<br />
#P newex 185 293 162 196617 jit.submatrix @dim 1 @offset 0 0;<br />
#P newex 311 334 53 196617 jit.3m;<br />
#P message 476 91 41 196617 dim $1;<br />
#P newex 443 90 27 196617 &#8211; 1;<br />
#P newex 443 60 53 196617 route dim;<br />
#P newex 341 35 112 196617 patcherargs @dim 500;<br />
#P newex 22 65 139 196617 select clear;<br />
#P newex 22 87 49 196617 t clear 0;<br />
#B color 12;<br />
#P newex 151 92 40 196617 t b f b;<br />
#P message 185 193 87 196617 setcell $2 val $1;<br />
#P newex 185 169 51 196617 pack 0. 0;<br />
#N counter 0 499;<br />
#X flags 0 0;<br />
#P newobj 226 143 74 196617 counter 0 499;<br />
#P newex 185 227 162 196617 jit.matrix $0_data 1 float32 500;<br />
#P comment 201 247 137 196617 matrix functioning as buffer;<br />
#P comment 367 336 116 196617 getting min , mean , max;<br />
#P connect 14 0 28 0;<br />
#P fasten 14 0 13 0 190 322 316 322;<br />
#P fasten 14 0 31 0 190 315 652 315;<br />
#P fasten 7 1 3 2 66 130 263 130;<br />
#P lcolor 13;<br />
#P fasten 7 1 27 1 66 128 606 128;<br />
#P lcolor 13;<br />
#P connect 3 0 4 1;<br />
#P fasten 3 0 27 0 231 164 562 164;<br />
#P fasten 27 0 21 0 562 455 400 455;<br />
#P fasten 27 0 15 0 562 243 511 243;<br />
#P lcolor 14;<br />
#P connect 10 0 12 0;<br />
#P connect 10 0 11 0;<br />
#P connect 9 1 10 0;<br />
#P fasten 13 2 23 0 344 367 372 367;<br />
#P fasten 13 0 22 0 316 375 344 375;<br />
#P fasten 30 1 25 0 209 453 316 453;<br />
#P fasten 13 1 28 1 330 383 282 383;<br />
#P fasten 13 1 29 1 330 428 305 428;<br />
#P connect 11 0 3 4;<br />
#P connect 29 0 24 0;<br />
#P fasten 30 0 29 0 190 465 288 465;<br />
#P connect 6 2 3 0;<br />
#P connect 28 0 30 0;<br />
#P fasten 15 0 14 0 511 280 190 280;<br />
#P lcolor 14;<br />
#P connect 2 0 14 0;<br />
#P connect 5 0 2 0;<br />
#P fasten 6 0 2 0 156 214 190 214;<br />
#P fasten 12 0 2 0 481 217 190 217;<br />
#P fasten 7 0 2 0 27 222 190 222;<br />
#P lcolor 13;<br />
#P connect 4 0 5 0;<br />
#P connect 6 1 4 0;<br />
#P connect 8 1 6 0;<br />
#P connect 8 0 7 0;<br />
#P lcolor 13;<br />
#P connect 26 0 8 0;<br />
#P window clipboard copycount 33;</p>
<p>save as jmod.stats.help:</p>
<p>#P user jit.pwindow 393 226 436 158 0 1 0 0 1 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P newex 394 205 160 196617 jit.graph @mode 3 @rangehi 127.;<br />
#P toggle 106 91 15 0;<br />
#P newex 106 114 52 196617 metro 20;<br />
#P message 219 99 33 196617 clear;<br />
#P user multiSlider 226 289 141 93 0. 127. 1 3193 15 0 0 2 0 0 0;<br />
#M frgb 0 0 0;<br />
#M brgb 190 190 190;<br />
#M rgb2 127 127 127;<br />
#M rgb3 0 0 0;<br />
#M rgb4 37 52 91;<br />
#M rgb5 74 105 182;<br />
#M rgb6 112 158 18;<br />
#M rgb7 149 211 110;<br />
#M rgb8 187 9 201;<br />
#M rgb9 224 62 37;<br />
#M rgb10 7 114 128;<br />
#P comment 66 392 50 196617 min;<br />
#P comment 66 420 46 196617 max;<br />
#P comment 66 406 33 196617 mean;<br />
#P user panel 33 420 30 9;<br />
#X brgb 74 105 182;<br />
#X frgb 0 0 0;<br />
#X border 0;<br />
#X rounded 0;<br />
#X shadow 0;<br />
#X done;<br />
#P user panel 33 407 30 9;<br />
#X brgb 37 52 91;<br />
#X frgb 0 0 0;<br />
#X border 0;<br />
#X rounded 0;<br />
#X shadow 0;<br />
#X done;<br />
#P hidden newex 34 240 29 196617 t b f;<br />
#P hidden message 141 243 39 196617 set $1;<br />
#P window setfont &#8220;Sans Serif&#8221; 18.;<br />
#P comment 12 17 155 196626 jmod.stats;<br />
#B frgb 255 255 255;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P comment 12 44 190 196617 calculate statistics on running data;<br />
#B frgb 255 255 255;<br />
#P user panel 7 12 298 48;<br />
#X brgb 67 65 107;<br />
#X frgb 0 0 0;<br />
#X border 0;<br />
#X rounded 0;<br />
#X shadow 0;<br />
#X done;<br />
#P user multiSlider 33 289 28 93 0. 127. 3 2937 15 0 0 2 3 0 0;<br />
#M frgb 0 0 0;<br />
#M brgb 255 255 255;<br />
#M rgb2 127 127 127;<br />
#M rgb3 0 0 0;<br />
#M rgb4 37 52 91;<br />
#M rgb5 74 105 182;<br />
#M rgb6 112 158 18;<br />
#M rgb7 149 211 110;<br />
#M rgb8 187 9 201;<br />
#M rgb9 224 62 37;<br />
#M rgb10 7 114 128;<br />
#P hidden newex 72 269 61 196617 pak 0. 0. 0.;<br />
#P user multiSlider 60 289 141 93 0. 127. 1 3193 15 0 0 2 0 0 0;<br />
#M frgb 0 0 0;<br />
#M brgb 190 190 190;<br />
#M rgb2 127 127 127;<br />
#M rgb3 0 0 0;<br />
#M rgb4 37 52 91;<br />
#M rgb5 74 105 182;<br />
#M rgb6 112 158 18;<br />
#M rgb7 149 211 110;<br />
#M rgb8 187 9 201;<br />
#M rgb9 224 62 37;<br />
#M rgb10 7 114 128;<br />
#P toggle 35 91 15 0;<br />
#P newex 35 114 57 196617 qmetro 20;<br />
#P newex 35 139 65 196617 drunk 128 2;<br />
#P flonum 88 200 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P flonum 35 200 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P flonum 194 200 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P flonum 141 200 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P number 247 200 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P comment 247 223 35 196617 Count;<br />
#P comment 141 223 50 196617 min;<br />
#P comment 194 223 46 196617 max;<br />
#P comment 35 223 33 196617 mean;<br />
#P window linecount 2;<br />
#P comment 88 223 52 196617 standard deviation;<br />
#P window linecount 1;<br />
#P newex 35 169 276 196617 jmod.stats.mxt @dim 100;<br />
#P user panel 33 394 30 9;<br />
#X brgb 0 0 0;<br />
#X frgb 0 0 0;<br />
#X border 0;<br />
#X rounded 0;<br />
#X shadow 0;<br />
#X done;<br />
#P hidden fasten 16 0 17 0 77 287 38 287;<br />
#P hidden connect 10 0 22 0;<br />
#P connect 14 0 13 0;<br />
#P fasten 30 0 12 0 111 134 40 134;<br />
#P connect 13 0 12 0;<br />
#P connect 12 0 1 0;<br />
#P fasten 29 0 1 0 224 163 40 163;<br />
#P connect 1 0 10 0;<br />
#P fasten 12 0 15 0 40 163 26 163 26 271 65 271;<br />
#P hidden fasten 22 0 16 0 39 265 77 265;<br />
#P hidden fasten 21 0 16 0 146 263 77 263;<br />
#P connect 1 1 11 0;<br />
#P hidden fasten 22 1 16 1 58 260 102 260;<br />
#P connect 31 0 30 0;<br />
#P hidden fasten 9 0 16 2 199 266 127 266;<br />
#P connect 1 2 8 0;<br />
#P hidden connect 8 0 21 0;<br />
#P connect 1 3 9 0;<br />
#P connect 8 0 28 0;<br />
#P connect 1 4 7 0;<br />
#P fasten 1 5 32 0 305 196 399 196;<br />
#P connect 32 0 33 0;<br />
#P window clipboard copycount 34;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84686</guid>
					<title><![CDATA[Re: Is &#8220;setcell&#8221; messages to jit.matrix defered?]]></title>
					<link>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84686</link>
					<pubDate>Wed, 27 Sep 2006 16:56:23 +0000</pubDate>
					<dc:creator>Joshua Kit Clayton</dc:creator>

					<description>
						<![CDATA[
						<p>
On Sep 27, 2006, at 4:46 AM, Trond Lossius wrote:</p>
<p>> I&#8217;m attempting to build an abstraction calculating running  <br />
> statistic values on a flow of floats, in a somewhat similar way to  <br />
> lp.stacey. I am using a jit.matrix as a circular buffer. However I  <br />
> notice that the setcell message that is used to feed a new value to  <br />
> the buffer doesn&#8217;t always seem to update the matrix fast enough for  <br />
> the new value to become part of the subsequent calculation. The  <br />
> problem only seems to happen if the incoming floats arrives from  <br />
> the timed scheduler.<br />
><br />
> Is the setcell message defered inside jit.matrix? If so, is there  <br />
> any way to push it to not defer it?</p>
<p>Yes. All methods for jit.matrix are deferred or usurped when called  <br />
from a patcher. You can either use jit.qfaker or call the methods  <br />
from C or Java to avoid this behavior, but you better know what  <br />
you&#8217;re doing if you&#8217;re using this stuff in the scheduler thread. It&#8217;s  <br />
not recommended usage unless you&#8217;re savvy enough to do so.</p>
<p>-Joshua</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84687</guid>
					<title><![CDATA[Re: Is &#8220;setcell&#8221; messages to jit.matrix defered?]]></title>
					<link>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84687</link>
					<pubDate>Wed, 27 Sep 2006 18:06:12 +0000</pubDate>
					<dc:creator>Andrew Benson</dc:creator>

					<description>
						<![CDATA[
						<p>My preferred workaround for this sort of thing is to convert the float <br />
to a signal and use jit.poke~ to write values into the matrix.</p>
<p>
Cheers,<br />
Andrew B.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84688</guid>
					<title><![CDATA[Re: Is &#8220;setcell&#8221; messages to jit.matrix defered?]]></title>
					<link>http://cycling74.com/forums/topic/is-setcell-messages-to-jit-matrix-defered/#post-84688</link>
					<pubDate>Wed, 27 Sep 2006 18:26:12 +0000</pubDate>
					<dc:creator>Trond Lossius</dc:creator>

					<description>
						<![CDATA[
						<p>Thanks for the replies, Joshua and Andrew.</p>
<p>I was thinking of this as a workaround, but there will be a bit of <br />
overhead involved. Another possibility will be to use an audio buffer as <br />
buffer, write into it with peek~, and then use jit.buffer~ to get the <br />
matrix for further calculations.</p>
<p>Or maybe it is just as easy to make an external&#8230;</p>
<p>Best,<br />
Trond</p>
<p>Andrew Benson wrote:<br />
> My preferred workaround for this sort of thing is to convert the float <br />
> to a signal and use jit.poke~ to write values into the matrix.<br />
><br />
><br />
> Cheers,<br />
> Andrew B. </p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

