Forums > Jitter

How to blend two jit.graph?

April 22, 2007 | 5:59 am

Hi there! I want to blend two different audio signals into a window by the use of two jit.catch~ and two jit.graph~

I made a patch but it doesn’t work. If I take the jit.graph~ it works somehow (not showing what I want and sending an error message constantly at the max window: "jit.gl.texture: setting texture target.: GL Error: Invalid value")

Thanks in advance,

Miguel

Here is the patch

max v2;
#N vpatcher 301 44 1181 732;
#P origin 94 88;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 166 90 72 196617 loadmess 100;
#P newex 166 183 381 196617 jit.graph @mode 1 @clearit 1 @frgb 125 255 124 94 @out_name lala @brgb 0 0 0;
#P newex 413 129 381 196617 jit.graph @mode 2 @clearit 1 @frgb 125 255 124 94 @out_name lala @brgb 0 0 0;
#P newex 321 400 48 196617 loadbang;
#P newex 321 264 48 196617 loadbang;
#P message 485 436 110 196617 position -0.19 0. 0.76;
#P message 321 436 116 196617 rotate 65 243 120 112;
#P message 485 336 105 196617 position 0.27 0. 0.46;
#P message 321 336 119 196617 rotate 42 -91 -129 -17;
#P message 143 421 107 196617 texture movie4 , bang;
#P number 166 119 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 166 140 40 196617 cycle~;
#P newex 166 164 97 196617 jit.catch~ @mode 1;
#P newex 413 85 37 196617 noise~;
#P newex 413 110 97 196617 jit.catch~ @mode 1;
#P newex 143 295 31 196617 gate;
#B color 5;
#P toggle 143 275 15 0;
#P newex 164 235 62 196617 t b b;
#P window linecount 2;
#P newex 143 452 322 196617 jit.gl.videoplane v001 @depth_enable 0 @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0 @color 1. 1. 1. 0.7;
#P toggle 30 35 29 0;
#P window linecount 1;
#P newex 30 240 92 196617 jit.gl.render v001;
#P newex 413 151 166 196617 jit.gl.texture v001 @name movie4;
#P newex 166 203 166 196617 jit.gl.texture v001 @name movie3;
#P newex 30 217 58 196617 t b b erase;
#P newex 30 92 51 196617 qmetro 2;
#P newex 195 295 31 196617 gate;
#B color 5;
#P toggle 195 275 15 0;
#P message 195 321 107 196617 texture movie3 , bang;
#P window linecount 2;
#P newex 195 352 319 196617 jit.gl.videoplane v001 @depth_enable 0 @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0 @color 1. 1. 1. 0.7;
#P user ezdac~ 98 65 142 98 0;
#P window linecount 1;
#P newex 30 270 85 196617 jit.window v001;
#P connect 11 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 10 0;
#P connect 7 2 10 0;
#P connect 11 0 1 0;
#P connect 11 0 14 0;
#P connect 14 0 15 0;
#P connect 15 0 21 0;
#P connect 24 0 12 0;
#P connect 25 0 12 0;
#P connect 21 0 12 0;
#P connect 7 1 13 0;
#P connect 13 0 15 1;
#P connect 30 0 20 0;
#P connect 20 0 19 0;
#P fasten 6 0 18 0 35 160 171 160;
#P connect 19 0 18 0;
#P connect 18 0 29 0;
#P connect 29 0 8 0;
#P connect 11 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P connect 22 0 2 0;
#P connect 23 0 2 0;
#P connect 3 0 2 0;
#P connect 13 1 5 1;
#P connect 26 0 22 0;
#P connect 27 0 24 0;
#P connect 6 0 16 0;
#P connect 17 0 16 0;
#P connect 16 0 28 0;
#P connect 28 0 9 0;
#P fasten 26 0 23 0 326 290 490 290;
#P fasten 27 0 25 0 326 429 490 429;
#P pop;


April 22, 2007 | 12:53 pm

Why not use jit.gl.graph with blend_enable on? Be careful with the draw order.

