<?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="reson~" module="msp" category="MSP Filters">
	<digest>
		Resonant bandpass filter
	</digest>
	<description>
		Use the <o>reson~</o> object when you need a resonant bandpass filter.
	</description>
	<!--METADATA-->
	<metadatalist>
		<metadata name="author">
			Cycling '74
		</metadata>
		<metadata name="tag">
			MSP
		</metadata>
		<metadata name="tag">
			MSP Filters
		</metadata>
	</metadatalist>
	<!--INLETS-->
	<inletlist>
		<inlet id="0" type="signal">
			<digest>
				(signal) Input to Filter
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				(signal/float) Input Gain
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal/float">
			<digest>
				(signal/float) Center Frequency
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="3" type="signal/float">
			<digest>
				(signal/float) Q (Resonance)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				(signal) Filtered Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="initial-gain" optional="1" type="float">
			<digest>
				Initial gain for filter
			</digest>
			<description>
				Sets the initial gain. The default value is 0.
			</description>
		</objarg>
		<objarg name="center-frequency" optional="1" units="hz" type="float">
			<digest>
				Center frequency for filter
			</digest>
			<description>
				Sets the initial center frequency for the filter. The default value is 0.
			</description>
		</objarg>
		<objarg name="Q" optional="1" type="float">
			<digest>
				Q for filter
			</digest>
			<description>
				Sets the initial Q value for the filter. The default value is 0.01.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="initial-gain" optional="0" type="int" />
				<arg name="center-frequency" optional="0" type="int" />
				<arg name="Q" optional="0" type="int" />
			</arglist>
			<digest>
				Set filter parameters
			</digest>
			<description>
				An <m>int</m> can be sent in the three right inlets to change the filter-gain, center-frequency, and Q. If a signal is connected to one of the inlets, a number received in that inlet is ignored.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="initial-gain" optional="0" type="float" />
				<arg name="center-frequency" optional="0" type="float" />
				<arg name="Q" optional="0" type="float" />
			</arglist>
			<digest>
				An <m>int</m> or <m>float</m> can be sent in the three right inlets to change the filter-gain, center-frequency, and Q
			</digest>
			<description>
				<m>float</m> can be sent in the three right inlets to change the filter-gain, center-frequency, and Q. If a signal is connected to one of the inlets, a number received in that inlet is ignored.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="initial-gain" optional="0" type="number" />
				<arg name="center-frequency" optional="0" type="number" />
				<arg name="Q" optional="0" type="number" />
			</arglist>
			<digest>
				Use a list to set filter parameters
			</digest>
			<description>
				In left inlet: The first number sets the filter-gain. The second number sets the filter center-frequency. The third number sets the filter-Q. If any of the inlets corresponding to these parameters have signals connected, the corresponding value in the list is ignored.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear filter memory
			</digest>
			<description>
				Clears the filter's memory. Since <o>reson~</o> is a recursive filter, this message may be necessary to recover from blowups.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Any signal to be filtered.
				<br />
				<br />
				In left-middle inlet: Sets the bandpass filter gain. This value should generally be less than 1.
				<br />
				<br />
				In right-middle inlet: Sets the bandpass filter center frequency in hertz.
				<br />
				<br />
				In right inlet: Sets the bandpass filter &quot;Q&quot;-roughly, the sharpness of the filter - where Q is defined by the center-frequency divided by the filter-bandwidth. Useful Q values are typically between 0.01 and 500.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<!--EXAMPLE-->
	<examplelist>
		<example img="reson~.png" caption="Control gain, center frequency, and Q of a bandpass filter to alter a rich signal" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="biquad~" />
		<seealso name="comb~" />
		<seealso name="cross~" />
		<seealso name="onepole~" />
		<seealso name="lores~" />
		<seealso name="reson~" />
		<seealso name="svf~" />
		<seealso name="audio_filtering" module="core" type="vignette" />
	</seealsolist>
	<discussion>
		<o>reson~</o> implements the following filter equation:
		<br />
		<br />
		y[n] = a0 * (x[n] - r * x[n-2]) + b1 * y[n-1] + b2 * y[n-2]
		<br />
		where r, b1, and b2 are parameters calculated from the input center frequency fc and Q.
		<br />
		<br />
		Q = fc/bandwidth.
		<br />
		<br />
		Inputs can be floats or signals.
	</discussion>
	<misc name="Output">
		<entry name="signal">
			<description>
				The filtered input signal.
			</description>
		</entry>
	</misc>
</c74object>
