<?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="mtr" module="max" category="Sequencing">
	<digest>
		Record and sequence messages
	</digest>
	<description>
		Records messages and provides sequenced playback.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			MIDI
		</metadata>
		<metadata name="reference">
			TEXT_HERE
		</metadata>
		<metadata name="license">
			TEXT_HERE
		</metadata>
		<metadata name="tag">
			Sequencing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				Control Input for All Tracks
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
				Track 1 Record/Control Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				next Outputs list with Track and Duration
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				Track 1 Play Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="tracks" optional="1" type="int">
			<digest>
				Number of tracks
			</digest>
			<description>
				Specifies the number of tracks in the <o>mtr</o>. The number of tracks determines the number of inlets and outlets in addition to the leftmost inlet and outlet. Up to 32 tracks are possible. If there is no argument, there will be only one track.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				Store the message on a track
			</digest>
			<description>
				In any inlet other than the left inlet: If the track is currently being recorded, numbers received in that track's inlet are combined with a delta time (the number of milliseconds elapsed since the previous event) and stored in <o>mtr</o>.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Store the message on a track
			</digest>
			<description>
				In any inlet other than the left inlet: If the track is currently being recorded, numbers received in that track's inlet are combined with a delta time (the number of milliseconds elapsed since the previous event) and stored in <o>mtr</o>.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Store the message on a track
			</digest>
			<description>
				In any inlet other than the left inlet: If the track is currently being recorded, lists received in that track's inlet are stored in <o>mtr</o>, preceded by the delta time.
			</description>
		</method>
		<method name="anything">
			<arglist>
				<arg name="input" optional="0" type="list" />
			</arglist>
			<digest>
				Store the message on a track
			</digest>
			<description>
				In any inlet other than the left inlet: If the track is currently being recorded, symbols received in that track's inlet are stored in <o>mtr</o>, preceded by the delta time.
				<br />
				<br />
				Although <o>mtr</o> can record individual bytes of MIDI messages received from <o>midiin</o>, it stores each byte with a separate delta time, and does not format the MIDI messages the way <o>seq</o> does. If you want to record complete MIDI messages and edit them later, <o>seq</o> is better suited for the task. On the other hand, <o>mtr</o> is perfectly suited for recording sequences of numbers, lists, or symbols from virtually any object in Max: specialized MIDI objects such as <o>notein</o> or <o>pgmin</o>, user interface objects such as <link name="number" type="refpage">number box</link>, <o>slider</o>, and <o>dial</o>, or any other object.
				<br />
				<br />
				In order for a file to be read into <o>mtr</o> for playback, it must be in the proper format. An <o>mtr</o> multi-track sequence can even be typed in a text file, provided it adheres to the format. The contents of the different tracks are listed in order in an <o>mtr</o> file, and the format of each track is as follows. Note that a semicolon (<m>;</m>) ends each line.
				<br />
				<br />
				Line 1: <m>track &lt;track number&gt;;</m> (Track in which to store subsequent data)
				<br />
				Line 2, etc.: <m>&lt;delta time&gt; &lt;message&gt;;
					<br />