max v2;
#N vpatcher 670 47 1593 474;
#P origin 94 88;
#P window setfont "Sans Serif" 9.;
#P flonum 535 235 35 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P window linecount 1;
#P newex 512 253 33 9109513 *~ 0.5;
#P number 513 190 35 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 513 211 40 9109513 cycle~;
#P newex 512 354 373 9109513 jit.gl.graph v001 @blend_enable 1 @scale 1. 1. 0.001 @color 0. 0. 1. 0.5 @automatic 0;
#P flonum 248 224 35 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P newex 225 242 33 9109513 *~ 0.5;
#P number 363 214 35 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P message 363 232 74 9109513 circpoints $1;
#P window linecount 2;
#P newex 226 343 239 9109513 jit.gl.graph v001 @blend_enable 1 @scale 1. 1. 0.001 @color 1. 0. 0. 0.5 @position 0. 0. 0.001 @automatic 0;
#P number 226 179 35 9 0 0 0 139 0 0 0 40 204 140 222 222 222 0 0 0;
#P window linecount 1;
#P newex 226 200 40 9109513 cycle~;
#P newex 226 292 97 9109513 jit.catch~ 2 @mode 3;
#P newex 512 295 89 9109513 jit.catch~ @mode 3;
#P toggle 90 29 29 0;
#P newex 90 323 92 9109513 jit.gl.render v001;
#P newex 90 118 61 9109513 t b b b erase;
#P newex 90 74 51 9109513 qmetro 2;
#P user ezdac~ 38 66 82 99 0;
#P newex 89 351 85 9109513 jit.window v001;
#P connect 5 0 1 0;
#P connect 5 0 2 0;
#P connect 2 0 3 0;
#P connect 3 3 4 0;
#P connect 3 0 4 0;
#P connect 8 0 13 0;
#P connect 9 0 8 0;
#P fasten 2 0 7 0 95 101 212 101 212 284 231 284;
#P connect 13 0 7 0;
#P fasten 11 0 10 0 368 333 231 333;
#P connect 7 0 10 0;
#P fasten 3 1 10 0 112 147 204 147 204 323 231 323;
#P connect 14 0 13 1;
#P connect 12 0 11 0;
#P connect 16 0 18 0;
#P fasten 2 0 6 0 95 101 459 101 459 286 517 286;
#P connect 18 0 6 0;
#P fasten 11 0 15 0 368 333 517 333;
#P connect 6 0 15 0;
#P fasten 3 2 15 0 129 147 453 147 453 322 517 322;
#P connect 17 0 16 0;
#P connect 19 0 18 1;
#P pop;


April 22, 2007 | 5:43 pm

Pedro, thanks for your reply. I’m not using jit.gl.graph because I want to rotate and reposition in 3d both matrix. I have this patch that rotate but it is not a graph. I also use the jit.graph because of its graph modes. This patch shows an error at the max window console while running.

Its confusing… don’t know exactly whether I’m merging different approaches in a good way or not.

Thanks for reading.

Miguel

PATCH:

