Forums > Jitter

simultaneous mixing

May 24, 2006 | 12:04 pm

Hi there,

I try to mix two qtmovies( i use single frames in the moment with the importmovie-message) and blend them( i use the jit.op.object)
The problem is that I want two switch between the frames of two sources independently. But the jit.op-object just allows two trigger a blending when i bang the left inlet. That means the second source is depending always on the first.( alphablend inhabits the same obstacle)
Any suggestions how i could blend two sources but at the same time switch between frames of the sources independently ?

thanks,


May 24, 2006 | 1:00 pm

Have your second source generate a bang when it loads or
receives a new matrix, and route the bang message to the
jit.op object. In general, sending a bang message to the
left outlet of the majority of Max objects will instruct them to
perform an operation, or perform it *again.* Here is a really
basic Max dataflow example that you can adapt for your
needs….

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P number 122 234 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 122 183 27 196617 +;
#P number 213 85 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 135 139 15 0;
#P number 122 84 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P connect 1 0 3 0;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P connect 2 0 1 0;
#P connect 2 0 3 1;
#P pop;


May 25, 2006 | 6:22 pm

Hey, thanks for the fast reply!

I tried it….but probably i am just to stupid…..

Here is my tryoutpatch, maybe you see immediately whats wrong about it.
It still happens that when i bang the importmovie-messages 3 + 4 that
nothing happens….

max v2;
#N vpatcher 226 226 826 626;
#P origin 18 62;
#P button 91 247 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 247 40 14 196617 1;
#P button 49 22 15 0;
#P newex 49 41 117 196617 jit.matrix 4 char 50 50;
#P message 65 23 76 196617 importmovie 1;
#P message 135 60 77 196617 getmatrixcount;
#P number 96 60 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 96 78 75 196617 matrixcount $1;
#P message 225 77 82 196617 outputmatrix $1;
#P message 175 77 45 196617 index $1;
#P toggle 49 60 15 0;
#P message 49 78 42 196617 thru $1;
#P newex 49 95 146 196617 jit.matrixset 16 4 char 50 50;
#B color 5;
#P message 525 241 14 196617 4;
#P button 327 223 15 0;
#P newex 327 242 117 196617 jit.matrix 4 char 50 50;
#P message 343 224 76 196617 importmovie 4;
#P message 413 261 77 196617 getmatrixcount;
#P number 374 261 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 374 279 75 196617 matrixcount $1;
#P message 503 278 82 196617 outputmatrix $1;
#P message 453 278 45 196617 index $1;
#P toggle 327 261 15 0;
#P message 327 279 42 196617 thru $1;
#P newex 327 296 146 196617 jit.matrixset 16 4 char 50 50;
#B color 5;
#P message 518 140 14 196617 3;
#P button 320 122 15 0;
#P newex 320 141 117 196617 jit.matrix 4 char 50 50;
#P message 336 123 76 196617 importmovie 3;
#P message 406 160 77 196617 getmatrixcount;
#P number 367 160 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 367 178 75 196617 matrixcount $1;
#P message 496 177 82 196617 outputmatrix $1;
#P message 446 177 45 196617 index $1;
#P toggle 320 160 15 0;
#P message 320 178 42 196617 thru $1;
#P newex 320 195 146 196617 jit.matrixset 16 4 char 50 50;
#B color 5;
#P message 247 141 14 196617 2;
#P button 49 123 15 0;
#P newex 49 142 117 196617 jit.matrix 4 char 50 50;
#P message 65 124 76 196617 importmovie 2;
#P message 135 161 77 196617 getmatrixcount;
#P number 96 161 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 96 179 75 196617 matrixcount $1;
#P message 225 178 82 196617 outputmatrix $1;
#P message 175 178 45 196617 index $1;
#P toggle 49 161 15 0;
#P message 49 179 42 196617 thru $1;
#P newex 49 196 146 196617 jit.matrixset 16 4 char 50 50;
#B color 5;
#P user ubumenu 148 315 60 196617 0 1 1 0;
#X add pass;
#X add *;
#X add /;
#X add +;
#X add -;
#X add +m;
#X add -m;
#X add %;
#X add min;
#X add max;
#X add abs;
#X add avg;
#X add absdiff;
#X add wrap;
#X add fold;
#X add !pass;
#X add !/;
#X add !-;
#X add !%;
#X add &;
#X add |;
#X add ^;
#X add ~;
#X add >>;
#X add < <;
#X add &&;
#X add ||;
#X add !;
#X add >;
#X add < ;
#X add >=;
#X add < =;
#X add ==;
#X add !=;
#X add >p;
#X add

