This tutorial shows how to copy an MSP audio signal into a Jitter matrix using an object called jit.poke~
. Along the way, we'll investigate how to use the soundtrack from a QuickTime movie in the MSP signal network using the sound output component attribute of the jit.qt.movie
object and a new MSP object called spigot~
This tutorial assumes familiarity with routing MSP signals using send~
. It also uses a simple delay network using tapin~
objects. Tutorial 4
and Tutorial 27
in the MSP
manual cover these topics.
object at the top left of the tutorial patch reads a QuickTime movie called rca.mov
• Start the metro
object at the top of the patch by clicking the toggle
box. You will see an image in the lefthand jit.pwindow
object below the jit.qt.movie
object. You won't see anything in the other jit.pwindow
objects yet, nor will you hear any sound.
object has two attributes set in its object box in addition to its attribute ( by cells). The attribute with a value of tells the jit.qt.movie
object to loop the movie as a palindrome
. Once the playback of the movie reaches the end, it will play backwards to the beginning of the file, rather than looping around to the beginning and playing forward (the default behavior, when the attribute is set to ). If you watch the movie, you'll see that the arm manipulating the oscillator control moves up and then down again in an endless loop. The movie actually only contains footage of the arm moving upward, but the attribute we've used reverses the playback in the second half of the loop.
The second attribute we've set in our jit.qt.movie
object sets the Sound Output Component
( ) for that instance of the jit.qt.movie
object. The name specified as an argument to the attribute (in this case ) specifies a new sound output component that MSP can use to acquire the soundtrack of the movie loaded into the jit.qt.movie
object. By default, the attribute is set to , which routes the movie's audio output directly to the Sound Manager. A named attribute routes the audio to a spigot~
object with the same name as the component, allowing you to access the audio signal in MSP:
object in the upper-right hand corner of the tutorial patch has an argument ( ) which matches the attribute of our jit.qt.movie
object. If a movie file loaded into that jit.qt.movie
object has a soundtrack (which the rca.mov
file conveniently does), the audio from the movie is sent out as MSP signals from the spigot~
. Note that the spigot~
object has two outlets, which correspond to the left and right audio channels of the movie soundtrack. Our rca.mov
file has a monaural soundtrack, so we only need to use one of the outlets in our patch.
Important: The jit.qt.movie
object allows you to create a separate sound output component for each jit.qt.movie
object in your patch. You can use as many spigot~
objects as you like, each with a unique name, to grab the audio from multiple QuickTime movies. It's important to note, however, that you can only have one spigot~
object per sound output component, and each jit.qt.movie
object must have a unique attribute (unless, of course, the is set to —the Sound Manager can take the sound from as many movies as you wish). Once you have multiple movie audio tracks as MSP signals you can mix them as you please.
attribute of the
• Start the dac~
object at the bottom of the patch by clicking the toggle
box attached to it. You will see images appear in the remaining jit.pwindow
objects and will see a signal level appear in the meter~
object attached to the spigot~
. If you turn up the gain~
slider attached to the dac~
, you should begin to hear sound out of whatever device you currently have selected as your MSP audio driver. For more information on how to setup your computer's audio system with MSP, consult the Audio I/O Chapter
in the MSP
Receiving the audio signal from the spigot~
The soundtrack from the rca.mov
file is sent as an MSP signal from the spigot~
object into a two-tap delay line (generated by the tapin~
objects in the patch). The dry audio signal is sent to a send~
object with the name attached to it; the two delay taps are sent to send~
objects named and , respectively. The three audio signals are output by named receive~
objects and summed into the gain~
object at the bottom of the patch, allowing you to hear all of them at once.
• Adjust the delay times using the number
box objects labeled Delay times (green/blue)
attached to the tapout~
objects. You can adjust the delays up to a maximum length of milliseconds (the maximum delay time allocated by our tapin~
The righthand jit.pwindow
object at the top of the tutorial patch shows the output of a jit.matrix
named , which also gets messages from the metro
object at the top of the patch:
objects at the right of the tutorial patch, which write MSP audio signals into cells in the matrix. These cells, when displayed in the jit.pwindow
object, portray an oscilloscope view of the movie soundtrack, with the dry and two delayed signals appearing as the colors , , and , respectively.
Jitter matrix is generated by three
The three jit.poke~ objects, writing into the scope matrix
The three similar regions at the right of the screen use the jit.poke~
object to write MSP signal data into our matrix. The jit.poke~
object takes three arguments: the of the Jitter matrix to write into, the number of inlets to use, and the of the destination matrix to write numbers to. All three jit.poke~
objects in our patch write into the matrix . Since is a 2-dimensional matrix, we need inlets to specify where to write the data (one inlet for the column and one inlet for the row). The three objects differ in that they each write to a different of the matrix.
The first inlet of the jit.poke~
object provides the value to write into the matrix cell specified by the other two inlets, which take signals to specify the cell location. We use a sig~
object with a value of to write a constant value into our current position in the scope matrix. The value of gets interpreted as when writing into a matrix containing char
data (which is what we're doing in this case).
The other two inlets in our jit.poke~
objects determine where in the output matrix they should write data (this set of coordinates defines the write pointer
for the object—you could think of this as the location of the record head, only with two dimensions instead of one). The rightmost inlet receives the audio signal from our named receive~
objects and sets the vertical ( ) coordinate of the write pointer to correspond to the amplitude of the signal. The *~
objects in the patch scale the output of the audio signal from between and (the typical range for an audio signal) to between and (the range of the vertical dimension of our output matrix).
The middle inlet to our jit.poke~
object receives a sync
signal that specifies where along the horizontal axis of the matrix we write the current amplitude from the audio signal. This signal is unrelated to the audio data coming from the movie—you could think of it as the horizontal refresh rate of the virtual oscilloscope we've made in this patch. The sync signal is generated by a phasor~
object in the middle of the tutorial patch:
Generating the horizontal sync signal for our jit.poke~
object generates a repeating ramp signal from to (nearly) . The *~
below it rescales this signal to generate values appropriate to the width of our matrix ( to ). This signal is then passed to a send~
object with the name , which forwards the signal to receive~
objects connected to the middle inlets of our jit.poke~
objects. The frequency of the phasor~
(specified by the number box connected to its first inlet) determines the rate at which our jit.poke~
objects scan from the left to right through the matrix.
• Try changing the frequency of the phasor~
by changing the number box labeled Horizontal scan rate (Hz)
. Notice how at higher frequencies you can see the waveform generated by the movie audio in more detail. If you set the rate to a negative value, the matrix will be written backwards (i.e. from right to left).
The dry audio signal and the two delayed outputs are visualized as the three visible planes of our jit.poke~
objects overlap, different color combinations will appear in the output matrix.
matrix ( , , and , or , , and ). When the cells written by the
Now that we understand how the matrix is being written, we need to look into how the matrix clears itself every time a horizontal scan is completed. The relevant parts of the patch are shown below:
Detect when the horizontal sync resets and clear the matrix
object outputs a value of when the ramp generated by the phasor~
object is on the increase. When the phasor~
snaps back to at the end of the ramp, change~
will briefly output a value of . The ==~
operator, which outputs a when the change~
does, will output a at that point. When the phasor~
begins to ramp again, the ==~
will output a , triggering a from the edge~
object (which detects a zero to non-zero transition in the last signal vector). The is then sent to a receive
object named , which triggers a message to the jit.matrix
object. As a result, our matrix is cleared every time the phasor~
restarts its ramp.
Our two Jitter matrices (the image from the jit.qt.movie
object and the oscilloscope drawn by our jit.poke~
objects) are composited into a final matrix by the jit.op
Compositing the two matrices using jit.op
object is . As a result, our composite is made from the multiplication of the two matrices. Since most of the cells in our matrix are (black), you only see the movie image appear in those cells and planes where the jit.poke~
objects have traced the waveform.
attribute we've specified initially for our
• Change the jit.op
object by clicking on some of the message
boxes attached to the prepend
object to the right of the jit.pwindow
showing the matrix. Notice how the different arithmetic operators change the compositing operation of the two matrices.
attribute of the
object lets you define a named Sound Output Component
. The spigot~
object lets you access the soundtrack of a QuickTime movie as an MSP signal by giving it an argument that matches the attribute of the jit.qt.movie
object playing the movie.
attribute of the
You can use the jit.poke~
object to write data from MSP signals into a named Jitter matrix. The jit.poke~
object takes arguments in the form of the of the matrix to write to, the number of inlets with which to specify cell coordinates, and the to write to in the matrix. The first inlet of jit.poke~
takes the value to be written into the matrix. Subsequent inlets take MSP signals that specify the cell location in the matrix in which data should be written.