<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<?xml-stylesheet href="./_c74_ref.xsl" type="text/xsl"?>

<!--This is an automatically generated file. DO NOT EDIT THIS FILE DIRECTLY. Rather, use the _ref.xml files found in the 'edits' folder.-->
<c74object name="rewire~" module="msp" category="MSP I/O">
	<digest>
		Host ReWire devices
	</digest>
	<description>
		The <o>rewire~</o> object allows MSP to function as a ReWire mixer.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP I/O
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Control and MIDI Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Control and MIDI Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Audio Output 1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="signal">
			<digest>
				(signal) Audio Output 2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="2" type="signal">
			<digest>
				Transport Messages
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="3" type="signal">
			<digest>
				MIDI Events from Synth
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="4" type="signal">
			<digest>
				Menu of Installed ReWire Devices
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="5" type="signal">
			<digest>
				Menu of Outputs for Current Device
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="device" optional="1" type="symbol">
			<digest>
				ReWire device name
			</digest>
			<description>
				Specify a ReWire device
			</description>
		</objarg>
		<objarg name="outputs" optional="1" type="int">
			<digest>
				Number of audio output channels
			</digest>
			<description>
				Sets the number of audio outputs the <o>rewire~</o> object will have. If no argument is present, one audio outlet is created. The maximum number of outlets is 256.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Output information about ReWire device channel names
			</digest>
			<description>
				In left inlet: If a ReWire device has been loaded, <m>bang</m> causes a list of its output channel names to be sent out the second-from-right outlet.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="start/stop" optional="0" type="int" />
			</arglist>
			<digest>
				Stops/start the ReWire transport
			</digest>
			<description>
				In left inlet: <m>1</m> starts the ReWire transport, <m>0</m> stops it. No sound can occur without the transport being started.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="device" optional="0" type="list" />
			</arglist>
			<digest>
				In left inlet: The symbol is interpreted as the name of a ReWire device
			</digest>
			<description>
				In left inlet: The symbol is interpreted as the name of a ReWire device. If the name is valid, <o>rewire~</o> attempts to switch to the device.
			</description>
		</method>
		<method name="closepanel">
			<arglist />
			<digest>
				Open the current user interface panel
			</digest>
			<description>
				In left inlet: Closes the current device's user interface panel if it is open.
			</description>
		</method>
		<method name="device">
			<arglist>
				<arg name="device-index" optional="0" type="int" />
			</arglist>
			<digest>
				Switch to a ReWire device associated with a number index
			</digest>
			<description>
				In left inlet: The word <m>device</m>, 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.
			</description>
		</method>
		<method name="loadbang">
			<arglist />
			<digest>
				Same as <m>bang</m> but the action is performed upon loading the patch within which the <o>rewire~</o> object is performed
			</digest>
			<description>
				Same as <m>bang</m> but the action is performed upon loading the patch within which the <o>rewire~</o> object is performed.
			</description>
		</method>
		<method name="loop">
			<arglist>
				<arg name="start-point" optional="0" units="15360 PPQ" type="int" />
				<arg name="end-point" optional="0" units="15360 PPQ" type="int" />
				<arg name="loop-flag (0 or 1)" optional="0" type="int" />
			</arglist>
			<digest>
				Set the loop position and mode
			</digest>
			<description>
				In left inlet: The word <m>loop</m>, 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.
			</description>
		</method>
		<method name="map">
			<arglist>
				<arg name="device-output-channel" optional="0" type="int" />
				<arg name="object-outlet" optional="0" type="int" />
			</arglist>
			<digest>
				Map a ReWire output channel to a <o>rewire~</o> object outlet
			</digest>
			<description>
				The word <m>map</m>, followed by two numbers, maps a ReWire device's output channel to an outlet of the <o>rewire~</o> object. ReWire channels start at 1 with a maximum of 256. <o>rewire~</o> object outlets are specified starting at 1 for the left outlet, or 0 to turn the ReWire channel off. For example, <m>map 3 2</m> causes the ReWire device's audio output channel 3 to be mapped to the second-from-left outlet of the <o>rewire~</o> object. You can find out the names of the ReWire audio output channels with the <m>bang</m> message after the <o>rewire~</o> 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.
			</description>
		</method>
		<method name="midi">
			<arglist>
				<arg name="time-stamp" optional="0" type="int" />
				<arg name="MIDI-bus-index" optional="0" type="int" />
				<arg name="MIDI-message-status-byte" optional="0" type="int" />
				<arg name="MIDI-message" optional="0" type="int" />
				<arg name="extended-MIDI-message" optional="1" type="int" />
			</arglist>
			<digest>
				Send a MIDI event to a ReWire device
			</digest>
			<description>
				In left inlet: The word <m>midi</m>, 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.
			</description>
		</method>
		<method name="openpanel">
			<arglist />
			<digest>
				Open a user interface panel
			</digest>
			<description>
				In left inlet: If the current device has a user interface panel, the word <m>openpanel</m> will open it.
			</description>
		</method>
		<method name="play">
			<arglist />
			<digest>
				Start the ReWire transport
			</digest>
			<description>
				In left inlet: Starts the ReWire transport.
			</description>
		</method>
		<method name="position">
			<arglist>
				<arg name="play-position" optional="0" units="15360 PPQ" type="int" />
			</arglist>
			<digest>
				Set the play position
			</digest>
			<description>
				In left inlet: The word <m>position</m>, followed by a number, sets the current play position (in 15360 PPQ).
			</description>
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stop the ReWire transport
			</digest>
			<description>
				In left inlet: Stops the ReWire transport.
			</description>
		</method>
		<method name="tempo">
			<arglist>
				<arg name="bpm" optional="0" type="float" />
			</arglist>
			<digest>
				Set the tempo in beats per minute
			</digest>
			<description>
				In left inlet: The word <m>tempo</m>, 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.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="rewire~.png" caption="rewire~ allows MIDI communication to and signal output from ReWire compatible devices" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="vst~" />
	</seealsolist>
	<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).
		<br />
		<br />
		The <o>rewire~</o> object requires a properly installed ReWire client to be installed and available. There can only be one mixer active at any one time.
		<br />
		<br />
		You can use several <o>rewire~</o> objects. Each object is associated with one ReWire client.
		<br />
		<br />
		<o>rewire~</o> is intended to be used with other ReWire-compatible software synthesizers. For a list of compatible applications, visit the
		<a href="http://www.propellerheads.se">
			Propellerheads web site
		</a>
		<br />
		<br />
		ReWire is a trademark of Propellerhead Software AS.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				Out audio outlets (starting at left): The audio signal output from the ReWire device is sent out the <o>rewire~</o> 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.
			</description>
		</entry>
		<entry name="symbol">
			<description>
				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.
			</description>
		</entry>
		<entry name="MIDI">
			<description>
				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.
			</description>
		</entry>
		<entry name="symbol">
			<description>
				Out second-from-right outlet: A list of the currently available ReWire devices in response to the bang message.
			</description>
		</entry>
		<entry name="symbol">
			<description>
				Out right outlet: A list of the currently available device output names (in channel order) for the currently used ReWire device.
			</description>
		</entry>
	</misc>
</c74object>
