cv.jit.track to control an oscillator

May 28, 2008 at 10:06am

cv.jit.track to control an oscillator

Hi I am very new to the world of Max MSP and jitter and could desperately use some guidance.

I am currently using cv.jit.track to track movement from my webcam.

What I would like to do is use the coordinates that are stored in the jit.cellblocks as the object track movement and feed those coordinates into the frequency or pitch of an oscillator or the cut off of a filter.

My goal was to use the X – axis coordinates to control the frequency of pitch and the Y – axis to control either amplitude of filter cutoff.

I cannot find a way to get the coordinates from the jit.cellblock into the frequency of my oscillator can anyone explain why this is and how I can overcome this.

Thanks.

#38110
May 28, 2008 at 12:25pm

Hi Leon,

Send your jitter matrix to a jit.iter object. This will translate the matrix into max messages that you can unpack and use to drive MSP stuff.

Zachary

#132356
May 28, 2008 at 1:36pm

Thanks that has helped a lot I think I can now complete my patch thanks again for that piece of info.

#132357
May 28, 2008 at 4:59pm

by the way, does anyone know how to output the coordinates from
different points using “cv.jit.track @npoints 3″ ..??..
i tried different ways with jit.iter and search here but i guess i’m
still confused by how to ouptuts those points out of a matrix..

///////////////////////////////////////////////////
in the help file of cv.jit.track :
“cv.jit.track” returns a 3-plane float32 matrix that is as wide as
the number of points specified by “npoints”.

The first two planes contain the x and y coordinates of each point,
while the third plane holds each point’s status. This is usually
equal to 1, but can also be 0 if a point is lost. The algorithm will
try to track from its last valid position, so you may choose to
ignore this value.
/////////////////////////////////////////////////

any help would be appreciate..
thx!

ex :

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 345 162 44 196617 del 500;
#P button 345 140 16 0;
#P flonum 434 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P hidden message 171 71 58 196617 vdevice $1;
#P user ubumenu 81 54 120 196617 0 1 1 0;
#X add “DV Video”;
#X add “IIDC FireWire Video”;
#X add “USB Video Class Video”;
#X prefix_set 0 0 0;
#P hidden message 262 39 114 196617 set IIDC FireWire Video;
#P newex 81 100 38 196617 s video;
#P hidden button 241 54 15 0;
#P hidden message 224 53 14 196617 0;
#P user led 81 24 18 18 2 150;
#P hidden newex 495 61 44 196617 del 500;
#P hidden newex 259 71 31 196617 r qtg;
#P hidden newex 495 37 44 196617 loadbang;
#P comment 104 27 76 196617 CAMERA INPUT;
#B frgb 255 255 255;
#P message 154 40 47 196617 settings;
#P message 124 40 33 196617 close;
#P message 95 40 30 196617 open;
#P toggle 81 40 15 0;
#P hidden newex 204 35 46 196617 metro 2;
#P window linecount 2;
#P newex 81 69 120 196617 jit.qt.grab 320 240 @vmode 2 @unique 1;
#P user panel 98 24 103 16;
#X brgb 116 116 116;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 78 21 126 99;
#X brgb 255 185 16;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow -1;
#X done;
#P window linecount 1;
#P message 547 184 63 196617 set 4 30 40;
#P flonum 415 409 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 396 393 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 377 377 50 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 377 350 68 196617 unpack f f f f;
#P newex 377 324 131 196617 jit.iter;
#B color 5;
#P user jit.pwindow 80 276 215 170 0 1 0 0 1 0;
#P message 475 184 69 196617 set 3 130 40;
#P message 411 184 63 196617 set 2 30 40;
#P message 345 184 63 196617 set 1 20 30;
#P newex 81 239 88 196617 cv.jit.track.draw;
#P newex 81 208 114 196617 cv.jit.track @npoints 4;
#P newex 81 154 64 196617 jit.rgb2luma;
#P hidden connect 17 0 25 0;
#P hidden connect 26 0 17 0;
#P hidden connect 29 0 30 0;
#P hidden fasten 19 0 15 0 129 51 86 51;
#P hidden connect 31 0 15 0;
#P hidden fasten 20 0 15 0 159 51 86 51;
#P hidden fasten 18 0 15 0 100 51 86 51;
#P hidden connect 16 0 15 0;
#P hidden connect 23 0 15 0;
#P connect 15 0 28 0;
#P connect 15 0 0 0;
#P connect 0 0 1 0;
#P fasten 5 0 1 0 480 203 86 203;
#P fasten 4 0 1 0 416 203 86 203;
#P fasten 3 0 1 0 350 203 86 203;
#P fasten 12 0 1 0 552 203 86 203;
#P connect 1 0 2 0;
#P connect 2 0 6 0;
#P fasten 0 0 2 1 86 180 218 180 218 232 164 232;
#P hidden connect 30 0 31 0;
#P hidden connect 17 0 16 0;
#P hidden connect 27 0 26 0;
#P hidden connect 19 0 27 0;
#P hidden connect 24 0 29 0;
#P connect 17 0 33 0;
#P connect 33 0 34 0;
#P fasten 34 0 3 0 350 181 350 181;
#P fasten 1 0 7 0 86 268 382 268;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 8 1 10 0;
#P fasten 34 0 4 0 350 181 416 181;
#P connect 8 2 11 0;
#P connect 8 3 32 0;
#P fasten 34 0 5 0 350 181 480 181;
#P hidden connect 22 0 24 0;
#P fasten 34 0 12 0 350 181 552 181;
#P window clipboard copycount 35;

>Thanks that has helped a lot I think I can now complete my patch
>thanks again for that piece of info.

#132358

You must be logged in to reply to this topic.