Forums > Jitter

[sharing] multi-video mixing

May 8, 2008 | 10:33 pm

Hi guys,

Here’s a simple patch that shows how to mix four videos together, fade each in and out while maintaining an overall stable presence (i.e. scaling values for all four movies always add up to 1.).

Like I said, it’s a simple patch, but seems like it might be a useful thing to post for beginner-esque Jitterists. Maybe someone will find it useful.

best,
Zachary

max v2;
#N vpatcher 333 50 1380 711;
#P window setfont "Sans Serif" 12.;
#P comment 830 380 181 196620 < --- adjust overall brightness;
#P newex 47 371 180 196620 jit.window fader @pos 10 50;
#P newex 778 495 65 196620 s master;
#P comment 779 321 52 196620 Master;
#P user multiSlider 778 341 48 146 0. 1. 1 2681 47 0 0 2 0 70 0;
#M frgb 26 20 130;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 163 307 64 196620 r master;
#P newex 47 337 126 196620 jit.op @op * @val 0.;
#P window linecount 2;
#P comment 268 380 246 196620 think of this as a depiction of each video’s presence in the final matrix —>;
#P window linecount 1;
#P message 149 91 37 196620 read;
#P user ubumenu 413 139 52 196620 0 1 1 0;
#X add read;
#X add start;
#X add stop;
#X prefix_set 0 0 0;
#P newex 434 172 125 196620 jit.qt.movie @vol 0.;
#P user ubumenu 284 139 52 196620 0 1 1 0;
#X add read;
#X add start;
#X add stop;
#X prefix_set 0 0
0;
#P newex 305 172 125 196620 jit.qt.movie @vol 0.;
#P comment 290 554 223 196620 levels proportionally normalized —>;
#P comment 417 495 97 196620 raw levels —>;
#P flonum 674 554 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 621 554 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 568 554 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 515 554 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 58 351 424 743;
#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P newex 50 155 68 196620 change 0.;
#P newex 50 189 207 196620 if $f1 != 0. then $f1 else out2 0.;
#P window linecount 0;
#P newex 260 265 27 196620 f;
#P newex 190 265 27 196620 f;
#P newex 120 265 27 196620 f;
#P newex 50 265 27 196620 f;
#P newex 257 50 36 196620 t f f;
#P newex 260 301 33 196620 / 1.;
#P newex 188 50 36 196620 t f f;
#P newex 190 301 33 196620 / 1.;
#P newex 119 50 36 196620 t f f;
#P newex 120 301 33 196620 / 1.;
#P newex 50 50 36 196620 t f f;
#P newex 50 301 33 196620 / 1.;
#P newex 50 225 260 196620 t b f b f b f b f;
#P newex 50 122 149 196620 expr $f1+$f2+$f3+$f4;
#P newex 50 87 218 196620 pak 0. 0. 0. 0.;
#P inlet 257 25 15 0;
#P inlet 188 25 15 0;
#P inlet 119 25 15 0;
#P inlet 50 25 15 0;
#P outlet 190 342 15 0;
#P outlet 260 342 15 0;
#P outlet 120 342 15 0;
#P outlet 50 342 15 0;
#P connect 4 0 12 0;
#P connect 12 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 24 0;
#P connect 24 0 23 0;
#P connect 23 0 10 0;
#P connect 10 0 19 0;
#P connect 19 0 11 0;
#P connect 23 1 0 0;
#P connect 11 0 0 0;
#P connect 12 1 19 1;
#P connect 10 1 11 1;
#P connect 5 0 14 0;
#P connect 14 0 8 1;
#P connect 10 2 20 0;
#P connect 20 0 13 0;
#P connect 23 1 1 0;
#P connect 13 0 1 0;
#P connect 14 1 20 1;
#P connect 10 3 13 1;
#P connect 6 0 16 0;
#P connect 16 0 8 2;
#P connect 10 4 21 0;
#P connect 21 0 15 0;
#P connect 23 1 3 0;
#P connect 15 0 3 0;
#P connect 16 1 21 1;
#P connect 10 5 15 1;
#P connect 7 0 18 0;
#P connect 18 0 8 3;
#P connect 10 6 22 0;
#P connect 22 0 17 0;
#P connect 17 0 2 0;
#P connect 23 1 2 0;
#P connect 18 1 22 1;
#P connect 10 7 17 1;
#P pop;
#P newobj 515 523 170 196620 p avg&normalize;
#B color 12;
#P comment 678 321 37 196620 Vid4;
#P comment 626 321 37 196620 Vid3;
#P comment 574 321 37 196620 Vid2;
#P comment 522 321 37 196620 Vid1;
#P flonum 674 495 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 674 583 36 196620 s v4;
#P user multiSlider 674 341 48 146 0. 1. 1 2681 47 0 0 2 0 70 0;
#M frgb 26 20 130;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P flonum 621 495 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 621 583 36 196620 s v3;
#P user multiSlider 621 341 48 146 0. 1. 1 2681 47 0 0 2 0 70 0;
#M frgb 26 20 130;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P flonum 568 495 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 568 583 36 196620 s v2;
#P user multiSlider 568 341 48 146 0. 1. 1 2681 47 0 0 2 0 70 0;
#M frgb 26 20 130;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P flonum 515 495 49 12 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 515 583 36 196620 s v1;
#P user multiSlider 515 341 48 146 0. 1. 1 2681 47 0 0 2 0 70 0;
#M frgb 26 20 130;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P user panel 486 310 263 306;
#X brgb 186 189 243;
#X frgb 0 0 0;
#X border 3;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 573 287 83 196620 VIDEO MIXER;
#P newex 550 211 35 196620 r v4;
#P newex 421 211 35 196620 r v3;
#P newex 292 211 35 196620 r v2;
#P newex 163 211 35 196620 r v1;
#P user ubumenu 155 139 52 196620 0 1 1 0;
#X add read;
#X add start;
#X add stop;
#X prefix_set 0 0
0;
#P newex 176 172 125 196620 jit.qt.movie @vol 0.;
#P newex 47 278 398 196620 jit.expr @expr "in[0] + in[1] + in[2] + in[3]" @inputs 4;
#P newex 434 242 126 196620 jit.op @op * @val 0.;
#P newex 305 242 126 196620 jit.op @op * @val 0.;
#P newex 176 242 126 196620 jit.op @op * @val 0.;
#P newex 47 242 126 196620 jit.op @op * @val 0.;
#P toggle 336 61 24 0;
#P newex 336 91 74 196620 qmetro 33;
#P user ubumenu 26 139 52 196620 0 1 1 0;
#X add read;
#X add start;
#X add stop;
#X prefix_set 0 0
0;
#P newex 47 172 125 196620 jit.qt.movie @vol 0.;
#P window setfont "Sans Serif" 18.;
#P comment 294 27 445 196626 PROPORTIONAL-PRESENCE MULTI-VIDEO MIXER;
#P user panel 751 310 103 221;
#X brgb 153 107 28;
#X frgb 0 0 0;
#X border 3;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 46 0 2 0;
#P connect 4 0 2 0;
#P connect 3 1 2 0;
#P connect 2 0 6 0;
#P connect 6 0 10 0;
#P connect 10 0 48 0;
#P connect 48 0 53 0;
#P connect 13 0 6 1;
#P connect 49 0 48 1;
#P connect 46 0 11 0;
#P connect 4 0 11 0;
#P connect 12 1 11 0;
#P connect 11 0 7 0;
#P connect 7 0 10 1;
#P connect 14 0 7 1;
#P connect 46 0 42 0;
#P connect 4 0 42 0;
#P connect 43 1 42 0;
#P connect 42 0 8 0;
#P connect 8 0 10 2;
#P connect 5 0 4 0;
#P connect 15 0 8 1;
#P connect 46 0 44 0;
#P connect 4 0 44 0;
#P connect 45 1 44 0;
#P connect 44 0 9 0;
#P connect 9 0 10 3;
#P connect 19 0 21 0;
#P connect 21 0 35 0;
#P connect 35 0 36 0;
#P connect 36 0 20 0;
#P connect 16 0 9 1;
#P connect 22 0 24 0;
#P connect 24 0 35 1;
#P connect 35 1 37 0;
#P connect 37 0 23 0;
#P connect 25 0 27 0;
#P connect 27 0 35 2;
#P connect 35 2 38 0;
#P connect 38 0 26 0;
#P connect 28 0 30 0;
#P connect 30 0 35 3;
#P connect 35 3 39 0;
#P connect 39 0 29 0;
#P connect 50 0 52 0;
#P pop;