</m> Last line: <m>end;</m> (End of this track's data)
			</description>
		</method>
		<method name="clear">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Clear the contents of tracks
			</digest>
			<description>
				In left inlet: Erases the contents of <o>mtr</o>. The word <m>clear</m>, followed by one or more track numbers, clears those tracks.
				<br />
				<br />
				In other inlets: Erases the track that corresponds to the inlet.
			</description>
		</method>
		<method name="delay">
			<arglist>
				<arg name="delay-time" optional="0" units="ms" type="int" />
			</arglist>
			<digest>
				Set an initial delta time value
			</digest>
			<description>
				In left inlet: The word <m>delay</m>, followed by a number of milliseconds, sets the first delta time value of each track to that number, so that all tracks begin playing back that amount of time after the <m>play</m> message is received.
				<br />
				<br />
				In other inlets: Sets the initial delta time of the track that corresponds to the inlet.
			</description>
		</method>
		<method name="first">
			<arglist>
				<arg name="wait-time" optional="0" units="ms" type="int" />
			</arglist>
			<digest>
				Set playback wait time
			</digest>
			<description>
				In left inlet: The word <m>first</m>, followed by a number of milliseconds, causes <o>mtr</o> to wait that amount of time after a <m>play</m> message is received before playing back. Unlike <m>delay</m>, <m>first</m> does not alter the delta time value of the first event in a track, it just waits a certain time (in addition to the first delta time) before playing back from the beginning.
			</description>
		</method>
		<method name="next">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Output the next message
			</digest>
			<description>
				In left inlet: Causes each track to output only the next message in its recorded sequence. When a <m>next</m> message is received, the track number and the delta time of each message being output are sent out the leftmost outlet as a list. The word <m>next</m>, followed by one or more track numbers, outputs the next message stored in those tracks.
				<br />
				<br />
				In other inlets: Outputs the next message stored on the track that corresponds to the inlet.
			</description>
		</method>
		<method name="mute">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Mute output
			</digest>
			<description>
				In left inlet: Causes <o>mtr</o> to stop producing output, while still continuing to &quot;play&quot; (still moving forward in the sequence). The word <m>mute</m>, followed by one or more tracks, mutes those tracks.
				<br />
				<br />
				In other inlets: Mutes the track that corresponds to the inlet.
			</description>
		</method>
		<method name="play">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Play back messages at their normal rate
			</digest>
			<description>
				In left inlet: Plays back all messages recorded earlier, sending them out the corresponding outlets in the same rhythm and at the same speed they were recorded. The word <m>play</m>, followed by one or more track numbers, begins playing those tracks.
				<br />
				<br />
				In other inlets: Plays back all messages on the track that corresponds to the inlet.
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="filename" optional="0" type="symbol" />
			</arglist>
			<digest>
				Load a saved <o>mtr</o> file
			</digest>
			<description>
				In left inlet: Calls up the standard Open Document dialog box, so that a previously saved file can be read into <o>mtr</o>.				<br />
				<br />
				In other inlets: Opens a file containing only the track that corresponds to the inlet.
			</description>
		</method>
		<method name="record">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Start recording
			</digest>
			<description>
				In left inlet: Begins recording all messages received in the other inlets. The word <m>record</m>, followed by one or more track numbers, begins recording those tracks.
				<br />
				In other inlets: Begins recording messages on the track that corresponds to the inlet.
			</description>
		</method>
		<method name="rewind">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Return to the start of the sequence/track
			</digest>
			<description>
				In left inlet: Resets <o>mtr</o> to the beginning of its recorded sequence. This command is used to return to the beginning of the sequence when stepping through messages with <m>next</m>. To return to the beginning of a sequence while playing or recording, just repeat the <m>play</m> or <m>record</m> message. When <o>mtr</o> is playing or recording, a <m>stop</m> message should precede a <m>rewind</m> message. The word <m>rewind</m>, followed by one or more track numbers, returns to the beginning of those tracks.
				<br />
				<br />
				In other inlets: Returns the pointer to the beginning of the track that corresponds to the inlet.
			</description>
		</method>
		<method name="stop">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Stop recording or playback
			</digest>
			<description>
				In left inlet: Stops <o>mtr</o> when it is recording or playing. The word <m>stop</m>, followed by one or more track numbers, stops those tracks.
				<br />
				<br />
				In other inlets: Stops the track that corresponds to the inlet.
			</description>
		</method>
		<method name="unmute">
			<arglist>
				<arg name="tracks" optional="0" type="list" />
			</arglist>
			<digest>
				Unmute output
			</digest>
			<description>
				In left inlet: Undoes any previously received <m>mute</m> messages. The word <m>unmute</m>, followed by one or more track numbers, unmutes those tracks.
				<br />
				<br />
				In other inlets: Unmutes the track that corresponds to the inlet.
			</description>
		</method>
		<method name="write">
			<arglist>
				<arg name="filename" optional="0" type="symbol" />
			</arglist>
			<digest>
				Write the sequence to disk
			</digest>
			<description>
				In left inlet: Calls up the standard Save As dialog box, allowing the contents of <o>mtr</o> to be saved as a separate file. Note that the only way to save the contents of <o>mtr</o> is with the <m>write</m> message; the object's contents cannot be embedded in a patcher file.
				<br />
				<br />
				In other inlets: Writes a file containing only the track that corresponds to the inlet.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="mtr.png" caption="Record MIDI data or other events" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="multislider" />
		<seealso name="seq" />
		<seealso name="rslider" />
		<seealso name="slider" />
	</seealsolist>
	<discussion>
		<o>mtr</o> acts as a multi-track recorder for any kind of message. The leftmost inlet of <o>mtr</o> is a control inlet for all tracks. You can send the same messages to individual tracks as well. Each track records what comes into its inlet, and plays it back through the outlet directly below the inlet.
	</discussion>
	<misc name="Output">
		<entry name="anything">
			<description>
				Out all track outlets: When a <m>play</m> message is received in the leftmost inlet, the messages stored in each track are sent out the outlet of that track, in the same rhythm and at the same speed they were recorded. A <m>play</m> message received in the inlet of an individual track plays that particular track.
				<br />
				<br />
				When a <m>next</m> message is received in the leftmost inlet, the next message in each track is sent out its corresponding outlet. The word <m>next</m>, received in the inlet of an individual track, sends out the next message in that track.
			</description>
		</entry>
		<entry name="list">
			<description>
				Out left outlet: Whenever a value is sent out in response to a <m>next</m> message, the track number and delta time of that value are sent out the left outlet as a two-item list.
			</description>
		</entry>
	</misc>
</c74object>
