Using MIDI to control Frame skipping of video

Jan 23, 2007 at 7:07pm

Using MIDI to control Frame skipping of video

Hi everyone,

Im creating a live drumming project that will involve (i hope) MIDI note on/off messages triggering video on my mac. my ideal is this:

one key, lets say C3, loads a video. each time it is hit, a new video is loaded.

then each time you hit C4, the video skips on one frame per hit.

i am an absolute novice at Max/jitter, and have been trying out the tutorials but cant seem to find anything relevant to my needs.
normally i would try and gain a greater understanding before posting, as i know novices can be annoying and time wasting, but i was wondering if anyone can help me out?

if anyone might be able to explain how i can do this, or at least point me in the right direction, it would be greatly appreciated.

Regards,

Tim

#29893
Jan 23, 2007 at 9:47pm

Tim,

Since I’m a teacher, I’ll answer you like I would one of my students–with questions that will help you discover the answer. The first question is (depending how you plan to play the movie): how do you advance it by frames? Do you have jitter? If not, you will probably use the movie object. Have you looked into the help file for movie? There is a particular mode of the movie object that is perfect for your application. (It’s there in the help file–look for it). Once you know how to get bangs to advance individual frames, then you should be all set, right? Then all you have to do is to get incoming C4s to bang the frame advance. You’ll probably also want to look at loop modes.

Good luck.

#94242
Jan 23, 2007 at 9:54pm

sorry–I see now that you mentioned using Jitter. With Jitter, you can use jit.qt.movie, but the regular Max movie object works too.

#94243
Jan 24, 2007 at 9:35pm

hello again,

thankyou for the response, im getting the hang of how the program works now, but there are a few things that i cant work out how to do:

firstly, im trying to filter out all midi coming in, except for note on/off values for two keys C3 and C4. i have used a numeric range to limit a “notein” object to note 60, but this value is still passed through, regardless of the note i press (so lots of C4 values are being sent). is there a way of removing all the other keys (note on/off messages)?

on the movie side of things, i see that i can use the “passive” message to control frame the skipping of video, which is great, but i cant seem to open a video in a separate window. i understand you need to insert a “movie” object, which i have done, but how do you tell it what video to play (i tried right click>get info – like with “imovie” but i doesnt work)?

also, i see that a “nextmovie” message will stop the current movie and load the previous, but does this need to be stored anywhere? from reading the reference manual it seems like max works it out for you?

finally, a very dumb one i’m sure, how do you save files? whenever i save and then re-load, i cant edit anything. is this just how it is with the demo?

please help me out!

cheers, tim

#94244
Jan 24, 2007 at 10:09pm

>hello again,
>
>thankyou for the response, im getting the hang of how the program
>works now, but there are a few things that i cant work out how to do:
>
>firstly, im trying to filter out all midi coming in, except for note
>on/off values for two keys C3 and C4. i have used a numeric range to
>limit a “notein” object to note 60, but this value is still passed
>through, regardless of the note i press (so lots of C4 values are
>being sent). is there a way of removing all the other keys (note
>on/off messages)?

For a quick hack take a look at the midiparse object and the route object.
There will be some aid there.

on the floor there’s a long wooden table/on the table there’s an open book/
on the page there’s a detailed drawing/and on the drawing is the name I took
Gregory Taylor http://www.rtqe.net

#94245
Jan 24, 2007 at 10:17pm

Quote: tymmees@hotmail.com wrote on Wed, 24 January 2007 16:35
—————————————————-
firstly, im trying to filter out all midi coming in, except for note on/off values for two keys C3 and C4. i have used a numeric range to limit a “notein” object to note 60, but this value is still passed through, regardless of the note i press (so lots of C4 values are being sent). is there a way of removing all the other keys (note on/off messages)?

Have a look at [select] and [==]…

> on the movie side of things, i see that i can use the “passive” message to control frame the skipping of video, which is great, but i cant seem to open a video in a separate window. i understand you need to insert a “movie” object, which i have done, but how do you tell it what video to play (i tried right click>get info – like with “imovie” but i doesnt work)?

What messages does [movie] accept? (read, start, stop, etc.) Open the movie.help patch and try everything in there. Note that some messages can include an “optional filename argument.”

> also, i see that a “nextmovie” message will stop the current movie and load the previous, but does this need to be stored anywhere? from reading the reference manual it seems like max works it out for you?

Seems so–probably the order that you load them.
>
> finally, a very dumb one i’m sure, how do you save files? whenever i save and then re-load, i cant edit anything. is this just how it is with the demo?
>
Are you putting the patcher window in edit mode (unlocking it)? Read and do the tutorials!

> please help me out!
>
> cheers, tim
>
>
—————————————————-

#94246
Jan 25, 2007 at 2:25am

Hi,

ive now managed to get single midi note on messages coming into MAX and got the video playing. unfortunately i cant seem to get the video to change, or the frame to skip. i have loaded all my videos into into the MAX search path (File preferences) and then opened them all up but when you hit key 48 it doesn’t seem to change the video, using the “nextmovie” message.

i also have the same problem with the “passive 1″ message, in that the signal comes out of the message (i checked with print) but doesn’t stop, and skip, the video frame.

the “loop” message works fine.

here is a screen shot of my patch:

