Forums > Jitter

banging jit.matrix does nothing when bang is from udpreceive

May 25, 2007 | 11:07 pm

So I narrowed my problem down a bit. When you send a bang to a jit.matrix it’s supposed to send out the matrix (as a ‘jit.matrix name’) out its left outlet. When the bang (or any message) is received over udpreceive, and then the bang (or other message translated into a bang) is sent to the jit.matrix, the jit.matrix only outputs a matrix for the last bang received.

I have attached a small patch demonstrating this anomaly. Any work around would be greatly appreciated. I believe it is a bug of some sort, possibly in jit.matrix, possibly in udpsend/receive, but it’s tough to know for certain.

Thanks in advance!


May 26, 2007 | 8:40 am

Here’s a quick fix: put a jit.qfaker object between the receiver and
the jit.matrix object. This moves the bangs back into the scheduler
thread, from the queue.

jb

Am 26.05.2007 um 01:07 schrieb sayles:

> So I narrowed my problem down a bit. When you send a bang to a
> jit.matrix it’s supposed to send out the matrix (as a ‘jit.matrix
> name’) out its left outlet. When the bang (or any message) is
> received over udpreceive, and then the bang (or other message
> translated into a bang) is sent to the jit.matrix, the jit.matrix
> only outputs a matrix for the last bang received.
>
> I have attached a small patch demonstrating this anomaly. Any work
> around would be greatly appreciated. I believe it is a bug of some
> sort, possibly in jit.matrix, possibly in udpsend/receive, but it’s
> tough to know for certain.
>
> Thanks in advance!


May 26, 2007 | 9:05 am

It seems that I missed the reason you’re using udpsend… but I
didn’t miss Joshua’s suggestion to use jit.net.send/recv objects for
sending real matrix data, and nice thing about them is that they can
send max messages too. You can’t send a bang, but you can replace it
with some other word, like mybang:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 442 173 61 196617 jit.net.send;
#P hidden newex 378 195 64 196617 prepend help;
#P message 378 173 61 196617 jit.net.recv;
#P hidden newex 378 218 45 196617 pcontrol;
#P message 198 91 44 196617 mybang;
#P message 160 271 33 196617 set 0;
#P newex 173 172 45 196617 s action;
#P newex 32 89 45 196617 s action;
#P newex 109 251 45 196617 r action;
#P newex 248 66 82 196617 s reset_counter;
#P newex 80 66 82 196617 s reset_counter;
#P button 391 42 15 0;
#P newex 391 66 48 196617 loadbang;
#P newex 391 89 81 196617 s reset-counter;
#P newex 160 251 82 196617 r reset_counter;
#P newex 160 326 32 196617 print;
#N counter 0 10000;
#X flags 0 0;
#P newobj 160 302 86 196617 counter 0 10000;
#P newex 109 271 27 196617 b 2;
#P button 32 42 15 0;
#P newex 32 66 40 196617 uzi 3;
#P button 198 42 15 0;
#P newex 198 66 40 196617 uzi 3;
#P newex 147 120 61 196617 jit.net.send;
#P newex 147 146 62 196617 jit.net.recv;
#P newex 48 324 46 196617 jit.print;
#P newex 48 302 105 196617 jit.matrix 1 char 4 4;
#P comment 60 42 117 196617 Test without networking;
#P comment 227 42 104 196617 Test with networking;
#P window linecount 7;
#P comment 261 256 110 196617 You should see print: x followed by a
4×4 matrix. This should occur three times. In the case of the
networking test , you only see one matrix.;
#P window linecount 2;
#P comment 30 251 74 196617 Print a counter and a matrix;
#P user panel 25 243 229 113;
#X brgb 255 128 128;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 378 33 108 89;
#X brgb 0 128 255;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 31 338 172;
#X brgb 255 255 128;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window linecount 1;
#P comment 395 155 100 196617 help patches:;
#P hidden fasten 33 0 32 0 447 192 383 192;
#P hidden connect 31 0 32 0;
#P hidden connect 32 0 30 0;
#P connect 12 0 29 0;
#P connect 29 0 11 1;
#P connect 10 1 27 0;
#P connect 21 0 20 0;
#P connect 22 0 21 0;
#P connect 13 0 12 0;
#P connect 13 0 24 0;
#P connect 17 0 18 0;
#P connect 28 0 17 0;
#P connect 16 1 17 0;
#P connect 19 0 28 0;
#P connect 25 0 16 0;
#P connect 15 0 14 0;
#P connect 15 0 23 0;
#P connect 8 0 9 0;
#P connect 16 0 8 0;
#P connect 14 0 26 0;
#P window clipboard copycount 34;

hth,
nesa


May 29, 2007 | 6:28 pm

Thanks! that seems to be exactly what i needed. placed a jit.qfaker right after the udpreceive and it all works.


Viewing 4 posts - 1 through 4 (of 4 total)