Forums > Jitter

uzi's too fast for ram

November 26, 2007 | 10:01 pm

Hello,
I try to load a set of jpegs in an ubumenu then dynamically in [jit.matrix] . The destnation is a [jit.matrixset] and a [uzi] + [counter] help me to do that and for the index.

The problem is that I have a few big resolution images.
It seems uzi is too fast for [jit.matrix] & [jit.matrixset].

I could downsample these images, but I would like to know if you have a idea about what’s the best way to load dynamically in ram.

thank you.

K


November 26, 2007 | 10:04 pm

hello again !

Could [jit.qt.movie] with loadram message be a clever way to load dynamically ?


November 26, 2007 | 10:17 pm

you want to use the rightmost outlet of qt.movie with route.
it outputs "read filename.mov 1" when a movie is finished loading. you can use that to trigger the next movie read.


November 27, 2007 | 5:50 pm

..and [jit.matrix] do same ?


November 27, 2007 | 5:58 pm

a quick test reveals that it does indeed to the exact same thing, except "importmovie" replaces "read".


November 27, 2007 | 8:58 pm

Here’s a patch with your suggestion.
.. but I can’t do it working correctly.
Is the ubu late or desynchronized with the loading ?


November 27, 2007 | 9:00 pm

sorry here’s the patch:

