<?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="mc.pattern~" module="" category="">
	<digest>
		Signal Pattern Sequencer and Recorder
	</digest>
	<description>
		The <o>mc.pattern~</o> object holds patterns -- sequences of signal values. Like <o>seq~</o>, playback is driven by a phasor, but unlike <o>seq~</o>, the output consists of signals on one or more audio channels. In addition to event recording, <o>mc.pattern~</o> has an interface for generating events from Max messages or via algorithms.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MC
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="multi-channel signal">
			<digest>
				Input Phasor(s)
			</digest>
			<description>
				<o>mc.pattern~</o> is driven by one or more phasor ramps in its audio input. If the <at>individual</at> attribute is enabled, <o>mc.pattern~</o> expects a multi-channel signal in which each channel has a phasor that plays the corresponding channel in the object's multi=-channel output. If <at>individual</at> is disabled, a single phasor ramp signal plays all patterns together.
			</description>
		</inlet>
		<inlet id="1" type="multi-channel signal">
			<digest>
				Input Phasor(s)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="multi-channel signal">
			<digest>
				Pattern(s)
			</digest>
			<description>
				Multi-channel signal with each channel's pattern output
			</description>
		</outlet>
		<outlet id="1" type="multi-channel signal">
			<digest>
				Pattern Data in Response to getcontent Message
			</digest>
			<description>
				A dictionary containing the current contents of the object
			</description>
		</outlet>
		<outlet id="2" type="dictionary">
			<digest>
				Pattern Data in Response to getcontent Message
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="channels" type="int" optional="0">
			<digest>
				Channels
			</digest>
			<description>
				If present, a typed-in argument sets the number of channels of patterns the object contains. This can also be set via the <at>chans</at> attribute.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				Add values to a channel in autorecord mode
			</digest>
			<description>
				Converted to <m>float</m> 
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="ARG_NAME_0" type="float" optional="0" />
			</arglist>
			<digest>
				Add values to a channel in autorecord mode
			</digest>
			<description>
				When audio is on, recording is active via the <m>autorecord</m> message, incoming numbers are recorded to the current channel being auto-recorded. All recorded values is added to any existing data on a channel. If you want to record values to a specific channel, use the <m>list</m> message.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add values to a channel when recording
			</digest>
			<description>
				When audio is on, a <m>list</m> message of two items will cause the second item in the list to be recorded to the channel specified by the first item in the list if recording has been enabled for the channel. For example, the message <m>1 0.4</m> would record the value 0.4 to channel 1 if recording is enabled for channel 1.
			</description>
		</method>
		<method name="add">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add a value to a channel
			</digest>
			<description>
				The <m>add</m> message adds one value to a channel. It accepts three required arguments. The first is the channel where the value should be added. If the channel is 0, the value will be added to all channels. The second argument is the time (between 0 and 1) where the value should be added to the pattern. The third argument is the value. The <m>add</m> message workds whether or audio on or off. Likewise, recording does not have to be on for channels(s) where you are adding the value.
			</description>
		</method>
		<method name="addrange">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add a range of values to a channel
			</digest>
			<description>
				The <m>addrange</m> message adds a range of values to a channel. It accepts a minium of four required arguments. The first is the channel where the values should be added. If the channel is 0, the values will be added to all channels. The second argument is the number of values to be added. If there are four arguments, the third argument specifies the low value of the range to be added and the fourth argument specified the high value of the range to be added. In this case, the values are added within the space of the entire pattern (between 0 and 1). If there are six arguments, the third and fourth specify the time range and the fifth and sixth argument specify the value range. The time range must be specified from low to high and the two values cannot be equal. Example: <m>addrange 1 5 10 20</m> will add the following values to channel 1: 0 10, 0.2 12.5, 0.4 15, 0.6 17.5 0.8 20. Note that the <m>addrange</m> message does not use the entire space of time you specify. If you want to fill the entire time space, use <m>addrangeinclusive</m>.
			</description>
		</method>
		<method name="addrangeinclusive">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add a range of values to a channel
			</digest>
			<description>
				The <m>addrangeinclusive</m> message adds a range of values to a channel. It functions identically to the <m>addrange</m> message with the exception that it fills the space of time with the range of values. This is only advisable when the time range is explicitly specified; in other words, if you try to fill the time range of 0 to 1, you will end up with one fewer event than you specify because the last event at 1 will overwrite the first event at 0, since 0 and 1 represent the same time. Example: <m>addrange 1 5 0.2 0.4 10 20</m> will add the following values to channel 1: 0.2 10, 0.25 12.5, 0.3 15, 0.35 17.5, 0.4 20.
			</description>
		</method>
		<method name="clear">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Clear values from a channel
			</digest>
			<description>
				The word <m>clear</m> with no arguments, removes all values from all channels. When followed by a channel number, <m>clear</m> removes all values from a single channel.
			</description>
		</method>
		<method name="delete">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Remove a value at a specific time
			</digest>
			<description>
				The word <m>delete</m> followed by a channel number and time, removes any value associated with the time on the specified channel number. Example: if a value of 50 was previously added to channel 1 via <m>add 1 0.5 50</m>, sending <m>delete 1 0.5</m> will remove it.
			</description>
		</method>
		<method name="deleterange">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Remove values within a time range
			</digest>
			<description>
				The word <m>deleterange</m> followed by a channel number and two numbers specifying a time range, removes all values that fall within that time range.
			</description>
		</method>
		<method name="dictionary">
			<arglist>
				<arg name="ARG_NAME_0" type="symbol" optional="0" />
			</arglist>
			<digest>
				Set pattern data
			</digest>
			<description>
				Use the <m>dictionary</m> message to set one or more channels with new data. You can see the required format of the dictionary by sending the <m>getcontent</m> message, which sends a dictionary containing the current state of <o>mc.pattern~</o> out the right outlet. Unlike reading in a new an using the <m>read</m> message, the <m>dictionary</m> message will only clear the existing pattern from channels in the dictionary with new content. This permits you to create a dictionary that only modifies one channel, leaving the others untouched.
			</description>
		</method>
		<method name="dump">
			<arglist />
			<digest>
				Display the contents in the Max console
			</digest>
			<description>
				The <m>dump</m> message prints all times and values for all channels in the Max console.
			</description>
		</method>
		<method name="filldeviate">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add randomly generated values to all channels
			</digest>
			<description>
				The <m>filldeviate</m> message adds values to all channels. It takes three or four arguments. When <m>filldeviate</m> has three arguments, the first argument is the time location for the values, the second argument is the center value for the generated values, and the third argument is the amount of deviation from the center value. When <m>filldeviate</m> has four arguments, the first argument is the center time location, the second argument is the amount of deviation from the center time, the third argument is the center value, and the fourth argument is the value deviation. Example: <m>filldeviate 0.5 2 1</m> for a four-channel <o>mc.pattern~</o> could generate the following: Channel 1 -- 0.5 1.7, Channel 2 -- 0.5 2.1, Channel 3 -- 0.5 2.9, and Channel 4 -- 0.5 1.8.
			</description>
		</method>
		<method name="fillrange">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Add ranges of values to all channels
			</digest>
			<description>
				The <m>fillrange</m> message adds a range of increasing or decreasing values to all channels. It accepts two, three or four arguments. When <m>fillrange</m> has two arguments, the first argument is the time location for the values, the second argument is the value. The value is added to all channels at the specified time.
				<br />
				When <m>fillrange</m> has three arguments, the first argument is a time and the second and third arguments specify a range. Starting at the value specified by the second argument, <m>fillrange</m> adds a value to all channels incrementing or decrementing until the last channel has a value equal to the third argument. If <m>fillrange</m> has four arguments, the first two arguments are a range of times and the second two arguments are a range of values. Example: <m>fillrange 0.25 0.75 1 4</m> for a four-channel <o>mc.pattern~</o> will genreate the following: Channel 1 -- 0.5 1, Channel 2 -- 0.375 2, Channel 3 -- 0.5 3, Channel 4 -- 0.625 4.
			</description>
		</method>
		<method name="getcontent">
			<arglist />
			<digest>
				Output a dictionary with pattern data
			</digest>
			<description>
				The <m>getcontent</m> message sends a dictionary containing the current pattern data out the right outlet.
			</description>
		</method>
		<method name="mute">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Mute the output of one or more channels
			</digest>
			<description>
				If the <m>mute</m> message has one argument, all channels are muted if the value is non-zero and unmuted if the value is zero. If the <m>mute</m> message has two arguments, the first argument specifies a channel number to mute and the second argument is the muting state. Note that <m>mute</m> is the only way the <o>mc.pattern</o> object provides to disable output of one or more channels; there is no play / pause control. To pause playback, set the frequency of the input <o>phasor~</o> to zero.
			</description>
		</method>
		<method name="quantize">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Set recording quantization
			</digest>
			<description>
				The <m>quantize</m> message sets a value for record quantization for one or more channels. If <m>quantize</m> has one argument, it sets the record quantization for all channels. If <m>quantize</m> has two arguments, the first argument specifies the channel number and the second sets the quantization value. Quantization values should be less than or equal to 1; when the quantization value is non-zero, recorded values are shifted in time so that their time is a multiple of the quantization value. Record quantization has no effect on values added to a channel via the <m>add</m> or <m>fill</m> messages.
			</description>
		</method>
		<method name="ramp">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Enable or disable output ramps between values
			</digest>
			<description>
				The <m>ramp</m> message accepts one or two arguments. If <m>ramp</m> has one argument, it sets the use of linear output ramps for all channels. If <m>ramp</m> has two arguments, the first argument specifies the channel number and the second enables or disables playback ramps. When ramps are disabled, the output signal remains constant after a value is output. Then the output signal jumps to the new value. When ramps are enabled, <o>mc.pattern~</o> outputs a linear ramp from the previous value to the current value. Ramping at the beginning and end of a pattern is affected by the wrap state of a channel (see the <m>wrap</m> below).
			</description>
		</method>
		<method name="read">
			<arglist>
				<arg name="ARG_NAME_0" type="symbol" optional="0" />
			</arglist>
			<digest>
				Read pattern data from a file
			</digest>
			<description>
				The <m>read</m> message accepts an optional filename argument. If no filename is present, a standard open dialog is shown. <o>mc.pattern~</o> accepts files in JSON format produced by the <m>write</m> message.
			</description>
		</method>
		<method name="record">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Start or stop recording values
			</digest>
			<description>
				The <m>record</m> message accepts one or two arguments. When there is one argument, it starts (non-zero) or stops (recording). When there are two arguments, the first argument sets the channel number and the second starts (if non-zero) or stops (if zero) recording on that channel. Note that the times given to recorded values are relative to the current phasor input value, not the time you started recording.
			</description>
		</method>
		<method name="setvalue">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Direct a message at a channel
			</digest>
			<description>
				The <m>setvalue</m> message provides an alternative syntax for directing messages at specific channels, or all channels. The format of the message is <m>setvalue</m> followed by a channel number followed by a message to send to that channel. The messages that can follow <m>setvalue</m> are <m>add</m>, <m>clear</m>, <m>delete</m>, <m>deleterange</m>, <m>float</m>, <m>int</m>, <m>list</m>, <m>quantize</m>, <m>ramp</m>, <m>record</m>, and <m>wrap</m>. When using these messages, omit the channel number since it goes after the word <m>setvalue</m>. For example, if you want to delete an event on channel 2 at time 0.5, you can use <m>setvalue 2 delete 0.5</m>.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Input phasor(s)
			</digest>
			<description>
				The <o>mc.pattern~</o> object's pattern playback can be driven by one or more phasor ramps in its audio input. If the <at>individual</at> attribute is enabled, <o>mc.pattern~</o> expects a multi-channel signal in which each channel has a phasor that plays the corresponding channel in the object's multi=-channel output. If <at>individual</at> is disabled, a single phasor ramp signal plays all patterns together.
			</description>
		</method>
		<method name="wrap">
			<arglist>
				<arg name="ARG_NAME_0" type="list" optional="0" />
			</arglist>
			<digest>
				Enable or disable value wrapping
			</digest>
			<description>
				The <m>wrap</m> message accepts one or two arguments. If <m>wrap</m> has one argument, it sets the use of output wrapping. If <m>wrap</m> has two arguments, the first argument specifies the channel number and the second enables or disables output wrapping. When wrapping is disabled, the output value is set to zero at the beginning of the pattern (when the input phasor resets). When wrapping is enabled, the initial output value is the last value before the end of the pattern.
			</description>
		</method>
		<method name="write">
			<arglist>
				<arg name="ARG_NAME_0" type="symbol" optional="0" />
			</arglist>
			<digest>
				Write pattern data to a file
			</digest>
			<description>
				The <m>write</m> message accepts an optional filename argument specifying where to write a file. If no filename is present, a standard save file dialog is shown. <o>mc.pattern~</o> writes files in JSON format corresponding to the dictionary output by the <m>getcontent</m> message.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="autorecord" get="1" set="1" type="int" size="1">
			<digest>
				Autorecord
			</digest>
			<description>
				Set <at>autorecord</at> to 1, and <o>mc.pattern~</o> begins recording incoming numbers received in its inlet to successive channels starting with channel 1. Once each channel has reached the end (because the incoming phasor signal resets to 0), recording switches to the next channel. When recording has occurred once on all channels, autorecord switches itself off. To turn off autorecord before the automatic shutoff occurs, send the message <m>autorecord 0</m>. Autorecord is the only way <m>int</m> and <m>float</m> values can be recorded. Channel-specific recording (via the <m>record</m> message) requires a <m>list</m> consisting of a channel and value. Note that the times given to recorded values are relative to the current phasor input value, not the time you started recording.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Autorecord" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="chans" get="1" set="1" type="int" size="1">
			<digest>
				Output Channels
			</digest>
			<description>
				Sets the number of channels storing patterns as well as number of signals in the multi-channel signal. If the <at>chans</at> attribute is set while the audio is on, the change does not take effect until the audio is restarted.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Output Channels" />
			</attributelist>
		</attribute>
		<attribute name="defaultmute" get="1" set="1" type="int" size="1">
			<digest>
				Initial Mute Setting
			</digest>
			<description>
				Sets a default mute setting for all channels as a typed-in argument. After the object has been created, changing <at>defaultmute</at> has no effect. The default value of <at>defaultmute</at> is muting off.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Initial Mute Setting" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="defaultquantize" get="1" set="1" type="float" size="1">
			<digest>
				Initial Record Quantization
			</digest>
			<description>
				Sets a default record quantization setting for all channels as a typed-in argument. After the object has been created, changing <at>defaultquantize</at> has no effect. The default value of <at>defaultquantize</at> is 0.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="0." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Initial Record Quantization" />
			</attributelist>
		</attribute>
		<attribute name="defaultramp" get="1" set="1" type="int" size="1">
			<digest>
				Initial Ramp Setting
			</digest>
			<description>
				Sets a default ramp setting for all channels as a typed-in argument. After the object has been created, changing <at>defaultramp</at> has no effect. The default value of <at>default</at> is ramping off.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Initial Ramp Setting" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="defaultwrap" get="1" set="1" type="int" size="1">
			<digest>
				Initial Wrap Setting
			</digest>
			<description>
				Sets a default wrap setting for all channels as a typed-in argument. After the object has been created, changing <at>defaultwrap</at> has no effect. The default value of <at>defaultwrap</at> is wrapping off.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Initial Wrap Setting" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="embed" get="1" set="1" type="int" size="1">
			<digest>
				Save Data with Patcher
			</digest>
			<description>
				When <at>embed</at> is enabled, the current state of the object is saved with the patcher.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Save Data with Patcher" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="immediate" get="1" set="1" type="int" size="1">
			<digest>
				Immediately Play New Values
			</digest>
			<description>
				When <at>immediate</at> is enabled, any values recorded or added to the pattern are played if their time is after the current position of the input signal. When <at>immediate</at> is disabled, newly recorded or added values do not play until the input signal resets.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Immediately Play New Values" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="in" get="1" set="1" type="float" size="1">
			<digest>
				Phase Input Max
			</digest>
			<description>
				The <at>in</at> attribute defines the range of the input signal that causes output from <o>mc.pattern~</o>. Normally <at>in</at> is 1, which permits <o>mc.pattern~</o> to be driven by a <o>phasor~</o> object. If you set <at>in</at> to 10, then you would need to supply a ramp that ranges from 0 to 10 in order to play the entire pattern. The value of <at>in</at> does not affect the stored phases for pattern values. You can redefine the range of stored phases using the <at>ref</at> attribute.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="1." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Phase Input Max" />
			</attributelist>
		</attribute>
		<attribute name="individual" get="1" set="1" type="int" size="1">
			<digest>
				Individual Phasor Inputs
			</digest>
			<description>
				When the <at>individual</at> attribute is enabled, each channel is driven by a phasor on a corresponding input channel of a multi-channel signal. If there are fewer input channels than output channels, the extra outputs are muted. When individual is disabled, a single phasor drives all channels. Note that <at>individual</at> mode affects recording, so the recorded position of a value sent at the same time to two different channels could be different if those channels' input phasors are not synchronized.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="int" size="1" value="0" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Individual Phasor Inputs" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
		<attribute name="ref" get="1" set="1" type="float" size="1">
			<digest>
				Phase Value Max
			</digest>
			<description>
				The <at>ref</at> attribute sets the maximum value of the phase of an event in a pattern. Normally <at>ref</at> is 1, which means phase values for events will range from 0 to 1. If <at>ref</at> were set to 10, phase values for events could range from 0 to 10. When changing <at>ref</at> any values stored in <o>mc.pattern~</o> will be rescaled to have the same relative position as they did before.
			</description>
			<attributelist>
				<attribute name="category" get="1" set="1" type="atom" size="1" value="Behavior" />
				<attribute name="default" get="1" set="1" type="float" size="1" value="1." />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Phase Value Max" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="seq~" />
		<seealso name="phasor~" />
		<seealso name="zigzag~" />
	</seealsolist>
</c74object>
