rewire~
MSP Reference
Open Help

rewire~

Host ReWire devices

Description

The rewire~ object allows MSP to function as a ReWire mixer.

Examples

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

Discussion

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. 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

device [symbol]

Optional

Specify a ReWire device

outputs [int]

Optional

Sets 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.

Attributes

Common Box Attributes

annotation [symbol]

Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.

background [int] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 removes it. Objects in the background layer are shown behind all objects in the default foreground layer.

color [4 floats]

Sets the color for the object box outline.

fontface [int]

Sets the type style used by the object. The options are:

plain
bold
italic
bold italic

Possible values:

0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'

fontname [symbol]

Sets the object's font.

fontsize [float]

Sets the object's font size (in points).

Possible values:

'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

hint [symbol]

Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.

ignoreclick [int] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.

presentation [int] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 0. 0. 0. 0.)

Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.

rect [4 floats]

g/s(set)

Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).

size [2 floats]

g/s(set)

Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.

textcolor [float]

Sets the color for the object's text in RGBA format.

textjustification [int]

Text Justification

Possible values:

0 = 'left'
1 = 'center'
2 = 'right'

varname [symbol]

Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.

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

Arguments

start/stop [int]
In left inlet: 1 starts the ReWire transport, 0 stops it. No sound can occur without the transport being started.

anything

Arguments

device [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

Arguments

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

Arguments

start-point [int]
end-point [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 15360 PPQ. The second number sets the loop end position in 15360 PPQ. 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

Arguments

device-output-channel [int]
object-outlet [int]
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

Arguments

time-stamp [int]
MIDI-bus-index [int]
MIDI-message-status-byte [int]
MIDI-message [int]
extended-MIDI-message [int]
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

Arguments

play-position [int]
In left inlet: The word position , followed by a number, sets the current play position (in 15360 PPQ).

stop

In left inlet: Stops the ReWire transport.

tempo

Arguments

bpm [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.

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.

See Also

Name Description
vst~ Host VST and Audio Unit plug-ins