max v2;
#N vpatcher 58 71 1256 762;
#P window setfont "Sans Serif" 9.;
#P newex 109 331 50 196617 print ubu;
#B color 4;
#P comment 239 364 35 196617 stop!!;
#P comment 290 40 23 196617 init;
#P message 301 316 39 196617 set $1;
#P newex 218 343 37 196617 match;
#P newex 218 362 21 196617 t 0;
#P number 236 183 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 218 392 15 0;
#P number 735 541 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 294 58 15 0;
#P user jit.pwindow 199 520 190 130 0 1 0 0 1 0;
#P newex 886 523 58 196617 s tosprintf;
#B color 5;
#P newex 880 475 78 196617 r tothispatcher;
#N thispatcher;
#Q end;
#P newobj 880 498 61 196617 thispatcher;
#P message 788 485 33 196617 clear;
#P user ubumenu 735 515 100 196617 0 1 1 0;
#X types JPEG "PNG " PNGf;
#X prefix_set 0 1 kyred:/Users/derrickgiscloux/Desktop/H4-captures/ 0;
#P newex 735 483 43 196617 r 1path;
#B color 5;
#P newex 705 246 78 196617 s tothispatcher;
#B color 5;
#P newex 691 83 61 196617 delay 2000;
#P newex 691 63 48 196617 loadbang;
#P window linecount 2;
#P message 691 105 150 196617 ; max getruntime runtimeORmax;
#B color 5;
#P window linecount 1;
#P message 705 226 29 196617 path;
#P newex 690 169 41 196617 sel 1 0;
#P newex 690 145 84 196617 r runtimeORmax;
#B color 5;
#P newex 831 415 43 196617 s 1path;
#B color 5;
#P newex 707 279 58 196617 r tosprintf;
#B color 5;
#P window linecount 2;
#P message 690 196 129 196617 ; max sendapppath tosprintf;
#B color 5;
#P window linecount 1;
#P message 977 368 43 196617 depth 0;
#P message 831 364 107 196617 types JPEG PNG PNGf;
#P newex 753 341 227 196617 t b b b clear;
#P message 753 364 75 196617 autopopulate 1;
#P newex 674 364 76 196617 prepend prefix;
#P newex 674 315 131 196617 sprintf symout %simages/;
#P user com 809 316 143 196617 8;
#K set 0 26223 27748 25970 8226 26989 24935 25971 8736;
#K end;
#P newex 294 78 170 196617 t 0 0 1;
#P newex 218 414 29 196617 gate;
#P message 540 25 33 196617 clear;
#P newex 218 433 40 196617 t i i i;
#P newex 154 255 38 196617 sel 1;
#P newex 96 236 68 196617 unpack s 0;
#P newex 96 216 94 196617 route importmovie;
#P newex 28 35 43 196617 r 1path;
#B color 5;
#P user ubumenu 28 107 100 196617 0 1 1 0;
#X types JPEG "PNG " PNGf;
#X prefix_set 0 1 kyred:/Users/derrickgiscloux/Desktop/H4-captures/ 0;
#P newex 73 185 129 196617 jit.matrix 4 char 640 480;
#P message 220 286 39 196617 set $1;
#P newex 73 160 30 196617 t b s;
#N vpatcher 257 191 857 591;
#P outlet 74 80 15 0;
#P inlet 69 36 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 221 235 13 196617 p;
#P newex 284 264 27 196617 – 1;
#P message 233 460 45 196617 index $1;
#N counter 0 0 14;
#X flags 0 0;
#P newobj 220 307 75 196617 counter 0 0 14;
#P message 200 265 78 196617 matrixcount $1;
#P message 359 452 84 196617 outputmatrix $1;
#P newex 221 158 72 196617 route populate;
#P newex 73 136 105 196617 prepend importmovie;
#P newex 200 487 158 196617 jit.matrixset 20 4 char 640 480;
#P comment 272 184 100 196617 how many ?;
#P comment 123 462 167 196617 store matrix at index;
#P comment 68 258 89 196617 1 si image loaded;
#P fasten 20 0 15 0 223 459 21 459 21 99 33 99;
#P connect 21 0 15 0;
#P fasten 23 0 15 0 299 101 33 101;
#P connect 16 0 15 0;
#P connect 15 1 4 0;
#P connect 4 0 12 0;
#P connect 12 1 14 0;
#P connect 12 0 14 0;
#P fasten 14 1 17 0 197 209 101 209;
#P connect 17 0 18 0;
#P connect 15 0 57 0;
#P connect 18 1 19 0;
#P fasten 11 0 7 0 226 260 205 260;
#P connect 9 0 3 0;
#P connect 7 0 3 0;
#P lcolor 2;
#P fasten 6 0 3 0 364 481 205 481;
#P fasten 14 0 3 0 78 481 205 481;
#P connect 3 0 47 0;
#P fasten 20 2 53 0 253 456 264 456 264 339 223 339;
#P fasten 54 0 53 0 306 334 223 334;
#P connect 53 0 52 0;
#P connect 23 2 50 0;
#P connect 52 0 50 0;
#P connect 50 0 22 0;
#P connect 22 0 20 0;
#P connect 23 2 13 0;
#P connect 19 0 8 0;
#P connect 13 0 8 0;
#P fasten 15 2 5 0 123 127 226 127;
#P connect 5 0 11 0;
#P lcolor 1;
#P connect 20 1 9 0;
#P fasten 23 1 9 0 355 220 355 303;
#P connect 5 0 51 0;
#P fasten 8 0 22 1 225 328 212 328 212 410 242 410;
#P fasten 11 0 10 0 226 260 289 260;
#P connect 10 0 8 4;
#P connect 48 0 23 0;
#P connect 10 0 54 0;
#P fasten 49 0 6 0 693 585 693 485 627 485 587 393 537 393 513 427 433 414;
#P fasten 32 0 25 0 712 306 679 306;
#P connect 25 0 26 0;
#P connect 34 0 35 0;
#P connect 35 0 31 0;
#P connect 38 0 39 0;
#P connect 39 0 37 0;
#P connect 35 1 36 0;
#P connect 36 0 40 0;
#P connect 21 0 42 0;
#P connect 43 0 42 0;
#P connect 41 0 42 0;
#P connect 42 0 49 0;
#P fasten 25 0 28 0 679 336 758 336;
#P connect 28 0 27 0;
#P fasten 28 1 29 0 830 361 836 361;
#P connect 27 0 33 0;
#P connect 29 0 33 0;
#P connect 30 0 33 0;
#P fasten 28 3 33 0 974 410 836 410;
#P connect 26 0 33 0;
#P connect 45 0 44 0;
#P fasten 44 1 46 0 936 519 891 519;
#P connect 28 2 30 0;
#P pop;