max v2;
#N vpatcher 386 44 1236 590;
#P origin 94 88;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 174 52 72 196617 loadmess 128;
#P newex 533 426 48 196617 loadbang;
#P newex 594 331 48 196617 loadbang;
#P message 654 456 110 196617 position -0.19 0. 0.76;
#P message 533 456 116 196617 rotate 65 243 120 112;
#P message 717 364 105 196617 position 0.27 0. 0.46;
#P message 594 364 119 196617 rotate 42 -91 -129 -17;
#P user ezdac~ 93 65 137 98 0;
#P message 131 441 107 196617 texture movie4 , bang;
#P number 174 75 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 174 96 40 196617 cycle~;
#P newex 174 120 97 196617 jit.catch~ @mode 1;
#P newex 357 95 37 196617 noise~;
#P newex 357 120 97 196617 jit.catch~ @mode 1;
#P newex 131 313 31 196617 gate;
#B color 5;
#P toggle 131 293 15 0;
#P newex 152 253 30 196617 t b b;
#P newex 410 455 90 196617 prepend position;
#P flonum 410 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 482 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 446 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 410 439 61 196617 pak 0. 0. 0.;
#P newex 244 455 82 196617 prepend rotate;
#P flonum 358 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 320 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 282 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 244 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 244 439 73 196617 pak 0. 0. 0. 0.;
#P window linecount 2;
#P newex 131 472 319 196617 jit.gl.videoplane v001 @depth_enable 0 @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0 @color 1. 1. 1. 0.7;
#P window linecount 1;
#P newex 474 363 90 196617 prepend position;
#P flonum 474 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 546 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 510 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 474 347 61 196617 pak 0. 0. 0.;
#P newex 308 363 82 196617 prepend rotate;
#P flonum 422 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 384 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 346 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 308 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 308 347 73 196617 pak 0. 0. 0. 0.;
#P newex 30 281 85 196617 jit.window v001;
#P toggle 30 67 31 0;
#P newex 30 258 92 196617 jit.gl.render v001;
#P newex 357 142 166 196617 jit.gl.texture v001 @name movie4;
#P newex 174 142 166 196617 jit.gl.texture v001 @name movie3;
#P newex 30 235 58 196617 t b b erase;
#P newex 30 102 51 196617 qmetro 2;
#P window linecount 0;
#P comment 0 28 100 196617;
#P window linecount 1;
#P newex 195 313 31 196617 gate;
#B color 5;
#P toggle 195 293 15 0;
#P message 195 349 107 196617 texture movie3 , bang;
#P window linecount 2;
#P newex 195 380 319 196617 jit.gl.videoplane v001 @depth_enable 0 @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0 @color 1. 1. 1. 0.7;
#P connect 10 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 9 0;
#P connect 6 2 9 0;
#P connect 10 0 44 0;
#P fasten 10 0 36 0 136 98;
#P connect 36 0 37 0;
#P connect 37 0 43 0;
#P connect 47 0 23 0;
#P connect 48 0 23 0;
#P connect 43 0 23 0;
#P connect 29 0 23 0;
#P connect 34 0 23 0;
#P connect 6 1 35 0;
#P connect 35 0 37 1;
#P connect 51 0 42 0;
#P connect 42 0 41 0;
#P connect 5 0 40 0;
#P connect 41 0 40 0;
#P connect 40 0 7 0;
#P fasten 10 0 2 0 136 98 136 235 200 235;
#P connect 2 0 3 0;
#P connect 3 0 1 0;
#P connect 46 0 0 0;
#P connect 45 0 0 0;
#P connect 1 0 0 0;
#P connect 17 0 0 0;
#P connect 22 0 0 0;
#P fasten 35 1 3 1 221 270;
#P connect 25 0 24 0;
#P connect 24 0 29 0;
#P connect 26 0 24 1;
#P connect 27 0 24 2;
#P connect 28 0 24 3;
#P connect 13 0 12 0;
#P connect 12 0 17 0;
#P connect 14 0 12 1;
#P connect 15 0 12 2;
#P connect 5 0 38 0;
#P connect 39 0 38 0;
#P connect 38 0 8 0;
#P connect 16 0 12 3;
#P connect 33 0 30 0;
#P connect 30 0 34 0;
#P connect 31 0 30 1;
#P connect 32 0 30 2;
#P connect 21 0 18 0;
#P connect 18 0 22 0;
#P connect 19 0 18 1;
#P connect 20 0 18 2;
#P connect 50 0 47 0;
#P connect 49 0 45 0;
#P fasten 50 0 48 0 538 449 659 449;
#P fasten 49 0 46 0 599 355 722 355;
#P pop;


April 22, 2007 | 6:37 pm

the dimension of jit.catch is crazy, put something like a [jit.matrix 4 char
320 240 @adapt 1] between it and the jit.gl.texture and this will stop the
errors.
alsoor set jit.catch~ to mode 3 which is fixed frame size, and control with
the framesize message.

