<?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="shape~" module="" category="">
	<digest>
		Time-scaled Breakpoint Envelope Generator
	</digest>
	<description>
		An envelope for the <o>shape~</o> object can be defined using the same format as the <o>line~</o> or <o>zigzag~</o> objects (and edited graphically by connecting a <o>function</o> object). Unlike <o>line~</o> the time values of <o>shape~</o> are normalized so that the output occurs within signal ramp of a phasor from 0 to 1 (or 1 to 0). This means you can trigger the output sample-accurately and determine the time of the function by using different ramp durations (or <o>phasor~</o> frequencies).
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				Input Phasor, Define Function
			</digest>
			<description>
				<o>shape~</o> starts its output when the input ramp either turns on or resets.
				<br />
				To define a new function, connect the second outlet of <o>function</o> to the inlet of <o>shape~</o>. See the <m>list</m> message for information on the breakpoint format used by <o>shape~</o>.
			</description>
		</inlet>
		<inlet id="1" type="signal">
			<digest>
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Time-Scaled Function
			</digest>
			<description>
				<o>shape~</o> outputs a function that is time-scaled to coincide with the duration of its input ramp.
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg id="0" name="OBJARG_NAME" type="OBJARG_TYPE" optional="0">
			<digest>
				TEXT_HERE
			</digest>
			<description>
				TEXT_HERE
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="ARG_NAME_0" type="int" optional="0" />
			</arglist>
			<digest>
				Converted to <m>float</m> 
			</digest>
			<description>
				TEXT_HERE
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="initial-value" type="float" optional="0" />
			</arglist>
			<digest>
				Define value at time zero
			</digest>
			<description>
				<m>float</m> in the left inlet defines the the initial value of the function. Without a subsequent <m>list</m> message, a single <m>float</m> does not cause a new function to be defined (or the existing function to be replaced).
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="breakpoints" type="list" optional="0" />
			</arglist>
			<digest>
				Define breakpoints
			</digest>
			<description>
				<m>list</m> message defines the breakpoint function used by <o>shape~</o>. There are two options for the format of the list, depending on the setting of the <at>curvemode</at> attribute. When <at>curvemode</at> is disabled, the format of the list is in <m>value, time</m> pairs where the first number is a destination value and the second number is the time in milliseconds it takes to get to that value from the previous value. This format (along with an initial <m>float</m> value0) is produced by the second outlet of the <o>function</o> object. The millisecond time values are normalized; in other words, they are divided by the total length of the function. Longer times between breakpoints will be longer than shorter times but the exact times will be dependent on the duration of the incoming ramp.
				<br />
				When <at>curvemode</at> is enabled, the list format starts with the initial <m>float</m> followed by triplets of numbers -- <m>value, time, curvature</m>-- for each breakpoint. The curvature value ranges from -1 to 1.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Input Phasor
			</digest>
			<description>
				<o>shape~</o> starts its output when the input ramp either turns on or resets.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="constant" get="1" set="1" type="int" size="1">
			<digest>
				Constant Time Segments
			</digest>
			<description>
				Sets the number of initial segments of the envelope that will be played at a constant time based on their millisecond time values independent of the input ramp duration. The default value for <at>constant</at> is zero, meaning none of the segments will be played with a constant time -- all segments will be scaled. If <at>constant</at> is 1, the first (&quot;attack) segment will have a constant time and the remaining segments will be scaled to occupy the part of the incoming ramp starting when the input value when the constant portion of the output ends. For example, if the first segment is constant and it ends when the input is equal to 0.5, the remaining part of the envelope will be re-normalized to fit into the space between 0.5 and 1.
				<br />
				Note that the <at>constant</at> attribute only works with ascending ramps and can only designate segments at the beginning of an envelope.
			</description>
			<attributelist>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Constant Time Segments" />
			</attributelist>
		</attribute>
		<attribute name="curvemode" get="1" set="1" type="int" size="1">
			<digest>
				Curve Mode
			</digest>
			<description>
				Sets whether <o>shape~</o> plays curved breakpoints and how it interprets incoming lists.
			</description>
			<attributelist>
				<attribute name="enumvals" get="1" set="1" type="atom" size="3">
					<enumlist>
						<enum name="Off">
							<digest>
								No curved breakpoints
							</digest>
							<description>
								When <at>curvemode</at> is disabled (Off), <o>shape~</o> interprets incoming lists to set its breakpoints as <m>time, alue</m> pairs. If any curved breakpionts were previously set, they are played as linear ramps.
							</description>
						</enum>
						<enum name="On">
							<digest>
								Use curved breakpoints
							</digest>
							<description>
								When <at>curvemode</at> is enabled (On), <o>shape~</o> interprets incoming lists to be triplets consisting of <m>time, value, curvature</m>. All curved breakpoints are output with their curvature.
							</description>
						</enum>
						<enum name="Auto">
							<digest>
								Use connected function <at>mode</at> setting
							</digest>
							<description>
								When <at>curvemode</at> is set to Auto, <o>shape~</o> determines how to interpret  incoming lists on the basis of the <at>mode</at> attribute of a connected <o>function</o> or <o>mc.function</o> object. If <at>mode</at> is set to 0 (Linear), lists are interpreted as <m>time, value</m> pairs. If <at>mode</at> is set to 1 (Curve), lists are interpreted as <m>time, value, curvature</m> triplets. If any segments contain non-zero curvature, they are played with their curvature.
								<br />
								In order for Auto mode to work properly, the <o>function</o> object must have its second outlet directly connected to the left inlet of <o>shape</o>.
							</description>
						</enum>
					</enumlist>
				</attribute>
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Curve Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="enumindex" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example caption="" img="" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="function" />
		<seealso name="curve~" />
		<seealso name="line~" />
		<seealso name="mc.pattern~" />
		<seealso name="phasor~" />
		<seealso name="ramp~" />
		<seealso name="techno~" />
		<seealso name="zigzag~" />
	</seealsolist>
</c74object>