November 27, 2007 | 9:04 pm

sorry again, this one is best.

max v2;
#N vpatcher 32 47 1230 738;
#P window setfont "Sans Serif" 36.;
#P window linecount 1;
#P comment 646 98 32 196644 2;
#B color 8;
#P comment 258 39 32 196644 3;
#B color 8;
#P window setfont "Sans Serif" 9.;
#P newex 109 331 50 196617 print ubu;
#B color 4;
#P comment 239 364 35 196617 stop!!;
#P comment 290 40 23 196617 init;
#P message 301 316 39 196617 set $1;
#P newex 218 343 37 196617 match;
#P newex 218 362 21 196617 t 0;
#P number 236 183 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 218 392 15 0;
#P number 735 541 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 294 58 15 0;
#P user jit.pwindow 199 520 190 130 0 1 0 0 1 0;
#P newex 886 523 58 196617 s tosprintf;
#B color 5;
#P newex 880 475 78 196617 r tothispatcher;
#N thispatcher;
#Q end;
#P newobj 880 498 61 196617 thispatcher;
#P message 788 485 33 196617 clear;
#P user ubumenu 735 515 100 196617 0 1 1 0;
#X prefix_set 0 0 0;
#P newex 735 483 43 196617 r 1path;
#B color 5;
#P newex 705 246 78 196617 s tothispatcher;
#B color 5;
#P newex 691 83 61 196617 delay 2000;
#P newex 691 63 48 196617 loadbang;
#P window linecount 2;
#P message 691 105 150 196617 ; max getruntime runtimeORmax;
#B color 5;
#P window linecount 1;
#P message 705 226 29 196617 path;
#P newex 690 169 41 196617 sel 1 0;
#P newex 690 145 84 196617 r runtimeORmax;
#B color 5;
#P newex 831 415 43 196617 s 1path;
#B color 5;
#P newex 707 279 58 196617 r tosprintf;
#B color 5;
#P window linecount 2;
#P message 690 196 129 196617 ; max sendapppath tosprintf;
#B color 5;
#P window linecount 1;
#P message 977 368 43 196617 depth 0;
#P message 831 364 107 196617 types JPEG PNG PNGf;
#P newex 753 341 227 196617 t b b b clear;
#P message 753 364 75 196617 autopopulate 1;
#P newex 674 364 76 196617 prepend prefix;
#P newex 674 315 131 196617 sprintf symout %simages/;
#P user com 809 316 143 196617 8;
#K set 0 26223 27748 25970 8226 26989 24935 25971 8736;
#K end;
#P newex 294 78 170 196617 t 0 0 1;
#P newex 218 414 29 196617 gate;
#P message 535 52 33 196617 clear;
#P newex 218 433 40 196617 t i i i;
#P newex 154 255 38 196617 sel 1;
#P newex 96 236 68 196617 unpack s 0;
#P newex 96 216 94 196617 route importmovie;
#P newex 28 35 43 196617 r 1path;
#B color 5;
#P user ubumenu 28 107 100 196617 0 1 1 0;
#X prefix_set 0 0
0;
#P newex 73 185 129 196617 jit.matrix 4 char 640 480;
#P message 220 286 39 196617 set $1;
#P newex 73 160 30 196617 t b s;
#N vpatcher 257 191 857 591;
#P outlet 74 80 15 0;
#P inlet 69 36 15 0;
#P connect 0 0 1 0;
#P pop;
#P newobj 221 235 13 196617 p;
#P newex 284 264 27 196617 – 1;
#P message 233 460 45 196617 index $1;
#N counter 0 0 14;
#X flags 0 0;
#P newobj 220 307 75 196617 counter 0 0 14;
#P message 200 265 78 196617 matrixcount $1;
#P message 359 452 84 196617 outputmatrix $1;
#P newex 221 158 72 196617 route populate;
#P newex 73 136 105 196617 prepend importmovie;
#P newex 200 487 158 196617 jit.matrixset 20 4 char 640 480;
#P comment 272 184 100 196617 how many ?;
#P comment 123 462 167 196617 store matrix at index;
#P comment 68 258 89 196617 1 si image loaded;
#P window setfont "Sans Serif" 36.;
#P comment 532 12 32 196644 1;
#B color 8;
#P connect 17 0 16 0;
#P fasten 24 0 16 0 299 101 33 101;
#P fasten 21 0 16 0 223 459 21 459 21 99 33 99;
#P connect 22 0 16 0;
#P connect 16 1 5 0;
#P connect 5 0 13 0;
#P connect 13 1 15 0;
#P connect 13 0 15 0;
#P fasten 15 1 18 0 197 209 101 209;
#P connect 18 0 19 0;
#P connect 16 0 58 0;
#P connect 19 1 20 0;
#P fasten 12 0 8 0 226 260 205 260;
#P connect 10 0 4 0;
#P connect 8 0 4 0;
#P lcolor 2;
#P fasten 7 0 4 0 364 481 205 481;
#P fasten 15 0 4 0 78 481 205 481;
#P connect 4 0 48 0;
#P fasten 21 2 54 0 253 456 264 456 264 339 223 339;
#P fasten 55 0 54 0 306 334 223 334;
#P connect 54 0 53 0;
#P connect 24 2 51 0;
#P connect 53 0 51 0;
#P connect 51 0 23 0;
#P connect 23 0 21 0;
#P connect 24 2 14 0;
#P connect 20 0 9 0;
#P connect 14 0 9 0;
#P fasten 16 2 6 0 123 127 226 127;
#P connect 6 0 12 0;
#P lcolor 1;
#P connect 21 1 10 0;
#P fasten 24 1 10 0 355 220 355 303;
#P connect 6 0 52 0;
#P fasten 9 0 23 1 225 328 212 328 212 410 242 410;
#P fasten 12 0 11 0 226 260 289 260;
#P connect 11 0 9 4;
#P connect 49 0 24 0;
#P connect 11 0 55 0;
#P fasten 50 0 7 0 693 585 693 485 627 485 587 393 537 393 513 427 433 414;
#P fasten 33 0 26 0 712 306 679 306;
#P connect 26 0 27 0;
#P connect 35 0 36 0;
#P connect 36 0 32 0;
#P connect 39 0 40 0;
#P connect 40 0 38 0;
#P connect 36 1 37 0;
#P connect 37 0 41 0;
#P connect 42 0 43 0;
#P connect 44 0 43 0;
#P connect 22 0 43 0;
#P connect 43 0 50 0;
#P fasten 26 0 29 0 679 336 758 336;
#P connect 29 0 28 0;
#P fasten 29 1 30 0 830 361 836 361;
#P connect 28 0 34 0;
#P connect 30 0 34 0;
#P connect 31 0 34 0;
#P fasten 29 3 34 0 974 410 836 410;
#P connect 27 0 34 0;
#P connect 46 0 45 0;
#P fasten 45 1 47 0 936 519 891 519;
#P connect 29 2 31 0;
#P pop;


