Forums > Jitter

jit.glue and jit.alphablend, bizarre text overlay issues

April 25, 2006 | 12:20 pm

I’m using jit.scissors and jit.glue to split up a matrix and glue it back together again, and then using the Jitter tutorial patch 29 to overlay text on the top. However, it really doesn’t work with different column numbers in jit.glue, and I can’t for the life of me see why. Any help would be much appreciated.

Example below.

max v2;
#N vpatcher 801 93 1661 1110;
#P origin 0 414;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 76 195 55 196617 delay 100;
#P message 33 168 14 196617 2;
#P message 16 168 14 196617 1;
#P newex 16 196 49 196617 switch 2;
#P newex 251 141 139 196617 jit.glue @rows 3 @columns 2;
#P newex 251 111 161 196617 jit.scissors @rows 3 @columns 2;
#P newex 35 137 178 196617 jit.glue @rows 3 @columns 3;
#P newex 35 110 202 196617 jit.scissors @rows 3 @columns 3;
#P user jit.pwindow 352 257 322 242 0 1 0 0 1 0;
#P window setfont "Fixedwidth Serif" 10.;
#P message 264 526 34 1441802 read;
#P window setfont Times 10.;
#P comment 313 646 125 1310730 Current time in movie (/100);
#P comment 718 712 32 1310730 Offset;
#P window linecount 2;
#P comment 670 600 126 1310730 Make your own subtitles (Return key displays the text);
#P window linecount 1;
#P comment 346 699 71 1310730 Subtitles on/off;
#P comment 143 508 27 1310730 Start;
#P comment 298 550 27 1310730 Read;
#P window setfont "Fixedwidth Serif" 10.;
#P number 752 711 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 670 659 68 1441802 route text;
#P message 752 734 83 1441802 moveto $1 200;
#P newex 711 758 83 1441802 prepend write;
#P newex 670 789 38 1441802 s lcd;
#P newex 670 685 134 1441802 t b s b clear;
#P user textedit 670 629 809 648 98444 22 10 fff;
#P newex 417 673 53 1441802 loadbang;
#P toggle 417 698 15 0;
#P newex 417 722 60 1441802 gate 1 1;
#P newex 510 567 53 1441802 loadbang;
#P message 510 592 53 1441802 border 1;
#P newex 204 527 53 1441802 loadbang;
#P newex 51 639 73 1441802 r alphamask;
#P newex 357 620 73 1441802 s alphamask;
#P user jit.pwindow 486 619 162 122 1 1 0 0 1 0;
#P newex 400 507 53 1441802 loadbang;
#P newex 229 667 140 1441802 jit.op @op !- @val 255;
#P newex 127 639 26 1441802 t b;
#P newex 127 667 79 1441802 jit.pack 4;
#P newex 127 611 102 1441802 jit.unpack 4;
#P newex 357 592 80 1441802 jit.rgb2luma;
#P newex 245 622 38 1441802 / 100;
#P newex 507 784 27 1441802 b;
#P newex 424 816 68 1441802 delay 1000;
#P newex 477 784 27 1441802 b;
#P newex 477 757 70 1441802 sel 21 40;
#P number 245 645 67 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 245 600 68 1441802 route time;
#P newex 127 549 73 1441802 t gettime b;
#P newex 494 921 38 1441802 s lcd;
#P newex 357 540 38 1441802 r lcd;
#P message 424 840 73 1441802 clear , bang;
#P window linecount 2;
#P message 524 814 192 1441802 clear , moveto 70 200 , write "Can’t You See I’m Busy?" , bang;
#P message 506 866 174 1441802 clear , moveto 90 200 , write "Leave Me Alone!" , bang;
#P window linecount 1;
#P newex 127 696 112 1441802 jit.alphablend;
#B color 5;
#P window linecount 2;
#P message 400 528 223 1441802 font times 18 , textface bold , brgb 255 255 255 , frgb 0 0 0 , clear , bang;
#P window linecount 1;
#P newex 357 567 142 1441802 jit.lcd 4 char 640 480;
#B color 5;
#P user jit.pwindow 18 257 322 242 0 1 0 0 1 0;
#P message 204 550 92 1441802 read ozone.mov;
#P toggle 127 507 15 0;
#P newex 127 527 53 1441802 metro 33;
#P newex 127 576 130 1441802 jit.qt.movie 640 480;
#P user panel 668 597 170 213;
#X brgb 255 128 255;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 123 506 207 67;
#X brgb 255 255 128;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 50 739 329 250;
#X brgb 128 255 255;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 343 694 96 23;
#X brgb 128 255 128;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P message 73 51 33 196617 clear;
#P message 172 51 29 196617 stop;
#P flonum 62 30 35 9 0.5 0.5 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 138 51 33 196617 start;
#P message 107 51 30 196617 read;
#P newex 35 77 105 196617 jit.qt.movie 640 480;
#P toggle 35 30 15 0;
#P newex 35 51 37 196617 metro;
#P window linecount 10;
#P comment 441 84 100 196617 Press 1 on the switch object to see the effects of 3 colums. Press 2 on the switch object to see the effects of 4 columns. Why does 3 not work?;
#P connect 70 0 68 0;
#P connect 69 0 68 0;
#P fasten 20 0 17 0 132 736 24 736;
#P connect 2 0 1 0;
#P connect 5 0 3 0;
#P connect 4 0 3 0;
#P connect 7 0 3 0;
#P connect 1 0 3 0;
#P connect 8 0 3 0;
#P connect 3 0 64 0;
#P connect 64 0 65 0;
#P connect 65 0 68 1;
#P connect 67 0 68 2;
#P connect 64 1 65 1;
#P connect 6 0 1 1;
#P connect 70 0 71 0;
#P connect 69 0 71 0;
#P connect 64 2 65 2;
#P connect 64 3 65 3;
#P connect 64 4 65 4;
#P connect 15 0 14 0;
#P connect 14 0 26 0;
#P fasten 16 0 13 0 209 571 132 571;
#P fasten 26 1 13 0 195 571 132 571;
#P connect 26 0 13 0;
#P connect 63 0 35 0;
#P connect 35 0 37 0;
#P fasten 42 0 36 0 56 662 132 662;
#P connect 37 0 36 0;
#P connect 36 0 20 0;
#P connect 64 5 65 5;
#P connect 35 1 36 1;
#P connect 64 6 65 6;
#P connect 35 2 36 2;
#P connect 64 7 65 7;
#P connect 35 3 36 3;
#P connect 64 8 65 8;
#P connect 43 0 16 0;
#P connect 63 0 38 0;
#P connect 38 0 20 1;
#P connect 13 1 27 0;
#P connect 27 0 33 0;
#P connect 33 0 28 0;
#P connect 3 0 66 0;
#P connect 66 0 67 0;
#P connect 66 1 67 1;
#P connect 66 2 67 2;
#P connect 66 3 67 3;
#P connect 66 4 67 4;
#P fasten 68 0 63 0 21 221 358 221;
#P fasten 19 0 18 0 405 562 362 562;
#P connect 24 0 18 0;
#P connect 18 0 34 0;
#P connect 34 0 41 0;
#P connect 66 5 67 5;
#P connect 39 0 19 0;
#P connect 48 0 47 0;
#P connect 47 0 46 0;
#P fasten 32 0 31 0 512 809 429 809;
#P lcolor 4;
#P fasten 30 0 31 0 482 809 429 809;
#P lcolor 4;
#P connect 31 0 23 0;
#P fasten 28 0 46 1 250 665 472 665;
#P fasten 46 0 29 0 422 748 482 748;
#P connect 29 0 30 0;
#P fasten 34 0 40 0 362 614 492 614;
#P fasten 44 0 40 0 515 614 492 614;
#P fasten 22 0 25 0 529 858 499 858;
#P fasten 21 0 25 0 511 912 499 912;
#P fasten 23 0 25 0 429 902 499 902;
#P lcolor 4;
#P fasten 30 1 21 0 499 834 511 834;
#P connect 29 1 32 0;
#P connect 45 0 44 0;
#P fasten 71 0 22 0 81 218 701 218 701 578 659 578 659 800 541 800 541 808 529 808;
#P connect 32 1 22 0;
#P connect 49 0 54 0;
#P connect 54 0 50 0;
#P fasten 50 3 51 0 798 730 675 730;
#P lcolor 8;
#P fasten 53 0 51 0 757 755 675 755;
#P lcolor 13;
#P fasten 52 0 51 0 716 781 675 781;
#P lcolor 6;
#P connect 50 0 51 0;
#P lcolor 9;
#P connect 50 1 52 0;
#P lcolor 6;
#P connect 50 2 55 0;
#P lcolor 13;
#P connect 55 0 53 0;
#P lcolor 13;
#P pop;


