<?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="biquad~" module="msp" category="MSP Filters">
	<digest>
		Two-pole, two-zero filter
	</digest>
	<description>
		<o>biquad~</o> implements a two-pole, two-zero filter using the following equation:
		<br />
		<br />
		y[n] = a0 * x[n] + a1 * x[n-1] + a2 * x[n-2] - b1 * y[n-1] - b2 * y[n-2]
		<br />
		<br />
		You can specify the coefficients a0, a1, a2, b1, and b2 as signals or floats (if you make the filter explode by making the b coefficients too high, you can recover (after lowering them) with the <m>clear</m> message, or by turning the audio on and off).
	</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>
				Input
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="1" type="signal/float">
			<digest>
				Input Gain (Filter coefficient a0)
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="2" type="signal/float">
			<digest>
				Filter coefficient a1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="3" type="signal/float">
			<digest>
				Filter coefficient a2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="4" type="signal/float">
			<digest>
				Filter coefficient b1
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
		<inlet id="5" type="signal/float">
			<digest>
				Filter coefficient b2
			</digest>
			<description>
				TEXT_HERE
			</description>
		</inlet>
	</inletlist>
	<!--OUTLETS-->
	<outletlist>
		<outlet id="0" type="signal">
			<digest>
				Output
			</digest>
			<description>
				TEXT_HERE
			</description>
		</outlet>
	</outletlist>
	<!--ARGUMENTS-->
	<objarglist>
		<objarg name="a0" optional="0" type="float">
			<digest>
				a0 coefficient initial value
			</digest>
			<description>
				Set the initial value for the a0 filter coefficient. If a signal is connected to the second inlet, the coefficient supplied as an argument is ignored.
			</description>
		</objarg>
		<objarg name="a1" optional="0" type="float">
			<digest>
				a1 coefficient initial value
			</digest>
			<description>
				Set the initial value for the a1 filter coefficient. If a signal is connected to the third inlet, the coefficient supplied as an argument is ignored.
			</description>
		</objarg>
		<objarg name="a2" optional="0" type="float">
			<digest>
				a2 coefficient initial value
			</digest>
			<description>
				Set the initial value for the a2 filter coefficient. If a signal is connected to the fourth inlet, the coefficient supplied as an argument is ignored.
			</description>
		</objarg>
		<objarg name="b1" optional="0" type="float">
			<digest>
				b1 coefficient initial value
			</digest>
			<description>
				Set the initial value for the b1 filter coefficient. If a signal is connected to the fifth inlet, the coefficient supplied as an argument is ignored.
			</description>
		</objarg>
		<objarg name="b2" optional="0" type="float">
			<digest>
				b2 coefficient initial value
			</digest>
			<description>
				Set the initial value for the b2 filter coefficient. If a signal is connected to the sixth inlet, the coefficient supplied as an argument is ignored.
			</description>
		</objarg>
	</objarglist>
	<!--MESSAGES-->
	<methodlist>
		<method name="int">
			<arglist>
				<arg name="filter-coefficient" optional="0" type="int" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				Converted to <m>float</m>.				<br />
				<br />
				The coefficients in inlets 2 to 6 may be specified by a number instead of a signal. If a signal is also connected to the inlet, the number value is ignored.
			</description>
		</method>
		<method name="float">
			<arglist>
				<arg name="filter-coefficient" optional="0" type="float" />
			</arglist>
			<digest>
				Function depends on inlet
			</digest>
			<description>
				The coefficients in inlets 2 to 6 may be specified by a <m>float</m> instead of a signal. If a signal is also connected to the inlet, the <m>float</m> is ignored.
			</description>
		</method>
		<method name="list">
			<arglist>
				<arg name="a0" optional="0" type="float" />
				<arg name="a1" optional="0" type="float" />
				<arg name="a2" optional="0" type="float" />
				<arg name="b1" optional="0" type="float" />
				<arg name="b2" optional="0" type="float" />
			</arglist>
			<digest>
				Set the filter using a list of five filter coefficients
			</digest>
			<description>
				The five filter coefficients can be provided as a <m>list</m> in the left inlet. The first number in the <m>list</m> is coefficient a0, the next is a1, and so on. If a signal is connected to a given inlet, the coefficient supplied in the <m>list</m> for that inlet is ignored.
			</description>
		</method>
		<method name="dictionary">
			<arglist>
				<arg name="dictionary-name" optional="0" type="symbol" />
			</arglist>
			<digest>
				Use a <o>filterdesign</o> dictionary's filter coefficients
			</digest>
			<description>
				The word <m>dictionary</m>, followed by a symbol that references a named <o>filterdesign</o> object dictionary (set via the <m>name</m> attribute), will cause the <o>biquad~</o> object to use the dictionary values for filter coefficients.
			</description>
		</method>
		<method name="clear">
			<arglist />
			<digest>
				Clear the <o>biquad~</o> object's memory
			</digest>
			<description>
				Clears the <o>biquad~</o> object's memory of previous inputs and outputs, resetting xn-1, xn-2, yn-1, and yn-2 to 0.
			</description>
		</method>
		<method name="signal">
			<arglist />
			<digest>
				Function depends on inlet
			</digest>
			<description>
				In left inlet: Signal to be filtered. The filter mixes the current input sample with the two previous input samples and the two previous output samples according to the formula:
				<br />
				<br />
				yn = a0xn + a1xn-1 + a2xn-2 - b1yn-1 - b2yn-2.
				<br />
				<br />
				In 2nd inlet: Amplitude coefficient a0, for scaling the amount of the current input to be passed directly to the output.
				<br />
				<br />
				In 3rd inlet: Amplitude coefficient a1, for scaling the amount of the previous input sample to be added to the output.
				<br />
				<br />
				In 4th inlet: Amplitude coefficient a2, for scaling the amount of input sample n-2 to be added to the output.
				<br />
				<br />
				In 5th inlet: Amplitude coefficient b1, for scaling the amount of the previous output sample to be added to the current output.
				<br />
				<br />
				In right inlet: Amplitude coefficient b2, for scaling the amount of output sample n-2 to be added to the current output. .
			</description>
		</method>
		<method name="stoke">
			<arglist>
				<arg name="a0" optional="0" type="float" />
				<arg name="a1" optional="0" type="float" />
				<arg name="a2" optional="0" type="float" />
				<arg name="b1" optional="0" type="float" />
				<arg name="b2" optional="0" type="float" />
			</arglist>
			<digest>
				Preload filter coefficients
			</digest>
			<description>
				The word <m>stoke</m>, followed by a list that specifies a set of filter coefficient values, will preload the filter so that it starts in a given initial state, allowing the filter to be used for purposes such as a ringing oscillator.
			</description>
		</method>
	</methodlist>
	<!--ATTRIBUTES-->
	<attributelist>
		<attribute name="smooth" get="1" set="1" type="int" size="1">
			<digest>
				Filter coefficient smoothing toggle
			</digest>
			<description>
				Toggles the smoothing of filter coeffient changes.
			</description>
			<attributelist>
				<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="Smooth Coefficient Changes" />
				<attribute name="style" get="1" set="1" type="symbol" size="1" value="onoff" />
			</attributelist>
		</attribute>
	</attributelist>
	<!--EXAMPLE-->
	<examplelist>
		<example img="biquad~.png" caption="Filter coefficients may be supplied as numerical values or as varying signals" />
	</examplelist>
	<!--SEEALSO-->
	<seealsolist>
		<seealso name="buffir~" />
		<seealso name="cascade~" />
		<seealso name="comb~" />
		<seealso name="cross~" />
		<seealso name="filtergraph~" />
		<seealso name="lores~" />
		<seealso name="onepole~" />
		<seealso name="reson~" />
		<seealso name="svf~" />
		<seealso name="teeth~" />
		<seealso name="audio_filtering" module="core" type="vignette" />
	</seealsolist>
	<misc name="Output">
		<entry name="signal">
			<description>
				The filtered signal.
			</description>
		</entry>
	</misc>
</c74object>
