A newer version of Max is available. Click here to access the latest version of this document.

rewire~

Host ReWire devices

Description

The ReWire system connects audio applications together. It allows a program that generates audio (a client) to feed it into a program that plays audio (a mixer).

The rewire~ object requires a properly installed ReWire client to be installed and available. The rewire~ object allows MSP to be a ReWire mixer; there can only be one mixer active at any one time.

You can use several rewire~ objects. Each object is associated with one ReWire client.

rewire~ is intended to be used with other ReWire-compatible software synthesizers. For a list of compatible applications, visit the Propellerheads web site .

ReWire is a trademark of Propellerhead Software AS.

Arguments

Name Type Opt Description
rewire-device-name symbol opt If present, a ReWire device name can be specified. rewire~ will attempt to open the device when the object is initialized.
number-of-audio-outputs int opt Specifies the number of audio outputs the rewire~ object will have. If no argument is present, one audio outlet is created. The maximum number of outlets is 256.

Messages

bang In left inlet: If a ReWire device has been loaded, bang causes a list of its output channel names to be sent out the second-from-right outlet.
int transport-start/stop-flag (0 or 1) [int]
In left inlet: 1 starts the ReWire transport, 0 stops it. No sound can occur without the transport being started.
anything rewire-device-name [list]
In left inlet: The symbol is interpreted as the name of a ReWire device. If the name is valid, rewire~ attempts to switch to the device.
closepanel In left inlet: Closes the current device's user interface panel if it is open.
device device-index [int]
In left inlet: The word device, followed by a number, switches to the ReWire device associated with the number index. The index is obtained as the order in which device names appear in a pop-up menu object connected to the second-to-right outlet.
loadbang Same as bang but the action is performed upon loading the patch within which the rewire~ object is performed.
loop start-point (samples) [int]
end-point (samples) [int]
loop-flag (0 or 1) [int]
In left inlet: The word loop, followed by three numbers, sets the current loop position and mode. The first number sets the loop start position in samples. The second number sets the loop end position in samples. If the third number is 1, looping is turned on. If the third number is 0, looping is turned off. However, note that ReWire clients may ignore looping if they do not produce transport- or time-based output. For example, a software synthesizer that only responds to MIDI note commands would probably not be affected by looping.
map device-output-channel and object-outlet [list]
The word map, followed by two numbers, maps a ReWire device's output channel to an outlet of the rewire~ object. ReWire channels start at 1 with a maximum of 256. rewire~ object outlets are specified starting at 1 for the left outlet, or 0 to turn the ReWire channel off. For example, map 3 2 causes the ReWire device's audio output channel 3 to be mapped to the second-from-left outlet of the rewire~ object. You can find out the names of the ReWire audio output channels with the bang message after the rewire~ object has a connection to a ReWire device. By default, audio outlets map to the first channels of the ReWire device; in other words, the leftmost signal outlet outputs the first channel of the device.
midi time-stamp MIDI-bus-index MIDI-message-status-byte and MIDI-message-data-bytes [list]
In left inlet: The word midi, followed by four or five numbers, sends a MIDI event to a ReWire device. The first number is a time stamp value and is currently ignored (in other words, the event is sent out immediately). The second number is the MIDI bus index. ReWire 2 has 256 MIDI busses, indexed from 0 to 255. The third number is the MIDI message status byte, and the fourth and fifth numbers are the MIDI message data bytes.
openpanel In left inlet: If the current device has a user interface panel, the word openpanel will open it.
play In left inlet: Starts the ReWire transport.
position play-position (samples) [int]
In left inlet: The word position, followed by a number, sets the current play position (in samples).
stop In left inlet: Stops the ReWire transport.
tempo beats-per-minute [float]
In left inlet: The word tempo, followed by a number, sets the tempo to that number in beats per minute. ReWire handles integer or floating-point valude for tempos, and tempo is updated on the next call to the client to return audio samples.

Information for box attributes common to all objects

Output

MIDI: Out third-from-right outlet: MIDI events received from the ReWire device are sent out this outlet preceded by the word midi. The first argument is always 0 (it is the time stamp), the second argument is the ReWire MIDI bus index, the third argument is the MIDI status byte, and the fourth and (optional) fifth arguments are the MIDI data bytes.
signal: Out audio outlets (starting at left): The audio signal output from the ReWire device is sent out the rewire~ object's outlets. By default, the leftmost outlet outputs the first channel of the device, but this mapping can be changed with the map message.
symbol: Out fourth-from-right outlet: Messages indicating the transport state of the ReWire device. The position message with an int argument reports the transport position in 15360 PPQ. The play and stop messages report when the transport is started and stopped.
symbol: Out second-from-right outlet: A list of the currently available ReWire devices in response to the bang message.
symbol: Out right outlet: A list of the currently available device output names (in channel order) for the currently used ReWire device.

Examples

rewire~ allows MIDI communication to and signal output from ReWire compatible devices

See Also

Name Description
vst~ Host VST plug-ins