<?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="seq" module="max" category="Sequencing">
	<digest>
		Sequencer for recording and playing MIDI data
	</digest>
	<description>
		<o>seq</o> is a sequencer of raw MIDI bytes. You can control the speed of playback (only at the time you start it), read and write from files, and record from live MIDI input. See also <o>midiparse</o> and <o>midiformat</o> which you may need to get to and from raw MIDI.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			Max
		</metadata>
		<metadata name="tag">
			Sequencing
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="INLET_TYPE">
			<digest>
				MIDI Data In, Many Other Messages
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="INLET_TYPE">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="OUTLET_TYPE">
			<digest>
				MIDI Data Out When Playing
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
		<outlet id="1" type="OUTLET_TYPE">
			<digest>
				bang When Sequence Done
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="filename" optional="1" type="symbol">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				Specifies the name of a file to be read into <o>seq</o> automatically when the patch is loaded.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Starts playing the sequence stored in <o>seq</o>.
			</digest>
			<description>
				Starts playing the sequence stored in <o>seq</o>.
			</description>
		</method>
		<method name="int">
			<arglist>
				<arg name="input" optional="0" type="int" />
			</arglist>
			<digest>
				When <o>seq</o> is recording, numbers received in its inlet are interpreted as bytes of MIDI messages (usually from <o>midiformat</o> or <o>midiin</o>).
			</digest>
			<description>
				When <o>seq</o> is recording, numbers received in its inlet are interpreted as bytes of MIDI messages (usually from <o>midiformat</o> or <o>midiin</o>). MIDI channel messages and system exclusive messages can be recorded by <o>seq</o>, but <o>seq</o> does not respond directly to MIDI real time messages such as start, stop, MIDI clock, etc.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="input" optional="0" type="float" />
			</arglist>
			<digest>
				Converted to <m>int</m>.
			</digest>
			<description>
				Converted to <m>int</m>.
			</description>
		</method>
		<method name="append">
			<arglist />
			<digest>
				Starts recording at the end of the stored sequence, without erasing the existing sequence.
			</digest>
			<description>
				Starts recording at the end of the stored sequence, without erasing the existing sequence.
			</description>
		</method>
		<method name="delay">
			<arglist>
				<arg name="onset-time (milliseconds)" optional="0" type="int" />
			</arglist>
			<digest>
				The word <m>delay</m>, followed by a number, sets the onset time, in milliseconds, of the first event in the recorded sequence.
			</digest>
			<description>
				The word <m>delay</m>, followed by a number, sets the onset time, in milliseconds, of the first event in the recorded sequence. All events in the sequence are shifted so that the first event occurs at the specified onset time.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="dump">
			<arglist />
			<digest>
				Opens a standard Open Document dialog box, to select a saved sequence or standard MIDI file.
			</digest>
			<description>
				Opens a standard Open Document dialog box, to select a saved sequence or standard MIDI file. The selected file is opened as text in a new Untitled text window, which can be edited and saved.
			</description>
		</method>
		<method name="hook">
			<arglist>
				<arg name="event-time-multiplier" optional="0" type="float" />
			</arglist>
			<digest>
				The word <m>hook</m>, followed by a float, multiplies all the event times in the stored sequence by that number.
			</digest>
			<description>
				The word <m>hook</m>, followed by a float, multiplies all the event times in the stored sequence by that number. For example, if the number is 2.0, all event times will be doubled, and the sequence will play back twice as slowly. Multiplications can even be performed while the sequence is playing.
			</description>
		</method>
		<method name="print">
			<arglist />
			<digest>
				Prints the first sixteen events of the recorded sequence in the Max Console.
			</digest>
			<description>
				Prints the first sixteen events of the recorded sequence in the Max Console.
			</description>
		</method>
		<method name="start">
			<arglist>
				<arg name="tempo-multiplier" optional="0" type="int" />
			</arglist>
			<digest>
				The word <m>start</m> by itself has the same effect as <m>bang</m>.
			</digest>
			<description>
				The word <m>start</m> by itself has the same effect as <m>bang</m>. The word <m>start</m>, followed by a number, plays the stored sequence at a tempo determined by the number. The message <m>start 1024</m> indicates normal tempo. If the number is <m>512</m>, <o>seq</o> plays the sequence at half the original recorded speed, <m>start 2048</m> plays it back at twice the original speed, and so on.
				<br />
				<br />
				The message <m>start -1</m> starts the sequencer, but rather than follow Max's millisecond clock, <o>seq</o> waits for a <m>tick</m> message to advance its clock. See the <m>tick</m> message.
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="filename" optional="0" type="symbol" />
			</arglist>
			<digest>
				With no arguments, <m>read</m> calls up the standard Open Document dialog box, so that a previously recorded sequence can be read into <o>seq</o>, replacing the current sequence. With a symbol as an argument, <m>read</m> searches for a file with the specified name to read into the <o>seq</o> object.
				<br />
				<br />
				Note: The <o>seq</o> object reads and writes both single track (format 0) and multi-track (format 1) standard MIDI files.
			</digest>
			<description>
				With no arguments, <m>read</m> calls up the standard Open Document dialog box, so that a previously recorded sequence can be read into <o>seq</o>, replacing the current sequence. With a symbol as an argument, <m>read</m> searches for a file with the specified name to read into the <o>seq</o> object.
				<br />
				<br />
				Note: The <o>seq</o> object reads and writes both single track (format 0) and multi-track (format 1) standard MIDI files. It can also read and write text files in which each line consists of a start time in milliseconds (the time elapsed since the beginning of the sequence) followed by the (space-separated) bytes of a MIDI message recorded at that start time. For example,
				<br />
				<br />
				<br />
				<br />
				0 144 60 112;
				<br />
				<br />
				1000 144 60 0;
				<br />
				<br />
				1500 192 31;
				<br />
				<br />
				1500 144 60 112;
				<br />
				<br />
				2500 144 60 0;
				<br />
				<br />
				plays the note middle C on channel 1 for one second, then half a second later changes to program number 31 and plays middle C again for one second.
			</description>
		</method>
		<method name="tick">
			<arglist />
			<digest>
				After <o>seq</o> has received a <m>start -1</m> message, it waits for <m>tick</m> messages to advance its clock. In order to play the sequence at its original recorded tempo, <o>seq</o> must receive 48 <m>tick</m> messages per second. This is equivalent to 24 <m>tick</m> s per quarter note (the standard for a MIDI Clock message)
			</digest>
			<description>
				After <o>seq</o> has received a <m>start -1</m> message, it waits for <m>tick</m> messages to advance its clock. In order to play the sequence at its original recorded tempo, <o>seq</o> must receive 48 <m>tick</m> messages per second. This is equivalent to 24 <m>tick</m> s per quarter note (the standard for a MIDI Clock message) at a tempo of 120MM. By using <m>tick</m> messages to advance the sequencer, you can vary the tempo of playback or synchronize <o>seq</o> with another timing source (such as incoming MIDI Clock messages).
			</description>
		</method>
		<method name="stop">
			<arglist />
			<digest>
				Stops the sequencer if it is recording or playing.
			</digest>
			<description>
				Stops the sequencer if it is recording or playing. A <m>stop</m> message need not be received when switching directly from playing to recording, or vice-versa.
			</description>
		</method>
		<method name="record">
			<arglist />
			<digest>
				Starts recording MIDI messages received in the inlet.
			</digest>
			<description>
				Starts recording MIDI messages received in the inlet.
			</description>
		</method>
		<method name="write">
			<arglist>
				<arg name="filename" optional="1" type="symbol" />
				<arg name="format" optional="1" type="int" />
			</arglist>
			<digest>
				Calls up the standard Save As dialog box, so that a recorded sequence can be saved as a separate file.
			</digest>
			<description>
				Calls up the standard Save As dialog box, so that a recorded sequence can be saved as a separate file. If you want to edit the sequence with the text editor, check the Save As Text option in the dialog box. With a symbol as an argument, <m>write</m> will write a file with the specified name. A non-zero int argument (as a single argument, or following a filename argument) will cause the <o>seq</o> object to write a multi-track standard MIDI file (format 1).
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="seq.png" caption="Record and play back live performance, or play a pre-recorded sequence" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="coll" />
		<seealso name="follow" />
		<seealso name="mtr" />
		<seealso name="midichapter04" module="max" type="tutorial" />
	</seealsolist>
	<misc name="Output">
		<entry name="int">
			<description>
				Out left outlet: When <m>bang</m> or <m>start</m> is received in the inlet, the sequence stored in <o>seq</o> is sent out the outlet in the form of individual MIDI bytes, usually to be sent to <o>midiparse</o> or <o>midiout</o>.
			</description>
		</entry>
		<entry name="bang">
			<description>
				Out right outlet: Indicates that <o>seq</o> has finished playing the current sequence. (The <m>bang</m> is sent out immediately before the final event of the sequence is played.)
			</description>
		</entry>
	</misc>
</c74object>
