Forums > MaxMSP

Syncing sensor data with Jitter movie

February 26, 2008 | 11:18 pm

Hi all,

Does anyone have a good solution for synchronizing sensor data with a
Jitter movie. I’ve looked at the various approaches, and I’ve seen
the approach of recording data into the audio tracks. Is there an
easier way of doing this?

I’m working on a project with dancer and video, and it would be nice
to be able to synchronize the two for development purposes.

thanks,
Peter McCulloch


February 27, 2008 | 1:26 am

i am assuming you want to record the dancer and the output of the sensors at the same time so you can do further experiments with the archive without having the dancer being always present;

couldnt you record the data into a matirx with one dim, one cell per sensor value, each value being written in at the movie’s frame output rate ?

you could even grab your movie and add a fifth plane for that withthe sensor data written into it .
rereading the grabbed movie you ll jusy need to unpack it to acces the fifth plane and have it spit out the data while the movie is reading…
i havent tried it but it could work .

my 0.00002 cents

Quote: peter.mcculloch@gmail.com wrote on Wed, 27 February 2008 00:18
—————————————————-
> Hi all,
>
> Does anyone have a good solution for synchronizing sensor data with a
> Jitter movie. I’ve looked at the various approaches, and I’ve seen
> the approach of recording data into the audio tracks. Is there an
> easier way of doing this?
>
> I’m working on a project with dancer and video, and it would be nice
> to be able to synchronize the two for development purposes.
>
> thanks,
> Peter McCulloch
>
—————————————————-


February 27, 2008 | 1:42 am

this might be total nonsense, and it is not ment to b a working patch but you l will get the idea :

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 178 453 66 196617 jit.qt.record;
#P toggle 178 86 15 0;
#P newex 178 126 52 196617 metro 33;
#P newex 394 270 27 196617 f;
#P inlet 411 189 15 0;
#P newex 394 321 118 196617 jit.matrix 1 float32 1 1;
#P newex 394 296 37 196617 jit.fill;
#P newex 178 193 40 196617 t l b b;
#P newex 178 321 66 196617 jit.unpack;
#P newex 178 159 63 196617 jit.qt.movie;
#P newex 286 321 66 196617 jit.unpack;
#P newex 286 279 56 196617 jit.qt.grab;
#P newex 178 367 228 196617 jit.pack 9;
#P comment 430 188 100 196617 sensor data in;
#P window linecount 2;
#P comment 245 157 100 196617 the movie dictates the recording rate;
#P comment 294 243 100 196617 capture dancer (if necessary );
#P window linecount 1;
#P comment 230 389 100 196617 is this possible ?;
#P window linecount 5;
#P comment 248 453 100 196617 and unpack the result to view movie + grabbed sequence + sensor data synchronized;
#P connect 12 0 5 8;
#P connect 11 0 12 0;
#P connect 5 0 17 0;
#P connect 16 0 15 0;
#P connect 15 0 8 0;
#P connect 6 0 7 0;
#P fasten 10 2 14 0 213 238 399 238;
#P connect 13 0 14 1;
#P connect 14 0 11 0;
#P fasten 10 1 6 0 198 257 291 257;
#P connect 10 0 9 0;
#P connect 8 0 10 0;
#P connect 7 3 5 7;
#P connect 7 2 5 6;
#P connect 7 1 5 5;
#P connect 7 0 5 4;
#P connect 9 3 5 3;
#P connect 9 2 5 2;
#P connect 9 1 5 1;
#P connect 9 0 5 0;
#P window clipboard copycount 18;


February 27, 2008 | 11:44 am

jit.qt.record , of course does not work for that purpose as it does not seem to record matrices with more then four planes ( ?)but writing matrixes in .jxf format should do it .
here is a version i tried which could almost work , although i am not sure it is efficient and i cant get the 9th plane out whch would the sensor data :

