Using MIDI to control Frame skipping of video
Jan 23, 2007 at 7:07pm
Using MIDI to control Frame skipping of video
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.
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.
Jan 23, 2007 at 9:47pm
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.
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.
Jan 24, 2007 at 9:35pm
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!
Jan 24, 2007 at 10:09pm
For a quick hack take a look at the midiparse object and the route object.
Jan 24, 2007 at 10:17pm
Quote: firstname.lastname@example.org wrote on Wed, 24 January 2007 16:35
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.
> please help me out!
Jan 25, 2007 at 2:25am
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:
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.
Jan 25, 2007 at 2:29am
sorry, doesn’t seem like that URL worked, here we go.
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!
Jan 25, 2007 at 1:01pm
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.
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.
#P window setfont “Sans Serif” 9.;
Jan 25, 2007 at 1:03pm
just in case ive done that copy paste thing wrong:
Jan 25, 2007 at 2:42pm
One of the things that the lowly beginning tutorials
You must be logged in to reply to this topic.