[URL=http://img299.imageshack.us/my.php?image=maxpatch8pn.png][IMG]http://img299.imageshack.us/img299/2410/maxpatch8pn.th.png[/IMG][/URL]

i have looked at the movie help file and seen the “s to_movie_obj” send and receive objects, so i read the tutorial on this but whatever i tried didnt seem to make a difference.

Could you possibly let me know how to patch up this last bit, as i feel like ive found all the right objects/messages but just cant seem to put them together in the right way.

many thanks,

Tim

#94247
Jan 25, 2007 at 2:29am

sorry, doesn’t seem like that URL worked, here we go.

[img]index.php?t=getfile&id=444&private=0[/img]

thanks

#94248
Jan 25, 2007 at 4:15am

First, you don’t want to send the message to turn passive mode on every time the note comes in–you should be able to do that just once, then bang the movie object itself to advance frames.

The problem is, I just tried it the passive mode, and it doesn’t work as advertised in the help file–at least not for me.

Probably a better solution for you using this object is to use the next and prev messages. This could be more flexible because instead of moving by one frame, you can cause the amount to be variable, and move in both directions. That does work. You may have to read up on quicktime a bit to get the most out of this object.

For more flexibility and control you could use jit.qt.movie. But if the Max movie object does what you need, it is a much easier approach for a noob.

If all you need to do is bang a message when the MIDI note number is received, then use select rather than route. Route passes the value, while select just sends out a bang when the value it is looking for comes in.

The nextmovie thing seems also to be buggy. I wonder if this object is screwy because of changes to QT… (Does anyone know about this?) There was a little while ago someone talking about using the poly~ object to load and switch between multiple video files. If you want this to be really solid, you’ll probably need to go with using jitter objects, and trying out poly~ for this might be a good idea too.

The send and receive objects in the movie.help file don’t make any difference–just another way of making connections, especially useful with subpatchers.

One more thing–copy your patch or the relevant part of it to the clipboard (in edit mode, select the objects and cmd- or ctl-C) and paste into the text of your message. That is more effective and accepted by the list than uploading a graphic. It’s also a lot easier!

Sorry about giving advice without double-checking. Since using Jitter, I don’t touch the Max QT objects, so I hadn’t used it in ages. You may find more on the topic by seaching this forum.

Sounds like you’re making progress. Having a project to do is a really great way to learn the program quickly!

#94249
Jan 25, 2007 at 1:01pm

hi there,

i now have the frame skipping working using a jit.qt.movie, and i can change the video (with the mouse) depending on the gate number (see below)

the only thing i cant make work is the number increment.
The select 60 object sends a bang message (according to print) to the increment, and the range of the gate controller is set to 13 (no. of videos).
when you set the gate controller to 1, and hit key 60, it jumps straight up to 13.

putting the print after the gate control number, shows that the number keeps incrementing upwards of 13, so can anyone tell me how to limit the increment? and if possible, how do you make the gate range roll over back to 1 after 13?

had a look through gate tutorials but couldnt see it.

Thanks again

Tim

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 94 340 32 196617 print;
#P message 186 430 117 196617 read “Water Light.mov”;
#P message 173 452 129 196617 read “underground 2.mov”;
#P message 160 471 132 196617 read “under ground 1.mov”;
#P message 147 491 84 196617 read Tunnel.mov;
#P message 95 580 119 196617 read “Radio Masts.mov”;
#P message 69 632 115 196617 read “Oscilator 2.mov”;
#P message 134 514 101 196617 read Oscilators.mov;
#P message 108 556 88 196617 read Kitchen.mov;
#P message 82 604 102 196617 read “Ear Comp.mov”;
#P message 121 534 77 196617 read Brainscan;
#P message 56 655 101 196617 read BellWaves.mov;
#P message 43 676 71 196617 read Bus.mov;
#P number 31 361 35 9 1 13 7 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user incdec 30 331 15 15 0 0;
#P message 30 301 21 196617 inc;
#P newex 30 394 170 196617 gate 13;
#P newex 383 608 142 196617 jit.window bus 5 41 645 520;
#P message 30 700 89 196617 read Bamboo.mov;
#P newex 383 576 105 196617 jit.qt.movie 640 480;
#P window setfont “Sans Serif” 18.;
#P newex 217 216 94 196626 select 48;
#P newex 217 130 91 196626 stripnote;
#P newex 51 210 94 196626 select 60;
#P newex 49 137 89 196626 stripnote;
#P newex 134 56 89 196626 notein;
#P connect 2 0 9 0;
#P connect 2 0 8 1;
#P connect 11 0 8 0;
#P connect 11 0 24 0;
#P connect 9 0 10 0;
#P connect 10 0 11 0;
#P connect 8 0 6 0;
#P connect 8 1 12 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 8 2 13 0;
#P connect 8 3 18 0;
#P connect 8 4 15 0;
#P connect 8 5 19 0;
#P connect 8 6 16 0;
#P connect 8 7 14 0;
#P connect 0 1 1 1;
#P connect 8 8 17 0;
#P connect 8 9 20 0;
#P connect 8 10 21 0;
#P connect 8 11 22 0;
#P connect 8 12 23 0;
#P connect 0 0 3 0;
#P connect 3 0 4 0;
#P connect 0 1 3 1;
#P connect 4 0 5 0;
#P connect 6 0 5 0;
#P connect 20 0 5 0;
#P connect 23 0 5 0;
#P connect 22 0 5 0;
#P connect 21 0 5 0;
#P connect 17 0 5 0;
#P connect 16 0 5 0;
#P connect 19 0 5 0;
#P connect 15 0 5 0;
#P connect 18 0 5 0;
#P connect 13 0 5 0;
#P connect 12 0 5 0;
#P connect 5 0 7 0;
#P window clipboard copycount 25;

#94250
Jan 25, 2007 at 1:03pm

just in case ive done that copy paste thing wrong:

[img]index.php?t=getfile&id=446&private=0[/img]

#94251
Jan 25, 2007 at 2:42pm

One of the things that the lowly beginning tutorials
do, even if imperfectly, is something of an attempt to
concentrate on things that you do all the time. I
would suggest that you have a look at the Max Tutorial
31, bottom of the first page.

#94252

You must be logged in to reply to this topic.