#X add >=p;
#X add < =p;
#X add ==p;
#X add !=p;
#X add sin;
#X add cos;
#X add tan;
#X add asin;
#X add acos;
#X add atan;
#X add atan2;
#X add sinh;
#X add cosh;
#X add tanh;
#X add asinh;
#X add acosh;
#X add atanh;
#X add exp;
#X add exp2;
#X add ln;
#X add log2;
#X add log10;
#X add hypot;
#X add pow;
#X add sqrt;
#X add ceil;
#X add floor;
#X add round;
#X add trunc;
#X add ignore;
#X prefix_set 0 0 0;
#P message 318 338 32 196617 getop;
#N vpatcher 564 112 981 323;
#P window setfont "Sans Serif" 9.;
#P newex 60 106 55 196617 prepend op;
#P user ubumenu 227 61 60 196617 0 1 1 0;
#X add pass;
#X add *;
#X add /;
#X add +;
#X add -;
#X add +m;
#X add -m;
#X add %;
#X add min;
#X add max;
#X add abs;
#X add avg;
#X add absdiff;
#X add !pass;
#X add !/;
#X add !-;
#X add !%;
#X add &;
#X add |;
#X add ^;
#X add ~;
#X add >>;
#X add < <;
#X add &&;
#X add ||;
#X add !;
#X add >;
#X add < ;
#X add >=;
#X add < =;
#X add ==;
#X add !=;
#X add >p;
#X add

#X add >=p;
#X add < =p;
#X add ==p;
#X add !=p;
#X add sin;
#X add cos;
#X add tan;
#X add asin;
#X add acos;
#X add atan;
#X add atan2;
#X add sinh;
#X add cosh;
#X add tanh;
#X add asinh;
#X add acosh;
#X add atanh;
#X add exp;
#X add exp2;
#X add ln;
#X add log2;
#X add log10;
#X add hypot;
#X add pow;
#X add sqrt;
#X add ceil;
#X add floor;
#X add round;
#X add trunc;
#X add ignore;
#X prefix_set 0 0 0;
#P user ubumenu 163 61 60 196617 0 1 1 0;
#X add pass;
#X add *;
#X add /;
#X add +;
#X add -;
#X add +m;
#X add -m;
#X add %;
#X add min;
#X add max;
#X add abs;
#X add avg;
#X add absdiff;
#X add !pass;
#X add !/;
#X add !-;
#X add !%;
#X add &;
#X add |;
#X add ^;
#X add ~;
#X add >>;
#X add < <;
#X add &&;
#X add ||;
#X add !;
#X add >;
#X add < ;
#X add >=;
#X add < =;
#X add ==;
#X add !=;
#X add >p;
#X add