May 14, 2008 | 10:55 am

Thanks for posting!! I was looking for a solution to mix several video matrices.

Beatriz (beginner-esque Jitterist :) )


May 14, 2008 | 1:28 pm

If you liked that, you should also like the good old dervish by Joshua
Goldberg:

http://www.goldbergs.com/dervish/

J-F

http://www.jeanfrancoischarles.com
May 12th update: Helianthus musca and Helmut Lachenmann

> Thanks for posting!! I was looking for a solution to mix several video
> matrices.
>
> Beatriz (beginner-esque Jitterist :) )


August 13, 2010 | 1:57 am

Here’s the same basic idea, but using slabs, and with a cleaner avg&normalize method.

best,
Zachary

– Pasted Max Patch, click to expand. –

August 17, 2010 | 6:42 pm

thanks for sharing! being trying to figure out how to do a four way mixer on a slab for ages

thanks
Ben


December 27, 2010 | 9:50 pm

ZACHARY!

Thank you so much for sharing this patch, I’ve been looking for something similar for quite a while for my final semester project. If it isn’t too much to ask, I’d like to request your help in modifying this patch to my project needs.

You see, I’m trying to create a mock-up television set to be placed in a public setting. On this television set, I will perform a live chat from a remote location with the people on site (through the television set-of course).

My problem is that I need this tv to work like a real one where I am just one of the channels. And the trick is, I need the viewer/participant to control the channels with his body-he is the "human antenna" (that is the title of my project).

Do you have any pointers to help lead me down the right path? I heard cv.jit.undergrad is the object I need, but I’ve looked through the help files and the internet, & I came out with nothing. I’m not really a huge Max 5 fan, still a beginner I guess.

Thank you in advance!


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