November 28, 2007 | 1:20 am

i’ve used this in the past to populate a menu and randomly select from it. it works with poly~, which contains an instance of jit.qt.movie. no idea if this will fix your problem, but maybe…

– save as "polyQTmovie" –

#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#N out 2;
#P newobj 266 187 39 1441802 out 2;
#P window setfont "Sans Serif" 9.;
#P comment 78 38 34 196617 start;
#P window setfont "Fixedwidth Serif" 10.;
#P message 114 109 38 1441802 start;
#P newex 79 79 80 1441802 sel 0 1;
#P message 79 108 32 1441802 stop;
#N out 1;
#P newobj 23 188 38 1441802 out 1;
#P newex 23 154 339 1441802 jit.qt.movie @autostart @loopreport 1 0 @loop 2 320 240;
#N in 2;
#P newobj 79 53 33 1441802 in 2;
#N in 1;
#P newobj 23 96 32 1441802 in 1;
#P objectname qtIn;
#P window setfont "Sans Serif" 9.;
#P comment 22 69 34 196617 read;
#P connect 3 1 9 0;
#P connect 6 1 7 0;
#P connect 6 0 5 0;
#P connect 2 0 6 0;
#P connect 3 0 4 0;
#P fasten 7 0 3 0 119 142 28 142;
#P fasten 5 0 3 0 84 142 28 142;
#P connect 1 0 3 0;
#P window clipboard copycount 10;