#P user jit.cellblock 286 698 394 766 3 9 1 1 45 17 0 1 1 0 0 0 1 1 1 0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 286 668 109 196617 jit.matrix 1 float32 1;
#P message 476 271 14 196617 0;
#P newex 117 483 71 196617 t i b b;
#P message 241 526 44 196617 max $1;
#P newex 241 502 27 196617 i;
#P newex 285 203 142 196617 jit.matrix sensor 1 float32 1;
#P toggle 303 42 15 0;
#P newex 286 181 79 196617 jit.fill sensor 0;
#P newex 303 67 52 196617 metro 25;
#P newex 286 137 27 196617 f;
#P newex 303 112 47 196617 * 0.001;
#P newex 303 89 70 196617 random 1000;
#P newex 35 490 30 196617 t b b;
#P message 147 516 14 196617 0;
#P newex 117 599 142 196617 jit.matrix 9 float32 320 240;
#P user jit.pwindow 198 699 82 62 0 1 0 0 1 0;
#P user jit.pwindow 116 699 82 62 0 1 0 0 1 0;
#P newex 174 659 53 196617 jit.pack;
#P newex 117 659 53 196617 jit.pack;
#P newex 117 630 143 196617 jit.unpack 9;
#P toggle 35 446 15 0;
#P newex 35 468 52 196617 metro 33;
#P toggle 117 446 15 0;
#P newex 117 515 29 196617 gate;
#N counter;
#X flags 0 0;
#P newobj 117 545 71 196617 counter;
#P newex 117 569 286 196617 sprintf read mud:/Users/karlo/Desktop/test/matrix%ld.jxf;
#P comment 133 446 100 196617 readback;
#P toggle 410 246 15 0;
#P newex 410 283 29 196617 gate;
#N counter;
#X flags 0 0;
#P newobj 410 308 66 196617 counter;
#P newex 410 332 291 196617 sprintf write mud:/Users/karlo/Desktop/test/matrix%ld.jxf;
#P newex 87 362 142 196617 jit.matrix 9 float32 320 240;
#P newex 47 119 53 196617 t b b b b;
#P toggle 47 42 15 0;
#P newex 47 95 52 196617 metro 33;
#P newex 87 273 150 196617 jit.pack 9;
#P newex 155 227 66 196617 jit.unpack;
#P newex 61 225 66 196617 jit.unpack;
#P message 156 177 80 196617 read dozer.mov;
#P newex 155 200 63 196617 jit.qt.movie;
#P message 69 176 83 196617 read dishes.mov;
#P newex 61 200 63 196617 jit.qt.movie;
#P comment 430 246 100 196617 export;
#P comment 378 90 100 196617 data from sensor;
#P window linecount 2;
#P comment 400 665 100 196617 this does not work for some reason…;
#P connect 15 0 40 1;
#P connect 15 0 14 0;
#P connect 25 4 27 0;
#P connect 25 3 26 3;
#P connect 25 5 27 1;
#P connect 25 6 27 2;
#P connect 25 2 26 2;
#P connect 25 1 26 1;
#P connect 25 7 27 3;
#P connect 39 0 9 8;
#P connect 44 0 45 0;
#P connect 25 8 44 0;
#P connect 9 0 13 0;
#P fasten 14 0 13 0 415 355 92 355;
#P connect 25 0 26 0;
#P connect 30 0 25 0;
#P connect 19 0 30 0;
#P connect 32 0 30 0;
#P connect 11 0 10 0;
#P connect 10 0 12 0;
#P connect 12 1 3 0;
#P connect 4 0 3 0;
#P connect 3 0 7 0;
#P connect 24 0 23 0;
#P connect 23 0 32 0;
#P connect 7 0 9 0;
#P fasten 7 1 9 1 80 244;
#P connect 7 2 9 2;
#P connect 7 3 9 3;
#P connect 42 0 21 0;
#P fasten 41 0 20 0 246 543 122 543;
#P connect 21 0 20 0;
#P connect 20 0 19 0;
#P connect 26 0 28 0;
#P connect 22 0 42 0;
#P connect 12 2 5 0;
#P connect 6 0 5 0;
#P connect 5 0 8 0;
#P connect 8 0 9 4;
#P connect 32 1 21 1;
#P connect 8 1 9 5;
#P connect 31 0 20 2;
#P connect 42 1 31 0;
#P connect 8 2 9 6;
#P connect 8 3 9 7;
#P connect 27 0 29 0;
#P connect 40 0 41 0;
#P fasten 42 2 40 0 246 500;
#P connect 37 0 39 0;
#P connect 12 3 35 0;
#P connect 35 0 37 0;
#P connect 34 0 35 1;
#P connect 38 0 36 0;
#P connect 36 0 33 0;
#P connect 33 0 34 0;
#P connect 17 0 16 0;
#P connect 16 0 15 0;
#P fasten 12 0 16 1 52 167 434 167;
#P connect 43 0 15 2;
#P window clipboard copycount 46;


January 26, 2010 | 12:25 pm

Hi, were you able to log the movie and the sensor data together? I would like to do this for multiple sensors, can i use this patch? I am not familiar with jitter, so do I have to start logging the sensor data into the 9th plane or can planes before that be used? Also, can I save multiple sensors into one plane or would eaach sensor need its own plane?
Much appreciation for any feedback!
Thx


January 26, 2010 | 10:02 pm

You might be interested in the Jitter Recipe called GestureRecord, which shows a couple of ways to record frame-based parameter values. The portion on the right is the one that I would probably recommend for this.

LINK


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