<?xml version='1.0' encoding='utf-8' standalone='yes'?>

<c74object name="live.adsrui" module="m4l" category="Live UI Objects">

	<digest>ADSR User Interface</digest>
	<description>The live.adsrui object is a user interface for defining the shape of an envelope using the classic Attack, Decay, Sustain, Release model. Each segment has an individually definable length and exponential slope. This object is designed to work seamlessly with its companion object, <o>live.adsr~</o>. </description>


	<!--METADATA-->

	<metadatalist>
		<metadata name='author'>Cycling '74</metadata>
		<metadata name='tag'>Live</metadata>
	</metadatalist>


	<!--ARGUMENTS-->

	<objarglist>

	</objarglist>


	<!--MESSAGES-->

	<methodlist>

		<method name='list'>
			<digest>Set all ADSR values simultaneously</digest>
			<description>A list to the leftmost inlet sets all ADSR envelope values simultaneously.</description>
		</method>

		<method name='float'>
			<digest>Set value of an attribute</digest>
				<description>A number sets the attribute associated with the inlet.</description>
		</method>

		<method name='bang'>
			<digest>Refresh display</digest>
			<description>In any inlet, a bang will refresh the UI display and cause output.</description>
		</method>

		<method name='key'>
			<digest>Keyboard control</digest>
			<description>Use the arrow keys on the keyboard to nudge handles when this object is selected.</description>
		</method>

	</methodlist>


	<!--ATTRIBUTES-->

	<attributelist>

		<attribute name='active' get='1' set='1' type='long' size='1'>
			<digest>Active mode</digest>
			<description> When the active attribute is set to 0, the mouse action does not cause output and the inactive colors are used.</description>
		</attribute>

		<attribute name='attack_slope' get='1' set='1' type='float' size='1'>
			<digest>Attack slope</digest>
			<description>The slope of the attack stage (-1 to 1).</description>
		</attribute>

		<attribute name='attack_time' get='1' set='1' type='float' size='1'>
			<digest>Attack time</digest>
			<description>The duration of the attack stage in milliseconds. This value is clamped to the <at>attack_domain</at> attribute.</description>
		</attribute>

		<attribute name='decay_domain' get='1' set='1' type='float' size='2'>
			<digest>Decay time domain</digest>
			<description>The domain, or range, in which the decay value can move.</description>
		</attribute>

		<attribute name='decay_slope' get='1' set='1' type='float' size='1'>
			<digest>Decay slope</digest>
			<description>The slope of the decay stage (-1 to 1).</description>
		</attribute>

		<attribute name='decay_time' get='1' set='1' type='float' size='1'>
			<digest>Decay time</digest>
			<description>The duration of the decay stage in milliseconds. This value is clamped to the <at>decay_domain</at> attribute.</description>
		</attribute>

		<attribute name='domain_exponent' get='1' set='1' type='float' size='1'>
			<digest>Domain exponent</digest>
			<description>This exponent is applied when drawing the attack/decay/release values. The exponent allows you to tweak the behavior when the user moves the handle with the mouse.</description>
		</attribute>

		<attribute name='enable_final' get='1' set='1' type='long' size='1'>
			<digest>Enable final handle</digest>
			<description>When enabled, the final handle can move vertically.</description>
		</attribute>

		<attribute name='enable_initial' get='1' set='1' type='long' size='1'>
			<digest>Enable initial handle</digest>
			<description>When enabled, the initial handle can move vertically. When disabled, the handle is not drawn.</description>
		</attribute>

		<attribute name='enable_peak' get='1' set='1' type='long' size='1'>
			<digest>Enable peak handle</digest>
			<description>When enabled, the peak handle can move both horizontally and vertically. When disabled, the peak handle can only move horizontally.</description>
		</attribute>

		<attribute name='final' get='1' set='1' type='float' size='1'>
			<digest>Final value</digest>
			<description>The value the ADSR reaches at the end of the release stage.</description>
		</attribute>

		<attribute name='initial' get='1' set='1' type='float' size='1'>
			<digest>Initial value</digest>
			<description>The value the ADSR starts at.</description>
		</attribute>

		<attribute name='outputmode' get='1' set='1' type='long' size='1'>
			<digest>Output Values Saved in Patch On Load</digest>
			<description>Default on. When enabled, the values stored in the patch are sent out when loading this object. Turn this attribute off when lusing live.adsrui in a Max for Live device, when live.adsrui outputs to objects that store the ADSR values in the set, such as live.numbox, to prevent conflicts.</description>
		</attribute>		

		<attribute name='peak' get='1' set='1' type='float' size='1'>
			<digest>Peak value</digest>
			<description>The value the ADSR reaches at the end of the attack stage.</description>
		</attribute>

		<attribute name='release_domain' get='1' set='1' type='float' size='2'>
			<digest>Release time domain</digest>
			<description>The domain, or range, in which the release value can move.</description>
		</attribute>

		<attribute name='release_slope' get='1' set='1' type='float' size='1'>
			<digest>Release slope</digest>
			<description>The slope of the release stage (-1 to 1).</description>
		</attribute>

		<attribute name='release_time' get='1' set='1' type='float' size='1'>
			<digest>Release time</digest>
			<description>The duration of the release stage in milliseconds. This value is clamped to the <at>release_domain</at> attribute.</description>
		</attribute>

		<attribute name='show_bounds' get='1' set='1' type='long' size='1'>
			<digest>Display bounds</digest>
			<description>When enabled, lines are shown to indicate the object's bounds.</description>
		</attribute>

		<attribute name='show_slopehandles' get='1' set='1' type='long' size='1'>
			<digest>Display slope handles</digest>
			<description>When enabled, the slope handles are drawn and can be manipulated with the mouse or keyboard.</description>
		</attribute>

		<attribute name='sustain' get='1' set='1' type='float' size='1'>
			<digest>Sustain value</digest>
			<description>The value the ADSR reaches at the end of the decay stage.</description>
		</attribute>

		<attribute name='sustain_exponent' get='1' set='1' type='float' size='1'>
			<digest>Sustain exponent</digest>
			<description>The exponent that is applied when drawing the sustain value. The exponent allows you to tweak the behavior when the user moves the handle with the mouse.</description>
		</attribute>

		<attribute name='tethering' get='1' set='1' type='long' size='1'>
			<digest>Pass incoming values to the outputs</digest>
			<description>Default on. When enabled, incoming values are sent out from the outlets immediately, without causing a stack overflow when routed back to the inlets. Disable this when connecting live.adsrui to other parameter-enabled objects in Max for Live, to prevent unexpected behavior when automating.</description>
		</attribute>

	</attributelist>


	<!--RELATED-->

	<seealsolist>
	<seealso name='function' />
		<seealso name='live.adsr~' />
	</seealsolist>


</c74object>