#X add >=p;
#X add < =p;
#X add ==p;
#X add !=p;
#X add sin;
#X add cos;
#X add tan;
#X add asin;
#X add acos;
#X add atan;
#X add atan2;
#X add sinh;
#X add cosh;
#X add tanh;
#X add asinh;
#X add acosh;
#X add atanh;
#X add exp;
#X add exp2;
#X add ln;
#X add log2;
#X add log10;
#X add hypot;
#X add pow;
#X add sqrt;
#X add ceil;
#X add floor;
#X add round;
#X add trunc;
#X add ignore;
#X prefix_set 0 0 0;
#P outlet 60 126 15 0;
#P user ubumenu 99 61 60 196617 0 1 1 0;
#X add pass;
#X add *;
#X add /;
#X add +;
#X add -;
#X add +m;
#X add -m;
#X add %;
#X add min;
#X add max;
#X add abs;
#X add avg;
#X add absdiff;
#X add !pass;
#X add !/;
#X add !-;
#X add !%;
#X add &;
#X add |;
#X add ^;
#X add ~;
#X add >>;
#X add < <;
#X add &&;
#X add ||;
#X add !;
#X add >;
#X add < ;
#X add >=;
#X add < =;
#X add ==;
#X add !=;
#X add >p;
#X add

#X add >=p;
#X add < =p;
#X add ==p;
#X add !=p;
#X add sin;
#X add cos;
#X add tan;
#X add asin;
#X add acos;
#X add atan;
#X add atan2;
#X add sinh;
#X add cosh;
#X add tanh;
#X add asinh;
#X add acosh;
#X add atanh;
#X add exp;
#X add exp2;
#X add ln;
#X add log2;
#X add log10;
#X add hypot;
#X add pow;
#X add sqrt;
#X add ceil;
#X add floor;
#X add round;
#X add trunc;
#X add ignore;
#X prefix_set 0 0 0;
#P user ubumenu 35 61 60 196617 0 1 1 0;
#X add pass;
#X add *;
#X add /;
#X add +;
#X add -;
#X add +m;
#X add -m;
#X add %;
#X add min;
#X add max;
#X add abs;
#X add avg;
#X add absdiff;
#X add !pass;
#X add !/;
#X add !-;
#X add !%;
#X add &;
#X add |;
#X add ^;
#X add ~;
#X add >>;
#X add < <;
#X add &&;
#X add ||;
#X add !;
#X add >;
#X add < ;
#X add >=;
#X add < =;
#X add ==;
#X add !=;
#X add >p;
#X add

#X add >=p;
#X add < =p;
#X add ==p;
#X add !=p;
#X add sin;
#X add cos;
#X add tan;
#X add asin;
#X add acos;
#X add atan;
#X add atan2;
#X add sinh;
#X add cosh;
#X add tanh;
#X add asinh;
#X add acosh;
#X add atanh;
#X add exp;
#X add exp2;
#X add ln;
#X add log2;
#X add log10;
#X add hypot;
#X add pow;
#X add sqrt;
#X add ceil;
#X add floor;
#X add round;
#X add trunc;
#X add ignore;
#X prefix_set 0 0 0;
#P newex 60 85 202 196617 pak * * * *;
#P connect 1 1 0 0;
#P connect 0 0 6 0;
#P connect 6 0 3 0;
#P connect 2 1 0 1;
#P connect 4 1 0 2;
#P connect 5 1 0 3;
#P pop;
#P newobj 254 336 55 196617 p multi_op;
#P newex 173 336 72 196617 prepend op;
#P user jit.pwindow 39 308 52 52 0 1 0 0 1 0;
#X name 50fifty;
#P newex 40 273 64 196617 jit.op @op +;
#P connect 54 0 0 0;
#P connect 6 0 0 0;
#P connect 2 0 0 0;
#P connect 42 0 0 0;
#P connect 0 0 1 0;
#P connect 50 0 51 0;
#P connect 52 0 51 0;
#P connect 44 0 43 0;
#P connect 51 0 42 0;
#P hidden fasten 49 0 42 0 140 74 54 74;
#P fasten 47 0 42 0 101 88 54 88;
#P fasten 45 0 42 0 180 88 54 88;
#P fasten 46 0 42 0 230 88 54 88;
#P fasten 43 0 42 0 54 88 54 88;
#P connect 16 0 15 0;
#P connect 14 0 15 0;
#P connect 8 0 7 0;
#P fasten 7 0 6 0 54 189 54 189;
#P fasten 10 0 6 0 230 189 54 189;
#P fasten 9 0 6 0 180 189 54 189;
#P fasten 11 0 6 0 101 189 54 189;
#P hidden fasten 13 0 6 0 140 175 54 175;
#P connect 15 0 6 0;
#P connect 41 0 54 0;
#P connect 29 0 54 0;
#P connect 30 0 0 1;
#P connect 18 0 0 1;
#P connect 48 0 47 0;
#P connect 12 0 11 0;
#P connect 5 1 2 0;
#P connect 53 0 45 0;
#P connect 17 0 9 0;
#P connect 53 0 46 0;
#P connect 17 0 10 0;
#P connect 28 0 27 0;
#P connect 26 0 27 0;
#P connect 20 0 19 0;
#P hidden fasten 25 0 18 0 411 174 325 174;
#P fasten 23 0 18 0 372 188 325 188;
#P fasten 21 0 18 0 451 188 325 188;
#P fasten 22 0 18 0 501 188 325 188;
#P fasten 19 0 18 0 325 188 325 188;
#P connect 27 0 18 0;
#P connect 40 0 39 0;
#P connect 38 0 39 0;
#P connect 32 0 31 0;
#P connect 39 0 30 0;
#P fasten 31 0 30 0 332 289 332 289;
#P fasten 34 0 30 0 508 289 332 289;
#P fasten 33 0 30 0 458 289 332 289;
#P fasten 35 0 30 0 379 289 332 289;
#P hidden fasten 37 0 30 0 418 275 332 275;
#P connect 24 0 23 0;
#P connect 36 0 35 0;
#P connect 29 0 21 0;
#P connect 41 0 33 0;
#P connect 29 0 22 0;
#P connect 41 0 34 0;
#P pop;


