Max supports ReWire, a software protocol developed by Propellerheads that allows data transfer and remote
control among audio software applications. In addition to being able to route audio between Max and ReWire
compatible applications, ReWire supports sending synchronization, transport, and tempo information both
to and from Max and the host application.
You can use Max as a ReWire client and route audio from Max into another application (such as
Ableton Live or Digital Performer) using ad_rewire, a special audio driver.
You can also use Max as a
ReWire mixer using the
rewire~ object and route audio to Max from
other applications.
You cannot use both the ad_rewire audio driver and the
rewire~ object simultaneously; When you try to
use them at the same time, you won’t get any audio output because each is waiting for the other: the ad_rewire
driver is waiting for the rewire~ object to ask it for an audio stream, but the rewire~ object can't do
anything unless given processing time by an audio driver.
You can also use the ad_rewire driver when creating
standalone applications.
To use Max as a ReWire client and route audio to another application the Max ad_rewire driver is used.
-
Choose DSP Status from the Options menu to show the DSP Status window. Click in the Value column
for the Driver setting and choose ad_rewire from the Driver pop-up window. The ReWire driver will
be selected, and you will see Max/MSP listed as a ReWire device the next time you launch your host application.
With ad_rewire selected as the audio driver for Max, there are three MSP objects you can use to provide
this information and to control the host’s transport:
-
The hostcontrol~ object allows you to send commands to the ReWire host to start and stop
the transport, set the transport position, change the tempo, change the time signature, and set loop points.
-
The hostphasor~ object will output a beat-synchronized ramp (like the phasor~ object)
when the host's transport is playing,. You can use this ramp output to drive your synthesizer in a
beat-synchronous fashion or to trigger events on the beat.
-
The hostcontrol~ object allows you to send commands to the ReWire host to start and stop
the transport, set the transport position, change the tempo, change the time signature, and set loop points.
-
If you have not already done so, enable the ad_rewire driver as described above.
-
Start the application you want to send Max audio output to.
-
Create a channel in the host application to accept input from Max/MSP
-
Open your Max patch and turn on the DSP
The
rewire~ object is used when Max is used as a
ReWire host, routing audio from other host applications to Max.
The
rewire~ object allows you to select a ReWire client, use the available audio outputs, send and receive MIDI messages and
control the connected device’s transport controls.
-
Add a rewire~ object to your Max patch, connect the second outlet from the right to a umenu object, and add a second
connection from the middle outlet of the umenu object to the rewire~ object. You will also need to add a button or
loadbang object to send a bang message to the rewire~ object to populate the menu.
-
Close the patch and click on the button. The umenu will be automatically populated with a listing of all available ReWire
clients which can send audio to Max. Click on the umenu and select the client you want from the pop-up menu. You will see the message
rewire~: opened device XXX in the Max window.
-
Connect the rightmost outlet of the rewire~ object in your Max patch to each of a pair of umenu and message box objects
which are connected back to the rewire~ object.
-
Close the patch and click on the button. The umenu objects will be automatically populated with a listing of all the ReWire audio outputs
from the client application. Click on both umenu objects and select the clients you want from the pop-up menu.
-
Clicking on a umenu selection will send the message map 1|2 <client output> to the rewire~ object,
routing the audio from the client application to the rewire~ object’s audio outlets for use in your Max patch.
In addition to routing audio from other applications through Max, the
rewire~ object also
lets you control the transport mechanism of any client application to which it is connected, and
to send and receive MIDI messages. See the rewire~ help file and the
rewire~ object Reference page
for more information.
Rewire 2 also supports MIDI communication to and from ReWire Devices. Currently both the
rewire~ object and the ad_rewire~ driver support MIDI, although they work in different ways.
When you use the ad_rewire driver, Max MIDI ports are automatically created so you can use
the standard Max MIDI objects to send and receive MIDI. After you choose the ad_rewire
driver in the DSP Status Window, MIDI ports will appear in the MIDI Setup window the next
time it is opened.
By default, the ad_rewire driver has two MIDI input channels and two MIDI output channels available for your use.
-
If you have not already done so, enable the ad_rewire driver as described above. Add a
midiin object to your Max patch and Command-double-click (Macintosh) or Alt-double-click
(Windows) on the midiin object to show the MIDI sources pop-up menu. The ReWire MIDI ports
will be shown and you can choose them.
You can use the same procedure to set up an output port using the
midiout object.
-
Choose DSP Status from the Options menu to show the DSP Status window. Double-click
in the Value column for the Input Channels or Output Channels setting in the DSP Status
window to get a text cursor, Type in the number of input or output channels you want followed by a
carriage return. The new values will appear in the Value column, and the new number of MIDI input
or output channels will be available via Max MIDI objects.
When you use Max as a ReWire host using the
rewire~ object, MIDI messages are automatically
sent and received using the
rewire~ object—it includes a dedicated outlet for MIDI messages,
and you can use the
midi message to the
rewire~ object to send MIDI data to the ReWire
clients. For more information about the format that the
rewire~ object understands, see the
rewire~ object
Help file
or
the rewire~ object Reference page.