April 25, 2006 | 3:17 pm

Hi Ed,
I found your problem. This issue has stumped me in the past. There
seems to be some rounding error in jit.scissors as it tried to divide
the incoming matrix. I changed all the matrix dims to 320×240 ’cause
it chunks my machine otherwise. In any case, one of your scissor/gue
combos it outputting a 318×240 matrix instead of 320×240. jit.pack
really rally hates inputs that aren’t the same size and thus gives you
a black output. Check it out:

#P window setfont "Sans Serif" 9.;
#P user jit.fpsgui 273 158 60 196617 3;
#P user jit.fpsgui 197 157 60 196617 3;
#P user jit.fpsgui 359 519 60 196617 3;
#P user jit.pwindow -10 681 82 62 0 1 0 0 1 0;
#P user jit.pwindow 189 505 82 62 0 1 0 0 1 0;
#P user jit.pwindow 98 503 82 62 0 1 0 0 1 0;
#P user jit.pwindow 28 697 82 62 0 1 0 0 1 0;
#P user jit.pwindow 268 674 82 62 0 1 0 0 1 0;
#P number 505 601 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 402 493 20 196617 t b;
#N counter 0 0 100;
#X flags 0 0;
#P newobj 452 525 83 196617 counter 0 0 100;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 35 623 148 1441802 jit.matrix mask @thru 0;
#P window setfont "Sans Serif" 9.;
#P newex 88 166 55 196617 delay 100;
#P message 45 139 14 196617 2;
#P message 28 139 14 196617 1;
#P newex 28 167 49 196617 switch 2;
#P newex 263 112 139 196617 jit.glue @rows 3 @columns 2;
#P newex 263 82 161 196617 jit.scissors @rows 3 @columns 2;
#P newex 47 108 178 196617 jit.glue @rows 3 @columns 3;
#P newex 47 81 202 196617 jit.scissors @rows 3 @columns 3;
#P user jit.pwindow 364 228 322 242 0 1 0 0 1 0;
#P window setfont Times 10.;
#P comment 730 683 32 1310730 Offset;
#P window linecount 2;
#P comment 682 571 126 1310730 Make your own subtitles (Return key
displays the text);
#P window linecount 1;
#P comment 358 670 71 1310730 Subtitles on/off;
#P window setfont "Fixedwidth Serif" 10.;
#P number 764 682 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 682 630 68 1441802 route text;
#P message 764 705 83 1441802 moveto $1 200;
#P newex 723 729 83 1441802 prepend write;
#P newex 682 760 38 1441802 s lcd;
#P newex 682 656 134 1441802 t b s b clear;
#P user textedit 682 600 821 619 98444 22 10 fff;
#P newex 429 644 53 1441802 loadbang;
#P toggle 429 669 15 0;
#P newex 429 693 60 1441802 gate 1 1;
#P newex 227 783 53 1441802 loadbang;
#P message 227 808 53 1441802 border 1;
#P newex 42 572 73 1441802 r alphamask;
#P newex 79 852 73 1441802 s alphamask;
#P user jit.pwindow 180 848 162 122 1 1 0 0 1 0;
#P newex 117 723 53 1441802 loadbang;
#P newex 241 638 140 1441802 jit.op @op !- @val 255;
#P newex 139 600 26 1441802 t b;
#P newex 139 638 79 1441802 jit.pack 4;
#P newex 139 582 102 1441802 jit.unpack 4;
#P newex 74 808 70 1441802 jit.unpack;
#P newex 519 755 27 1441802 b;
#P newex 436 787 68 1441802 delay 1000;
#P newex 489 755 27 1441802 b;
#P newex 489 728 70 1441802 sel 21 40;
#P newex 506 892 38 1441802 s lcd;
#P newex 74 756 38 1441802 r lcd;
#P message 436 811 73 1441802 clear , bang;
#P window linecount 2;
#P message 536 785 192 1441802 clear , moveto 70 200 , write "Can’t
You See I’m Busy?" , bang;
#P message 518 837 174 1441802 clear , moveto 90 200 , write "Leave
Me Alone!" , bang;
#P window linecount 1;
#P newex 139 667 112 1441802 jit.alphablend;
#B color 5;
#P window linecount 2;
#P message 117 744 223 1441802 font times 18 , textface bold , brgb
255 255 255 , frgb 0 0 0 , clear , bang;
#P window linecount 1;
#P newex 74 783 142 1441802 jit.lcd 4 char 320 240;
#B color 5;
#P user jit.pwindow 30 228 322 242 0 1 0 0 1 0;
#P user panel 680 568 170 213;
#X brgb 255 128 255;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 355 665 96 23;
#X brgb 128 255 128;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 9.;
#P message 133 22 33 196617 clear;
#P message 232 22 29 196617 stop;
#P flonum 74 1 35 9 0.5 0.5 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 198 22 33 196617 start;
#P message 167 22 30 196617 read;
#P newex 47 48 105 196617 jit.qt.movie 320 240;
#P toggle 47 1 15 0;
#P newex 47 22 57 196617 qmetro 30;
#P window linecount 10;
#P comment 453 55 79 196617 Press 1 on the switch object to see the
effects of 3 colums. Press 2 on the switch object to see the effects
of 4 columns. Why does 3 not work?;
#P connect 52 0 53 2;
#P connect 52 0 68 0;
#P connect 50 0 53 1;
#P connect 50 0 67 0;
#P connect 3 0 49 0;
#P connect 3 0 51 0;
#P connect 5 0 3 0;
#P connect 4 0 3 0;
#P connect 7 0 3 0;
#P connect 8 0 3 0;
#P connect 1 0 3 0;
#P connect 48 0 25 0;
#P connect 48 0 28 0;
#P connect 48 0 66 0;
#P connect 48 0 59 0;
#P connect 57 0 65 0;
#P connect 57 0 26 0;
#P connect 26 0 62 0;
#P connect 26 0 14 0;
#P connect 25 2 26 2;
#P connect 25 2 64 0;
#P connect 25 1 63 0;
#P connect 25 1 26 1;
#P connect 27 0 57 0;
#P connect 32 0 57 0;
#P connect 28 0 14 1;
#P connect 28 0 61 0;
#P connect 24 1 31 0;
#P connect 24 1 30 0;
#P connect 12 0 24 0;
#P fasten 13 0 12 0 122 778 79 778;
#P connect 18 0 12 0;
#P connect 58 0 35 1;
#P connect 58 0 60 0;
#P connect 2 0 1 0;
#P connect 6 0 1 1;
#P connect 59 0 58 0;
#P connect 44 0 42 0;
#P lcolor 13;
#P connect 39 2 44 0;
#P lcolor 13;
#P connect 39 1 41 0;
#P lcolor 6;
#P connect 39 0 40 0;
#P lcolor 9;
#P fasten 41 0 40 0 728 752 687 752;
#P lcolor 6;
#P fasten 42 0 40 0 769 726 687 726;
#P lcolor 13;
#P fasten 39 3 40 0 810 701 687 701;
#P lcolor 8;
#P connect 43 0 39 0;
#P connect 38 0 43 0;
#P connect 23 1 16 0;
#P fasten 56 0 16 0 93 189 713 189 713 549 671 549 671 771 553 771 553
779 541 779;
#P connect 34 0 33 0;
#P connect 20 1 23 0;
#P fasten 21 1 15 0 511 805 523 805;
#P fasten 17 0 19 0 441 873 511 873;
#P lcolor 4;
#P fasten 15 0 19 0 523 883 511 883;
#P fasten 16 0 19 0 541 829 511 829;
#P fasten 33 0 30 0 232 830 186 830;
#P connect 20 0 21 0;
#P fasten 35 0 20 0 434 719 494 719;
#P connect 22 0 17 0;
#P fasten 21 0 22 0 494 780 441 780;
#P lcolor 4;
#P fasten 23 0 22 0 524 780 441 780;
#P lcolor 4;
#P connect 36 0 35 0;
#P connect 37 0 36 0;
#P connect 29 0 13 0;
#P connect 51 5 52 5;
#P fasten 53 0 48 0 33 192 370 192;
#P connect 51 4 52 4;
#P connect 51 3 52 3;
#P connect 51 2 52 2;
#P connect 51 1 52 1;
#P connect 51 0 52 0;
#P connect 49 8 50 8;
#P connect 25 3 26 3;
#P connect 49 7 50 7;
#P connect 49 6 50 6;
#P connect 49 5 50 5;
#P connect 25 0 27 0;
#P connect 49 4 50 4;
#P connect 49 3 50 3;
#P connect 49 2 50 2;
#P connect 54 0 56 0;
#P connect 55 0 53 0;
#P connect 55 0 56 0;
#P connect 49 1 50 1;
#P connect 49 0 50 0;
#P fasten 14 0 11 0 144 707 36 707;
#P connect 54 0 53 0;
#P window clipboard copycount 69;

wes

PS consider using jit.gl.text2d and jit.gl.videoplane for
overlays…will be much faster.


April 26, 2006 | 10:58 pm

So… we found a bit where Max is broken? Fair enough then I guess. I’d tried using jit.gl.text2d to overlay the text before, but I couldn’t get the video underneath to show through how I’d wanted. I must have missed something obvious. Ah well, back to the drawing board. Thanks for the help.


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