Forums > Jitter

toggles within a video?

June 17, 2006 | 6:54 pm

Does anyone know if there is a way to put buttons and number boxes within a movie? I’m working on a project where the video is manipulated by a midi keyboard and I would like to show values and toggles from the patch within the movie image. Is there a way to make a patch of all the toggles and numbers I’d like to display and then put those into a jit.window so I could overlay it with the jit.window showing the movie? That was one Idea I had.


June 17, 2006 | 7:07 pm

How about mapping your MIDI keyboard to some 3d shapes in opengl and
using jit.gl.videoplane to superimpose it with you video.

wes


June 17, 2006 | 7:24 pm

There is also a jit.desktop object, it allows to get OSX desktop in a
window.

Derrick


June 17, 2006 | 7:54 pm

Hi, I don’t really know how to use the open gl stuff yet. I was hoping to just keep it simple, with some number boxes, toggles and knobs. Someone mentioned using jit.desktop…I’m looking into that, but I feel like there has got to be a way to make a window, either graphics or patcher window with a line of toggles and knobs and then combine that window with my jit window. I am really stumped and jit. desktop looks a little clunky with lots of chances for the wrong info to be displayed because it depends on what is in the desktop. Thanks for you help since I’m kind of a newbie.
sean


June 17, 2006 | 8:04 pm

You will need to do this with either OpenGL (see the JavaScript based
jitter-gui-sliderexample.pat) or jit.lcd. jit.window and jit.pwindow
report mouse activity which you would use to issue the necessary draw
commands to overlay your video with whatever you like.

-Joshua


June 17, 2006 | 8:47 pm

Hi Joshua,
I checked out that open GL stuff. Unfortuneately, I don’t know anything about javascript yet. I don’t think the lcd object will work for me because I’m not trying to use the mouse. All I want to do for example is have a toggle button on top of my video so that when I go full screen, I press a program change button on my keyboard and the toggle I have overlayed in the video shows that action. I will also do this with knobs. I’m looking at the jit.pwindow, but I don’t see how to put toggles or knobs in that window.

Thanks for your help on this.
sean


June 17, 2006 | 9:45 pm

You can’t put UI elements from the patcher into the pwindow etc. like
you’re trying to do. Instead, you have to make your own graphical
elements in the context using the shape drawing commands that jit.lcd
or opengl provide. I would suggest you stop trying to follow a
deadend path of putting the max numberbox or toggle etc. in a pwindow
and take this opportunity to expand your knowledge and learn how to
use jit.lcd or opengl to do what you want. If you don;t want
interaction and just want to show some kind of indication as to what
the state of the params your keyboard is controlling are then it’s
going to be very very easy. Why do you want to show those things
anyway? Why not do something a bit more expressive with shape and
color?

Anyway, just my $0.02. Take it how you will.

best,
wes


June 17, 2006 | 10:09 pm

Hey, I totally aggree with you. It seems as though I’m following a deadend. I am looking into the open GL and lcd object and some sort of xfade. I just don’t think I will be able to figure it out by the time my show is. The reason I’m trying to do this is that the keyboard is going to be the interactive part of the patch. I’d just like the user to see the values they are getting when they turn a knob, but I might have to eliminate that part of the patch for now. Of course I want to learn the open GL and javascript, I just think it’s a little over my head and my deadline is fast approaching. I appreciate all your feedback and will put these on the list things to learn in max.

thanks,
sean


June 17, 2006 | 10:22 pm

You can do something very very simple with sketch and text2d. This is
super crude, so I’ll leave it to you to make it look nice.

wes

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 191 224 148 196617 position -1 0 0 , text $1 , draw;
#P number 191 200 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 344 223 143 196617 position 0 0 0 , text $1 , draw;
#P newex 101 199 30 196617 t b b;
#P newex 38 181 48 196617 t b draw;
#P number 344 199 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 226 256 301 196617 jit.gl.text2d keyb @color 1 1 0 1
@depth_enable 0 @automatic 0;
#P message 68 293 337 196617 reset , gltranslate -1 0 0 , plane 0.2
0.1 , gltranslate 1 0 0 , plane 0.2 0.1;
#P newex 68 325 152 196617 jit.gl.sketch keyb @automatic 0;
#P toggle 128 59 15 0;
#P message 128 79 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont "Sans Serif" 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 128 39 33 196617 p Esc;
#P newex 26 57 48 196617 loadbang;
#P newex 128 97 154 196617 jit.window keyb @depthbuffer 1;
#P message 89 97 34 196617 reset;
#P newex 89 118 189 196617 jit.gl.handle keyb @inherit_transform 1;
#P toggle 26 78 15 0;
#P newex 26 97 57 196617 qmetro 60;
#P newex 26 118 58 196617 t b b erase;
#P newex 26 151 160 196617 jit.gl.render keyb @camera 0 0 3;
#P connect 16 0 18 0;
#P connect 16 1 14 0;
#P connect 17 0 13 0;
#P connect 19 0 13 0;
#P connect 18 0 19 0;
#P connect 14 0 17 0;
#P connect 15 0 16 0;
#P connect 1 1 15 0;
#P connect 15 1 11 0;
#P connect 12 0 11 0;
#P connect 1 2 0 0;
#P connect 2 0 1 0;
#P fasten 1 0 0 0 31 139 31 139;
#P fasten 4 0 0 0 94 144 31 144;
#P connect 5 0 4 0;
#P connect 9 0 6 0;
#P connect 10 0 9 0;
#P connect 8 0 10 0;
#P connect 3 0 2 0;
#P connect 7 0 3 0;
#P window clipboard copycount 20;


June 17, 2006 | 10:52 pm

