<?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="peakamp~" module="msp" category="MSP Analysis, MSP Modifiers">
	<digest>
		Report the maximum amplitude of a signal
	</digest>
	<description>
		Use the <o>peakamp~</o> object to monitor an incoming signal and reports the absolute value of the peak amplitude of the signal it has received since the last time it was reported.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Analysis
		</metadata>
		<metadata name="tag">
			MSP Modifiers
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) any signal, (bang) report peak amplitude
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="int">
			<digest>
				(int) reporting interval
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="float">
			<digest>
				(float) peak amplitude of input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="ms-output-interval" optional="1" units="ms" type="int">
			<digest>
				Set internal clock interval
			</digest>
			<description>
				Sets the internal clock interval, in milliseconds. If it is 0, the internal clock is not used, so <o>peakamp~</o> will only output data when it receives a bang message. If it is non-zero, <o>peakamp~</o> will repeatedly send out the peak amplitude received in that interval of time. By default, the interval is 0.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="bang">
			<arglist />
			<digest>
				Report the peak amplitude
			</digest>
			<description>
				In left inlet: Sends out a report of the greatest (absolute value) signal amplitude received since the previous report.
			</description>
		</method>
		<method name="ft1">
			<arglist>
				<arg name="output-interval" optional="0" units="ms" type="float" />
			</arglist>
			<digest>
				Set the polling interval
			</digest>
			<description>
				In right inlet: Sets the interval in milliseconds for an internal clock that triggers the automatic output of peak amplitude values from the input signal. If the interval is 0, the clock stops. If it is a positive integer, the interval changes the rate of data output. Time intervals shorter than the duration of one signal vector may be specified, but the peak amplitude will be checked only once per vector.
			</description>
		</method>
		<method name="in1">
			<arglist>
				<arg name="output-interval" optional="0" units="ms" type="int" />
			</arglist>
			<digest>
				Set the polling interval
			</digest>
			<description>
				In right inlet: Sets the interval in milliseconds for an internal clock that triggers the automatic output of peak amplitude values from the input signal. If the interval is 0, the clock stops. If it is a positive integer, the interval changes the rate of data output. Time intervals shorter than the duration of one signal vector may be specified, but the peak amplitude will be checked only once per vector.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				In left inlet: Signal to be evaluated for its peak amplitude
			</digest>
			<description>
				In left inlet: Signal to be evaluated for its peak amplitude.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="interval" get="1" set="1" type="float" size="1">
			<digest>
				Reporting Interval
			</digest>
			<description>
				Sets the reporting interval, in milliseconds. This is the same functionality as the <ar>ms-output-interval</ar> argument. If the <at>interval</at> is 0, the internal clock is not used, so <o>peakamp~</o> will only output data when it receives a bang message. If it is non-zero, <o>peakamp~</o> will repeatedly send out the peak amplitude received in that interval of time. By default, the interval is 0.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Reporting Interval" />
			</attributelist>
		</attribute>
		<attribute name="signed" get="1" set="1" type="int" size="1">
			<digest>
				Signed Mode
			</digest>
			<description>
				When the <at>signed</at> attribute is set to 1, the peak amplitude of the incoming signal in the specified interval is reported, rather than the absolute value of the peak amplitude.
			</description>
			<attributelist>
				<attribute name="basic" get="1" set="1" type="int" size="1" value="1" />
				<attribute name="label" get="1" set="1" type="symbol" size="1" value="Signed Mode" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="peakamp~.png" caption="Report the maximum of a signal's absolute value" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="meter~" />
		<seealso name="snapshot~" />
	</seealsolist>
	<discussion>
		The <o>peakamp~</o> object is sample-accurate when Scheduler in Audio Interrupt is enabled. More details <link module="core" name="audio_sampleaccurate" type="vignette">here</link>.
	</discussion>
	<misc name="Output">
		<entry name="float">
			<description>
				When <o>peakamp~</o> receives a <m>bang</m> or its internal clock is on, the absolute value of the peak signal value from the input signal is sent out its outlet.
			</description>
		</entry>
	</misc>
</c74object>
