Forums > Jitter

Adding mutiple matrices

December 7, 2006 | 1:10 am

Hi, I am trying to add many(about 192) matrices into one. Maybe there is a better way to do this? I have a number of still images that I want to replace cells of a video. Each image location corresponds to the location and of a specific cell and value. Is there a less processor intensive way to combine these images other than "jit.op @op +" or "jit.glue"? This is A rough vesion of what Ive got. Any suggestions or help would be appreciated. Thank you…

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 35 81 48 196617 loadbang;
#P message 161 480 20 196617 $1;
#N vpatcher 53 59 653 459;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 162 253 64 196617 jit.op @op +;
#P newex 149 217 64 196617 jit.op @op +;
#P newex 68 166 64 196617 jit.op @op +;
#P newex 224 163 64 196617 jit.op @op +;
#P newex 400 122 64 196617 jit.op @op +;
#P newex 294 115 64 196617 jit.op @op +;
#P newex 186 111 64 196617 jit.op @op +;
#P newex 114 108 64 196617 jit.op @op +;
#P window linecount 0;
#P newex 25 100 64 196617 jit.op @op +;
#P inlet 439 69 15 0;
#P inlet 407 67 15 0;
#P inlet 14 39 15 0;
#P outlet 156 283 15 0;
#P inlet 382 68 15 0;
#P inlet 295 61 15 0;
#P inlet 240 50 15 0;
#P inlet 183 49 15 0;
#P inlet 136 40 15 0;
#P inlet 79 40 15 0;
#P inlet 50 41 15 0;
#P connect 8 0 11 0;
#P connect 11 0 17 0;
#P connect 0 0 11 1;
#P connect 1 0 12 0;
#P connect 12 0 17 1;
#P connect 17 0 18 0;
#P connect 19 0 7 0;
#P connect 18 0 19 0;
#P connect 2 0 12 1;
#P connect 3 0 13 0;
#P connect 16 0 18 1;
#P connect 15 0 19 1;
#P connect 13 0 16 0;
#P connect 4 0 13 1;
#P connect 14 0 16 1;
#P connect 5 0 14 0;
#P connect 6 0 14 1;
#P connect 9 0 15 0;
#P connect 10 0 15 1;
#P pop;
#P newobj 148 569 182 196617 p ops;
#N vpatcher 53 59 653 459;
#P outlet 234 320 15 0;
#P inlet 345 59 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 274 222 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P outlet 187 293 15 0;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 118 259 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P fasten 5 0 2 0 162 221 123 221;
#P fasten 3 0 2 0 189 161 126 161 126 221 123 221;
#P connect 0 0 2 0;
#P connect 1 0 0 0;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 2 0 6 0;
#P connect 7 0 9 0;
#P connect 8 0 7 0;
#P connect 0 0 7 0;
#P fasten 5 0 7 0 162 234;
#P pop;
#P newobj 341 544 32 196617 p pl2;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P fasten 5 0 2 0 162 221 192 221;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P connect 2 0 6 0;
#P pop;
#P newobj 307 544 24 196617 p pl;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 361 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdim 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P connect 1 0 0 0;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 0 0 2 0;
#P fasten 5 0 2 0 162 221 192 221;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P connect 2 0 6 0;
#P pop;
#P newobj 277 543 24 196617 p pl;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 391 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimendend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 1 0 0 0;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P fasten 5 0 2 0 162 221 192 221;
#P connect 0 0 2 0;
#P connect 2 0 6 0;
#P pop;
#P newobj 249 542 24 196617 p pl;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P connect 1 0 0 0;
#P fasten 4 0 0 0 224 196 192 196;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P fasten 5 0 2 0 162 221 192 221;
#P connect 0 0 2 0;
#P connect 2 0 6 0;
#P pop;
#P newobj 221 543 24 196617 p pl;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 1 0 0 0;
#P connect 0 0 2 0;
#P fasten 5 0 2 0 162 221 192 221;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P connect 2 0 6 0;
#P pop;
#P newobj 194 543 24 196617 p pl;
#N vpatcher 53 59 653 459;
#P outlet 187 293 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 187 225 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P connect 1 0 0 0;
#P fasten 4 0 0 0 224 196 192 196;
#P fasten 3 0 2 0 189 161 126 161 126 221 192 221;
#P fasten 5 0 2 0 162 221 192 221;
#P connect 0 0 2 0;
#P connect 2 0 6 0;
#P pop;
#P newobj 166 542 24 196617 p pl;
#P newex 390 297 35 196617 s met;
#P newex 356 315 24 196617 s cl;
#N vpatcher 53 59 653 459;
#P outlet 222 293 15 0;
#P inlet 345 59 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 279 222 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P outlet 187 293 15 0;
#P window linecount 0;
#P newex 157 200 24 196617 r cl;
#P newex 219 174 38 196617 r met;
#P inlet 184 55 15 0;
#P window linecount 1;
#P newex 118 259 376 196617 jit.matrix 4 char 640 480 @srcdimstart 0 0 @srcdimend 240 160 @usedstdim 1;
#P message 187 175 30 196617 read;
#P newex 187 201 105 196617 jit.qt.movie 240 160;
#P fasten 5 0 2 0 162 221 123 221;
#P fasten 3 0 2 0 189 161 126 161 126 221 123 221;
#P connect 0 0 2 0;
#P fasten 4 0 0 0 224 196 192 196;
#P connect 1 0 0 0;
#P connect 2 0 6 0;
#P connect 7 0 9 0;
#P connect 8 0 7 0;
#P connect 0 0 7 0;
#P fasten 5 0 7 0 162 234;
#P pop;
#P newobj 129 543 32 196617 p pl2;
#P message 115 90 14 196617 0;
#P message 245 24 29 196617 stop;
#P message 213 25 30 196617 read;
#P newex 213 65 63 196617 jit.qt.movie;
#P newex 146 513 316 196617 gate 12;
#P newex 240 444 201 196617 pack 0 0 0 0 0;
#P newex 239 419 199 196617 buddy 5;
#P message 240 466 175 196617 dstdimstart $2 $4 , dstdimend $3 $5;
#P newex 336 350 32 196617 * 40;
#P newex 369 390 27 196617 – 1;
#P newex 300 390 27 196617 – 1;
#P newex 369 370 31 196617 + 40;
#P newex 300 370 31 196617 + 40;
#P newex 300 349 32 196617 * 40;
#P newex 267 349 32 196617 * 40;
#P newex 370 350 32 196617 * 40;
#P button 356 276 15 0;
#P message 356 298 33 196617 clear;
#P newex 288 302 58 196617 unpack 0 0;
#P newex 290 228 41 196617 jit.iter;
#P newex 549 335 129 196617 jit.matrix 4 char 640 480;
#P user jit.pwindow 548 360 482 322 0 1 0 0 1 0;
#P newex 290 205 104 196617 jit.op @op / @val 10;
#P newex 276 180 66 196617 jit.unpack;
#P message 115 109 71 196617 saturation $1;
#P newex 88 131 54 196617 jit.brcosa;
#P message 166 22 33 196617 close;
#P toggle 77 18 15 0;
#P newex 276 150 117 196617 jit.matrix 4 char 16 12;
#P user jit.pwindow 81 254 162 122 0 1 0 0 1 0;
#P newex 88 66 56 196617 jit.qt.grab;
#P message 133 22 30 196617 open;
#P newex 77 39 58 196617 metro 100;
#P comment 223 498 178 196617 gates corrospond with value /10;
#P connect 6 0 1 0;
#P fasten 8 0 4 0 93 168 87 168;
#P fasten 1 0 3 0 82 59 93 59;
#P fasten 2 0 3 0 138 59 93 59;
#P fasten 7 0 3 0 171 56 171 59 93 59;
#P fasten 30 0 8 0 218 127 93 127;
#P fasten 9 0 8 0 120 128 93 128;
#P fasten 46 0 33 0 40 105 97 105 97 86 120 86;
#P connect 33 0 9 0;
#P connect 29 0 34 0;
#P fasten 45 0 29 0 166 501 151 501;
#P connect 34 0 44 0;
#P fasten 26 0 45 0 245 487 200 487 200 475 166 475;
#P connect 29 1 37 0;
#P connect 34 1 44 1;
#P connect 37 0 44 2;
#P connect 29 2 38 0;
#P connect 38 0 44 3;
#P fasten 1 0 30 0 82 59 218 59;
#P fasten 32 0 30 0 250 52 218 52;
#P connect 31 0 30 0;
#P connect 29 3 39 0;
#P connect 39 0 44 4;
#P fasten 14 0 27 0 295 274 244 274;
#P fasten 27 0 28 0 244 435 245 435;
#P connect 28 0 26 0;
#P connect 40 0 44 5;
#P connect 29 4 40 0;
#P connect 41 0 44 6;
#P fasten 15 0 19 0 293 328 272 328;
#P fasten 8 0 5 0 93 168 268 168 268 143 281 143;
#P connect 5 0 10 0;
#P connect 29 5 41 0;
#P connect 42 0 44 7;
#P fasten 19 0 27 1 272 406 291 406;
#P fasten 27 1 28 1 291 435 292 435;
#P fasten 14 1 15 0 310 274 293 274;
#P connect 10 1 11 0;
#P connect 11 0 14 0;
#P fasten 15 0 20 0 293 328 305 328;
#P connect 20 0 21 0;
#P connect 21 0 23 0;
#P connect 43 0 44 8;
#P connect 29 6 42 0;
#P connect 43 1 44 9;
#P fasten 23 0 27 2 305 415 338 415;
#P fasten 27 2 28 2 338 437 339 437;
#P fasten 15 1 25 0 341 336 341 336;
#P connect 29 7 43 0;
#P fasten 14 2 17 0 325 271 361 271;
#P connect 17 0 16 0;
#P connect 16 0 35 0;
#P connect 29 8 43 1;
#P connect 18 0 22 0;
#P connect 22 0 24 0;
#P fasten 15 1 18 0 341 336 375 336;
#P fasten 25 0 27 3 341 415 385 415;
#P fasten 27 3 28 3 385 434 386 434;
#P fasten 17 0 36 0 361 295 395 295;
#P fasten 24 0 27 4 374 415 432 415;
#P connect 27 4 28 4;
#P fasten 26 0 29 1 245 492 457 492;
#P fasten 44 0 13 0 153 605 520 605 520 319 554 319;
#P connect 13 0 12 0;
#P window clipboard copycount 47;


December 7, 2006 | 1:28 am


December 7, 2006 | 2:36 am

there is none in that version, I tried to use it but if there are 192 cells does this not mean that I need 192 outlets?(and a router of 30×192?) If so, it crashed MAX twice with only a few files running.


December 7, 2006 | 2:41 am

Did you see this patch:

http://www.cycling74.com/story/2006/2/17/153427/406

36.TinyVideo – a patch that demonstrates an efficient method of creating
animated sprite-quads by loading a single texture with a series of frames.

?

I think it does what you want and more.

wes


December 7, 2006 | 2:59 pm


December 7, 2006 | 5:33 pm

yes, the previous patch was thrown together rather quickly and thats why the ‘scrdimend’ was not corrected, sorry. the jit.glue object requires number of rows x number of columns = outlets.

I am currently looking into openGL for a better solution. Thank you all for your help. cheers.


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