On 4/22/07, Miguel Mesa Perez wrote:
>
>
>
> Pedro, thanks for your reply. I’m not using jit.gl.graph because I want to
> rotate and reposition in 3d both matrix. I have this patch that rotate but
> it is not a graph. I also use the jit.graph because of its graph modes.
> This patch shows an error at the max window console while running.
>
> Its confusing… don’t know exactly whether I’m merging different
> approaches in a good way or not.
>
> Thanks for reading.
>
> Miguel
>
> PATCH:
>
> max v2;
> #N vpatcher 386 44 1236 590;
> #P origin 94 88;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P newex 174 52 72 196617 loadmess 128;
> #P newex 533 426 48 196617 loadbang;
> #P newex 594 331 48 196617 loadbang;
> #P message 654 456 110 196617 position -0.19 0. 0.76;
> #P message 533 456 116 196617 rotate 65 243 120 112;
> #P message 717 364 105 196617 position 0.27 0. 0.46;
> #P message 594 364 119 196617 rotate 42 -91 -129 -17;
> #P user ezdac~ 93 65 137 98 0;
> #P message 131 441 107 196617 texture movie4 , bang;
> #P number 174 75 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 174 96 40 196617 cycle~;
> #P newex 174 120 97 196617 jit.catch~ @mode 1;
> #P newex 357 95 37 196617 noise~;
> #P newex 357 120 97 196617 jit.catch~ @mode 1;
> #P newex 131 313 31 196617 gate;
> #B color 5;
> #P toggle 131 293 15 0;
> #P newex 152 253 30 196617 t b b;
> #P newex 410 455 90 196617 prepend position;
> #P flonum 410 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 482 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 446 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 410 439 61 196617 pak 0. 0. 0.;
> #P newex 244 455 82 196617 prepend rotate;
> #P flonum 358 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 320 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 282 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 244 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 244 439 73 196617 pak 0. 0. 0. 0.;
> #P window linecount 2;
> #P newex 131 472 319 196617 jit.gl.videoplane v001 @depth_enable 0
> @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0
> @color 1. 1. 1. 0.7;
> #P window linecount 1;
> #P newex 474 363 90 196617 prepend position;
> #P flonum 474 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 546 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 510 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 474 347 61 196617 pak 0. 0. 0.;
> #P newex 308 363 82 196617 prepend rotate;
> #P flonum 422 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 384 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 346 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 308 332 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 308 347 73 196617 pak 0. 0. 0. 0.;
> #P newex 30 281 85 196617 jit.window v001;
> #P toggle 30 67 31 0;
> #P newex 30 258 92 196617 jit.gl.render v001;
> #P newex 357 142 166 196617 jit.gl.texture v001 @name movie4;
> #P newex 174 142 166 196617 jit.gl.texture v001 @name movie3;
> #P newex 30 235 58 196617 t b b erase;
> #P newex 30 102 51 196617 qmetro 2;
> #P window linecount 0;
> #P comment 0 28 100 196617;
> #P window linecount 1;
> #P newex 195 313 31 196617 gate;
> #B color 5;
> #P toggle 195 293 15 0;
> #P message 195 349 107 196617 texture movie3 , bang;
> #P window linecount 2;
> #P newex 195 380 319 196617 jit.gl.videoplane v001 @depth_enable 0
> @blend_enable 1 @automatic 0 @dim 2 2 @scale 0.5 0.5 0.5 @depth_enable 0
> @color 1. 1. 1. 0.7;
> #P connect 10 0 5 0;
> #P connect 5 0 6 0;
> #P connect 6 0 9 0;
> #P connect 6 2 9 0;
> #P connect 10 0 44 0;
> #P fasten 10 0 36 0 136 98;
> #P connect 36 0 37 0;
> #P connect 37 0 43 0;
> #P connect 47 0 23 0;
> #P connect 48 0 23 0;
> #P connect 43 0 23 0;
> #P connect 29 0 23 0;
> #P connect 34 0 23 0;
> #P connect 6 1 35 0;
> #P connect 35 0 37 1;
> #P connect 51 0 42 0;
> #P connect 42 0 41 0;
> #P connect 5 0 40 0;
> #P connect 41 0 40 0;
> #P connect 40 0 7 0;
> #P fasten 10 0 2 0 136 98 136 235 200 235;
> #P connect 2 0 3 0;
> #P connect 3 0 1 0;
> #P connect 46 0 0 0;
> #P connect 45 0 0 0;
> #P connect 1 0 0 0;
> #P connect 17 0 0 0;
> #P connect 22 0 0 0;
> #P fasten 35 1 3 1 221 270;
> #P connect 25 0 24 0;
> #P connect 24 0 29 0;
> #P connect 26 0 24 1;
> #P connect 27 0 24 2;
> #P connect 28 0 24 3;
> #P connect 13 0 12 0;
> #P connect 12 0 17 0;
> #P connect 14 0 12 1;
> #P connect 15 0 12 2;
> #P connect 5 0 38 0;
> #P connect 39 0 38 0;
> #P connect 38 0 8 0;
> #P connect 16 0 12 3;
> #P connect 33 0 30 0;
> #P connect 30 0 34 0;
> #P connect 31 0 30 1;
> #P connect 32 0 30 2;
> #P connect 21 0 18 0;
> #P connect 18 0 22 0;
> #P connect 19 0 18 1;
> #P connect 20 0 18 2;
> #P connect 50 0 47 0;
> #P connect 49 0 45 0;
> #P fasten 50 0 48 0 538 449 659 449;
> #P fasten 49 0 46 0 599 355 722 355;
> #P pop;
>
>


April 23, 2007 | 7:40 pm

Yair, thank you!

It solved the error, but I still cannot blend two jit.graph on the same jit.window. If I set blend_enable 1 on the videoplane, the graphs immediately dissapear. Is it possible to blend two or more jit.graphs?

Any comment?

Thanks!

Miguel


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