Max can interface with other applications via ReWire. Max can act as either a ReWire host or a ReWire client. Max can be a client to an open host application just by choosing "ad_rewire" as the MSP audio driver in the DSP Status window. Alternatively, you can use Max as the host (mixer) application by including the rewire~ object in your program.
This patch shows a simple way to control the balance between two sounds, and also illustrates the relationship between a) mixing two sounds to one location and b) panning one sound to two locations.
The left part of this example shows the use of the random object to make arbitrary note choices. Every time random receives a bang in its inlet, it sends out a randomly chosen number from 0 to one less than its argument. In this case it chooses one of 61 possible key numbers, sending out a number from 0 to 60. We then use a + object to offset that value by 36 semitones, transposing up three octaves to the range 36 to 96––cello low C to flute high C.
This patch shows examples of linear mapping and linear interpolation, using the lmap abstraction described in the “Linear mapping equation” example. One could substitute the built-in Max object scale in place of lmap with the same results.
This shows a simple way to play a QuickTime movie using Jitter. When the jit.qt.movie object receives a read message, it opens a dialog box allowing you to select a movie file. As soon as you select a movie and click OK, jit.qt.movie begins to retrieve frames of video from that file and place them in memory, at the frames-per-second rate specified in the movie file itself.
There are many objects available for delaying events (i.e., for scheduling events to happen at a specific future moment). For timing and scheduling events, the most common object is the metro object (send bang periodically at a specified time interval), which can be used to trigger events, start/stop entire processes, or trigger a counter to step through a table or a coll or any sort of sequence of things.
Here are three ways of generating MIDI notes. Admittedly they don't result in very interesting music, but they show ways how numbers can be converted for usage as pitch information.
The metro (metronome) object is the most obvious way to trigger repeated events in Max. Repetition is, of course, a key component of most music (and most time-based art in general), and the metro object encapsulates the whole low-level process of a) cause something to happen, b) schedule the same thing to happen at some future time and repeat the process. The only thing it needs to "know" is what time interval to use for its repetitions.
One of the most intriguing features of the transport object is that there can be multiple independent transports in action at the same time. If a transport object has not had its name attribute set, it refers to the one global transport. However, you can create an independent transport by giving the transport object a name (i.e., by setting its name attribute to some name of your choice).
The timepoint object sends out a bang when the transport reaches a specified time position. This can be useful for causing something to happen—or for starting an entire process—at a particular instant during the transport's progress. A timepoint might, for example, even trigger a new time position value to be sent to the transport object itself, thus causing the transport to leap to a different time.