thanks, I’ll try this when I understand javascript.
sean


June 17, 2006 | 11:10 pm

that’s not javascript. copy it and paste it into a patch window.


June 17, 2006 | 11:24 pm

ahhh…
thanks, shows what I know.

Sean


June 18, 2006 | 6:23 pm

seems like wesley’s suggestion/patch is a way to go, but you might want to
consider this ugly jit.pwindow hack:

#P window setfont Geneva 9.;
#P window linecount 1;
#N vpatcher 25 70 625 470;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 50 95 189 9961481 jit.op @op >=p @val 149;
#P newex 50 72 180 9961481 jit.slide @slide_up 40. @slide_down 50.;
#P newex 50 50 116 9961481 jit.noise 1 char 320 240;
#P inlet 50 30 15 0;
#P inlet 249 26 15 0;
#P outlet 50 117 15 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 0 0;
#P connect 1 0 5 1;
#P pop;
#P newobj 23 139 67 9961481 p some image;
#N vpatcher 499 97 1142 488;
#P window setfont Geneva 9.;
#P window linecount 1;
#P hidden newex 261 304 96 9961481 scale 0 255 35 107;
#P user kslider 53 252 35 1 36 72 19 7 0 128 128 128 128 128 128 255 255 255
0 0 0 0 0 0;
#P window linecount 3;
#P user com 370 235 43 9961481 10;
#K set 0 26729 25701 8302 28526 11637 26912 28514 27237 25460 29440;
#K end;
#P user com 370 192 100 9961481 19;
#K set 0 24946 29281 28263 25888 31087 30066 8309 26912 25964 25965 25966
29811 8303 30309 29216 28791 26990 25711 30523;
#K end;
#P window linecount 1;
#P comment 111 171 42 9961481 toggle;
#P user com 370 174 209 9961481 20;
#K set 0 29807 8301 24939 25888 29800 26995 8307 30050 28769 29795 26656
30569 28260 28535 8294 30060 27763 25458 25957 28160;
#K end;
#P window linecount 2;
#P user com 370 147 182 9961481 21;
#K set 0 29541 28260 8294 30060 27763 25458 25957 28192 12576 28005 29555
24935 25888 29807 8308 26729 29552 24948 25448 25970 11264;
#K end;
#P window linecount 1;
#P message 367 276 66 9961481 fullscreen $1;
#P window linecount 3;
#P user com 370 102 98 9961481 23;
#K set 0 29285 29545 31333 8308 26729 29472 28791 26990 25711 30496 29807
8294 26996 8313 28533 29216 25701 29547 29807 28704 29545 31333 15104;
#K end;
#P window linecount 1;
#N thispatcher;
#Q end;
#P newobj 367 295 58 9961481 thispatcher;
#P comment 110 158 42 9961481 screen;
#P window setfont Geneva 18.;
#P number 153 149 83 18 0 0 0 152 0 0 0 221 221 221 222 222 222 0 0 0;
#P user dial 67 144 40 40 255 1 0 0 159 270 1 1. 170 170 170 221 221 221 120
120 120 225 225 225 0 0 0 0 0 0;
#P hidden inlet 397 12 15 0;
#P hidden inlet 37 13 15 0;
#P hidden outlet 37 311 15 0;
#P window setfont Geneva 9.;
#P comment 117 146 28 9961481 full;
#P toggle 108 145 39 0;
#P user jit.pwindow 36 52 322 242 0 1 0 0 1 0;
#P window linecount 4;
#P user com 370 53 113 9961481 31;
#K set 0 28015 30309 8308 26729 29472 28791 26990 25711 30496 29807 8309
28784 25970 11628 25958 29728 25455 29294 25970 8303 26144 29557 25200 24948
25448 25970 8311 26990 25711 30523 3338;
#K end;
#P hidden connect 5 0 1 0;
#P hidden connect 1 0 4 0;
#P hidden connect 19 0 18 0;
#P hidden connect 6 0 7 0;
#P hidden connect 6 0 8 0;
#P hidden connect 7 0 19 0;
#P connect 2 0 12 0;
#P connect 12 0 10 0;
#P pop 1;
#P newobj 23 169 89 9961481 p pwindow&ui;
#N vpatcher 25 70 293 256;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 50 73 180 9961481 jit.slide @slide_up 20. @slide_down 50.;
#P newex 50 97 36 9961481 jit.spill;
#P newex 50 50 83 9961481 jit.noise 1 char 1;
#P inlet 50 30 15 0;
#P outlet 50 119 15 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P pop;
#P newobj 47 86 53 9961481 p jit.drunk;
#P user jit.fpsgui 23 197 60 9961481 0;
#P newex 262 65 69 9961481 loadmess 149;
#P user dial 262 111 22 22 255 1 0 0 159 270 1 1. 170 170 170 221 221 221
120 120 120 225 225 225 0 0 0 0 0 0;
#P toggle 23 38 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 23 60 50 9109513 qmetro 5;
#P connect 2 0 7 1;
#P connect 2 0 6 1;
#P connect 0 0 7 0;
#P connect 0 0 5 0;
#P connect 7 0 6 0;
#P connect 6 0 4 0;
#P connect 5 0 2 0;
#P connect 3 0 2 0;
#P connect 1 0 0 0;
#P window clipboard copycount 8;


June 19, 2006 | 12:10 pm

Nothing wrong with that!
Why not put UI elements on top of jit.pwindows? Isn’t that the whole
point of a pwindow (in-patcher-window)? That’s why there’s a
layering in max ("bring-to-front", "send-to-back").
Sometimes there’s no need to reinvent the wheel and reprogram your
life away writing custom button classes and objects in opengl.


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