– save as "whateva" –

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 305 210 45 196617 sel bang;
#P number 284 343 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 247 418 45 196617 frame 0;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 247 395 110 1441802 t b i b;
#P message 297 430 80 1441802 target $1 , 1;
#P newex 297 453 33 1441802 i;
#P message 297 476 80 1441802 target $1 , 0;
#P window setfont "Sans Serif" 9.;
#P newex 305 189 80 196617 r $1.next;
#P newex 141 261 52 196617 pv name1;
#P newex 178 210 73 196617 sel;
#N counter;
#X flags 0 0;
#P newobj 178 189 66 196617 counter;
#P newex 189 404 20 196617 t b;
#P newex 189 382 55 196617 route read;
#P newex 115 170 27 196617 + 1;
#P newex 172 295 27 196617 + 1;
#P newex 272 295 40 196617 t b i b;
#P button 272 250 15 0;
#P newex 272 270 35 196617 urnNR;
#P message 115 191 52 196617 target $1;
#P newex 98 146 27 196617 t b i;
#P newex 151 236 65 196617 prepend read;
#P button 98 74 15 0;
#P user ubumenu 98 119 116 196617 0 1 1 0;
#X prefix_set 0 1 HardDrive2:/NewProjClips/vjPatch/movies/ 0;
#N vpatcher 40 55 327 333;
#P inlet 50 80 15 0;
#P window setfont "Sans Serif" 9.;
#P message 198 169 31 196617 clear;
#P newex 180 142 28 196617 t s b;
#P newex 180 118 49 196617 tosymbol;
#P message 180 96 65 196617 empty menu!;
#P outlet 141 221 15 0;
#P newex 180 69 45 196617 loadbang;
#P newex 50 145 74 196617 prepend prefix;
#P newex 50 115 74 196617 opendialog fold;
#P connect 8 0 0 0;
#P connect 0 0 1 0;
#P connect 7 0 3 0;
#P connect 1 0 3 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 6 1 7 0;
#P pop;
#P newobj 98 94 59 196617 p ubumaker;
#P newex 204 159 66 196617 t b i i i i;
#P number 253 189 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 204 140 73 196617 route populate;
#P message 253 210 53 196617 voices $1;
#P newex 104 361 95 196617 poly~ polyQTmovie;
#P window linecount 2;
#P comment 302 151 100 196617 bang cause random int is index of movie;
#P connect 26 1 25 0;
#P connect 26 1 24 1;
#P connect 22 0 29 0;
#P fasten 5 1 12 1 223 183 302 183;
#P connect 17 0 18 0;
#P connect 12 0 14 0;
#P connect 13 0 12 0;
#P fasten 29 0 13 0 310 239 277 239;
#P connect 4 0 2 0;
#P fasten 5 4 4 0 265 183 258 183;
#P connect 24 0 23 0;
#P connect 26 2 24 0;
#P fasten 5 3 19 4 251 183 239 183;
#P connect 1 1 17 0;
#P connect 3 0 5 0;
#P connect 7 2 3 0;
#P fasten 5 2 20 1 237 183 246 183;
#P connect 23 0 1 1;
#P connect 25 0 1 1;
#P connect 26 0 27 0;
#P fasten 28 0 26 0 289 388 252 388;
#P connect 19 0 20 0;
#P fasten 5 0 19 0 209 183 183 183;
#P fasten 18 0 19 0 194 427 85 427 85 140 183 140;
#P fasten 29 1 28 0 345 330 289 330;
#P connect 15 0 28 0;
#P fasten 14 1 15 0 292 317 211 317 211 289 177 289;
#P connect 9 0 21 0;
#P fasten 10 0 21 0 103 210 146 210;
#P connect 7 1 9 0;
#P connect 16 0 11 0;
#P connect 10 1 16 0;
#P connect 27 0 1 0;
#P fasten 11 0 1 0 120 280 109 280;
#P fasten 2 0 1 0 258 285 109 285;
#P fasten 21 0 1 0 146 338 109 338;
#P connect 7 0 10 0;
#P fasten 20 1 7 0 246 231 90 231 90 115 103 115;
#P connect 6 0 7 0;
#P connect 8 0 6 0;
#P window clipboard copycount 30;


