Forums > Jitter

can I smooth animation using cpuclock?

May 6, 2006 | 8:27 pm

Hi list,

I’m loading transparent tiff files into jit.gl.videoplane and then animating them using "pak position" – it works fairly well but every 1500 milliseconds (or so) it has a noticeable jump in frames. Is there a better way to drive the animation? Here’s a very simplified example of what I am doing:

#P window setfont "Sans Serif" 9.;
#P user jit.fpsgui 46 692 60 196617 0;
#P user jit.pwindow 263 297 82 62 0 1 0 0 1 0;
#P window linecount 1;
#P message 46 645 70 196617 fullscreen $1;
#P toggle 46 627 15 0;
#P newex 46 663 75 196617 jit.window foo;
#B color 6;
#P user jit.fpsgui 49 573 60 196617 0;
#P newex 49 549 301 196617 jit.gl.render foo @erase_color 0. 0. 0. 1. @ortho 2 @up 0. -1. 0.;
#P newex 49 166 66 196617 t b b b erase;
#P message 235 229 57 196617 read , bang;
#P toggle 49 124 15 0;
#P newex 49 143 51 196617 qmetro 2;
#P message 466 321 103 196617 1500 , -1500 48000;
#P newex 466 338 40 196617 line;
#P newex 466 358 60 196617 * 0.001;
#P newex 400 378 111 196617 pak position 0.74 0. 0.;
#P newex 235 248 147 196617 jit.qt.movie 100 200 @rate 0.;
#B color 14;
#P window linecount 2;
#P newex 235 497 237 196617 jit.gl.videoplane foo @blend_enable 1 @interp 1 @automatic 0 @depth_enable 1 @scale 0.25 0.5 0.;
#B color 14;
#P window linecount 1;
#P comment 294 230 433 196617 < < #P window linecount 3;
#P comment 574 322 100 196617 < <<

#P comment 474 498 100 196617 < << I have several of these going at the same time;
#P window linecount 1;
#P comment 119 694 436 196617 < << I'm getting very high fps (around 70-80 with many of these jit.gl.videoplanes in use);
#P window linecount 9;
#P comment 514 381 100 196617 Question: how can I get a smoother animation as I change the position of the jit.gl.videoplane? I tried cpuclock and it’s output is visibly just as jerky as the animation.;
#P window linecount 1;
#P comment 580 754 269 196617 system: MACOS Tiger 1.67cpu 128gpu 1gbram;
#P connect 18 0 22 0;
#P connect 7 0 6 0;
#P connect 7 0 21 0;
#P fasten 15 2 6 0 90 492 240 492;
#P fasten 15 3 16 0 108 192 54 192;
#P connect 15 0 16 0;
#P connect 16 0 17 0;
#P fasten 8 0 6 0 405 404 240 404;
#P connect 20 0 18 0;
#P connect 12 0 15 0;
#P connect 19 0 20 0;
#P connect 14 0 7 0;
#P connect 13 0 12 0;
#P connect 10 0 9 0;
#P connect 9 0 8 2;
#P connect 11 0 10 0;
#P window clipboard copycount 23;

thx in advance

http://www.bartwoodstrup.com
http://www.vodstrup.com


May 6, 2006 | 8:32 pm

Also, I just tested this sample patch and it plays very smooth when compared to my main patch. Is there a limit to the number of layers/planes (sorry that I don’t know a better term) that I can draw to the jit.gl.texture and jit.gl.videoplane? Right now I have 4 jit.gl.texture and 6 jit.gl.videoplane going at the same time.

bbw

http://www.bartwoodstrup.com
http://www.vodstrup.com


May 7, 2006 | 1:42 am

Well I found out that my problem has nothing to do with the cpuclock (but at least now I have a good idea of how to use it). I discovered that my animation is having a stuttered playback due to the fact that I am reading a tiff file into a jit.qt.movie every 1500 milliseconds.

I think my choices are to either use the loadram message (which doesn’t seem to do the trick) or possibly use a jit.gl.texture and jit.gl.sketch.

Can anyone make a suggestion for the appropriate way to use the loadram in this situation? in what order does it get banged?

#P toggle 107 68 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 107 88 51 196617 qmetro 2;
#P toggle 287 154 15 0;
#P message 247 395 46 196617 loadram;
#P newex 461 392 41 196617 sel 0.7;
#P newex 287 177 64 196617 metro 4000;
#P newex 209 271 27 196617 t i b;
#P message 531 348 71 196617 0.69 , 0 2000;
#P message 449 348 65 196617 0 , 0.7 2000;
#P newex 449 372 40 196617 line 0.;
#N counter 0 0 6;
#X flags 0 0;
#P newobj 287 206 71 196617 counter 0 0 6;
#P message 449 414 84 196617 color 1. 1. 1. $1;
#P newex 190 372 40 196617 t b b s;
#P newex 190 353 68 196617 prepend read;
#P user ubumenu 190 330 100 196617 0 1 1 0;
#X add 01.tif;
#X add 03.tif;
#X add 05.tif;
#X add 07.tif;
#X add 09.tif;
#X add 11.tif;
#X add 13.tif;
#X prefix_set 0 1 "Macintosh HD:!video:sarasvati:sara1:" 0;
#X pattrmode 1;
#P message 190 312 219 196617 prefix "Macintosh HD:!video:sarasvati:sara1";
#P newex 190 416 209 196617 jit.qt.movie 322 355 @rate 0. @autostart 0;
#B color 14;
#P window linecount 2;
#P newex 190 443 313 196617 jit.gl.videoplane foo @blend_enable 1 @dim 1 1 @interp 1 @automatic 0 @depth_enable 1 @scale 0.5 0.5 0. @position 0. 0. 0.;
#B color 14;
#P comment 371 185 100 196617 every 4 sec I am loading in a new tiff;
#P window linecount 1;
#P comment 534 378 139 196617 this fades the tiff i/o;
#P newex 190 180 56 196617 r loadbang;
#P connect 0 0 5 0;
#P connect 4 0 3 0;
#P fasten 9 0 3 0 454 437 195 437;
#P fasten 19 0 3 0 112 436 195 436;
#P connect 20 0 19 0;
#P connect 11 0 9 0;
#P fasten 11 0 16 0 454 391 466 391;
#P connect 10 0 14 0;
#P connect 18 0 15 0;
#P connect 14 0 6 0;
#P connect 5 0 6 0;
#P fasten 6 1 7 0 240 350 195 350;
#P connect 15 0 10 0;
#P connect 14 1 12 0;
#P fasten 13 0 11 0 536 369 454 369;
#P connect 12 0 11 0;
#P connect 16 0 13 0;
#P fasten 17 0 4 0 252 413 195 413;
#P connect 8 0 4 0;
#P connect 7 0 8 0;
#P fasten 8 2 4 0 225 409 195 409;
#P fasten 8 1 17 0 210 392 252 392;
#P window clipboard copycount 21;

thx,

bbw

http://www.bartwoodstrup.com
http://www.vodstrup.com


May 7, 2006 | 7:09 am

On 07.05.2006, at 03:41, vodstrup wrote:

> Can anyone make a suggestion for the appropriate way to use the
> loadram in this situation? in what order does it get banged?

dear bbw vodstrup,

no need to use loadram in this case!
if you’re only dealing with still images, you should consider
jit.matrixset or mxj matrixlist; if a movie might want to join, a
polymovie solution would be better.
in that case, check the jitter-examples/video/quicktime/polymovie/
Poly~ForMovies.pat example, or the jitjavamoviebank-example.pat

jan klug


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