May 25, 2006 | 6:47 pm

I don’t think that it’s about stupidity. I just think you need
to spend a little time with the tutorials getting a good
sense of how Max works. Unless I completely misunderstand
what it is you want to do (load a static image, trigger the
jit.op object when either one of two images is loaded), you
really don’t need quite a lot of this patch at all – just the
jit.matrix objects (and the importmovie message) feeding
the jit.op stuff with a few well-placed buttons for bangs. I would
REALLY suggest spending some time woodshedding
with the tutorials – the Jitter stuff so that you understanding
about loading matrices, and the Max stuff so that dataflow
and controlling the order in which things are done makes
sense to you. The good news is that it ought to become
sort of clear pretty quickly where the trouble lies.


May 27, 2006 | 3:35 pm

Hmm, alright I will have another look at the tutorials.
The weird thing is just that i found out that when I want
to change frames seperately( and simultaneously) in jit.glue,
there is a message called "syncinlet", and if you give it the attribute "-1", it does exactly what i would like the op-object to do. Is there any message like that for the op-object?

O.K.,whatever, thanks.


May 27, 2006 | 7:03 pm

No, that’s a rather specialized case; I’d expect to
find it for that object, given what it does.

1. Here’s the deal: Nearly everything in Max/MSP/Jitter
uses what’s called "lazy evaluation." In general, unless
you have an object specifically created to do otherwise
(either a complete external such as pak, or a mode of
operation such as would be the case with jit.glue), you
bang the leftmost inlet to trigger calculations.

The example patch I sent you a few emails back
demonstrates how you use buttons (which send
bang messages) to explicitly trigger outlets with
inputs other than the left inlet. That’s how you do
it in all but a very few cases.

2. Similarly, you can nearly always set the value of
a left inlet *without* triggering a calculation by using
the "set" message.

Two really really basic principles that will serve you
well. I can certainly understand how you could stumble
upon a random counterexample to the way that Max
generally works and – if you don’t know how Max works
in the general sense, which is what the tutorials are
supposed to give you a sense of – mistake that for
"expected" behavior (You could as easily have decided
that everything should work like the pak object, and
we’d be having the same discussion). So now you know.


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