Jitter

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.

Attributes example

Most Jitter objects have internal states, known as attributes, and you can get and set their values. The list of messages on the right hand side of the example are a few of the attributes of a jit.qt.movie object. When you click on one of the attribute-getting messages, its value is reported from the right outlet of jit.qt.movie.

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.

Store matrices in a text file

To store an array of integers, you will usually use the table object. To store an array of floating point values, you can use the buffer~ object. Although the buffer~ object is normally used for storing audio data, it can easily be used simply as an array of floats, accessed by the peek~ object, which works even when MSP audio is not on.