November 28, 2007 | 4:58 am

Thanks Robtherich,
Please could you tell me what is the [urnNR] object ?


November 28, 2007 | 5:19 am

… I replaced it by [random].

thanks again !


November 28, 2007 | 11:01 am


November 28, 2007 | 6:01 pm

i think urnNR comes with the the standard max distro.
it is an abastraction, yes, but it should be somewhere in either the patches folder, the examples folder, or the tutorials folder.

it can also be replaced with urn.

but here it is:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 189 47 56 196617 urn range;
#N comlet urn range;
#P inlet 207 66 15 0;
#P comment 177 391 83 196617 – John Bischoff;
#P comment 139 340 108 196617 constrain to urn range;
#P comment 127 308 77 196617 …toggle offset;
#P outlet 80 370 15 0;
#P inlet 80 65 15 0;
#P newex 80 168 102 196617 t i i b;
#P newex 155 272 44 196617 select 1;
#P number 172 220 30 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 126 220 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 155 250 27 196617 ==;
#P newex 172 197 22 196617 int;
#P toggle 97 287 15 0;
#P number 80 220 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 80 336 53 196617 % $1;
#P newex 80 309 27 196617 +;
#P newex 100 82 28 196617 t b b;
#P message 111 115 31 196617 clear;
#P newex 80 139 76 196617 urn $1;
#P comment 46 46 91 196617 bang for new value;
#P comment 59 394 68 196617 new value out;
#P window linecount 2;
#P comment 185 243 78 196617 if the new value is a repeat…;
#P connect 8 0 6 0;
#P fasten 8 0 10 1 85 258 66 258 66 190 189 190;
#P connect 13 0 11 1;
#P connect 10 0 13 0;
#P connect 15 2 10 0;
#P connect 11 0 14 0;
#P fasten 12 0 11 0 131 245 160 245;
#P fasten 21 0 7 1 212 330 128 330;
#P fasten 21 0 3 1 212 130 151 130;
#P connect 15 1 12 0;
#P fasten 5 1 4 0 123 110 116 110;
#P fasten 3 1 5 0 151 161 161 161 161 78 105 78;
#P connect 9 0 6 1;
#P fasten 14 0 9 0 160 300 115 300 115 283 102 283;
#P connect 7 0 17 0;
#P connect 6 0 7 0;
#P connect 15 0 8 0;
#P connect 3 0 15 0;
#P fasten 4 0 3 0 116 134 85 134;
#P fasten 5 0 3 0 105 104 85 104;
#P connect 16 0 3 0;
#P window clipboard copycount 23;


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