jit.movie

Using audio to trigger the display of a frame of video

One way to make video respond to audio in Max, is to detect some significant event in an MSP audio signal, and use that to trigger something in Jitter. This patch demonstrates one case of that. It uses an event in an audio stream to trigger the display of a frame of a movie. Every time the phasor~ jumps down to 0, a bang is sent to the jit.qt.movie causing it to display the current frame of the movie loaded into it.

Alpha masking

A video matrix, such as comes out of jit.movie, has four planes of data, representing alpha, red, green, and blue. The alpha channel contains information about the opacity of the other three planes—a factor that can be used when mixing/compositing with another image. Normally the values in the alpha channel are all set to 1., meaning full opacity. However, if some values in the alpha channel are 0., the image will be transparent in those pixels, allowing another image to show through.

Switching Video

You can switch between multiple videos without starting from the beginning of each clip after each every switch by acquiring the time the clip was stopped as the next starting point. 

Crossfade to new location in a video

To jump immediately to a new location in a movie, you can send the frame message to jit.movie (or jit.qt.movie). To crossfade to a new location, instead of a jump cut, you need to be playing the video twice, and crossfade from the current video to the second video, after which you can stop playing the first video. To do that again, you can just reverse the process: start the first video at the new location, crossfade back to the first video, and stop playing the second one.

Crossfade video and audio

You can make a crossfade between two videos or betwen two sounds by multiplying the amplitude of one of them by values going progressively from 1 to 0 while you multiply the other by values going progressively from 0 to 1. In this example, we use a slider object that outputs values from 0 to 1 to control the volume of two movie soundtracks, using the vol attribute of jit.qt.movie (or jit.movie).