<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://cycling74.com/wiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;feed=atom&amp;action=history</id>
		<title>MSP Filter Tutorial 2: Variable Type Filters - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;action=history"/>
		<updated>2013-05-23T05:08:19Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=825&amp;oldid=prev</id>
		<title>Gtaylor@rtqe.net at 15:31, 28 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=825&amp;oldid=prev"/>
				<updated>2012-06-28T15:31:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:31, 28 June 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[02fVariableTypeFilters.maxpat]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Click here to open the tutorial patch: [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Media:&lt;/ins&gt;02fVariableTypeFilters.maxpat]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the first filter tutorial, we introduced some basic filters in MSP. This tutorial looks at two new filter objects: {{maxword|name=biquad~}}, which can create any kind of simple filter, and {{maxword|name=cascade~}}, which can create and manage multiple independent filters in a single object. We'll also look at a user interface object that helps us edit these filters in an intuitive way.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the first filter tutorial, we introduced some basic filters in MSP. This tutorial looks at two new filter objects: {{maxword|name=biquad~}}, which can create any kind of simple filter, and {{maxword|name=cascade~}}, which can create and manage multiple independent filters in a single object. We'll also look at a user interface object that helps us edit these filters in an intuitive way.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gtaylor@rtqe.net</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=773&amp;oldid=prev</id>
		<title>Admin at 21:15, 25 June 2012</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=773&amp;oldid=prev"/>
				<updated>2012-06-25T21:15:06Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;amp;diff=773&amp;amp;oldid=721&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=721&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;Click here to open the tutorial patch: 02fVariableTypeFilters.maxpat  In the last tutorial we introduced some basic filters in MSP. This tutorial looks at two new filter o...&quot;</title>
		<link rel="alternate" type="text/html" href="http://cycling74.com/wiki/index.php?title=MSP_Filter_Tutorial_2:_Variable_Type_Filters&amp;diff=721&amp;oldid=prev"/>
				<updated>2012-06-22T21:20:38Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Click here to open the tutorial patch: &lt;a href=&quot;/wiki/index.php?title=02fVariableTypeFilters.maxpat&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;02fVariableTypeFilters.maxpat (page does not exist)&quot;&gt;02fVariableTypeFilters.maxpat&lt;/a&gt;  In the last tutorial we introduced some basic filters in MSP. This tutorial looks at two new filter o...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Click here to open the tutorial patch: [[02fVariableTypeFilters.maxpat]]&lt;br /&gt;
&lt;br /&gt;
In the last tutorial we introduced some basic filters in MSP. This tutorial&lt;br /&gt;
looks at two new filter objects: {{maxword|name=biquad~}}, which can create any kind of&lt;br /&gt;
simple filter, and {{maxword|name=cascade~}}, which can create and manage multiple&lt;br /&gt;
independent filters in a single object. We'll also look at a user interface&lt;br /&gt;
object that helps us edit these filters in an intuitive way.&lt;br /&gt;
&lt;br /&gt;
===Biquadratic filters===&lt;br /&gt;
&lt;br /&gt;
* Look at the tutorial patcher. Just as in the last tutorial, area &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; consists&lt;br /&gt;
of a looping playback system that plays a {{maxword|name=buffer~}} using the {{maxword|name=groove~}} object. Turn on the audio, turn up the {{maxword|name=number}} box labeled 'Dry Volume', click on a&lt;br /&gt;
note in the {{maxword|name=kslider}}, and make sure you can hear some sound.&lt;br /&gt;
&lt;br /&gt;
* Take a look at area &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; of the tutorial. The sound from the {{maxword|name=groove~}}&lt;br /&gt;
object feeds into an object called {{maxword|name=biquad~}}. Turn down the 'Dry Volume'&lt;br /&gt;
and turn up the {{maxword|name=number}} box labeled 'Biquad Volume'. Click on the different&lt;br /&gt;
circles in the {{maxword|name=preset}} object at the top of patcher aread &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;.&lt;br /&gt;
Listen to the changes in the sound.&lt;br /&gt;
&lt;br /&gt;
In the last tutorial, we discussed how filters could be expressed as equations, e.g.&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = 0.5x&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + 0.5y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;0.5&amp;lt;/code&amp;gt; values in the equation above set the respective gains of the&lt;br /&gt;
different samples used in the filter. If we wanted a more flexible filter,&lt;br /&gt;
we could generalize this filter so that those numbers are variable, e.g.:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = Ax&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + By&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By modifying the values of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, we could control the frequency&lt;br /&gt;
response of this filter. While the math behind this operation is beyond the scope&lt;br /&gt;
of this tutorial, it's generally true that the more energy given to the delayed&lt;br /&gt;
output sample (the y&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; term), the smoother the output and the more&lt;br /&gt;
the high frequencies are supressed.&lt;br /&gt;
&lt;br /&gt;
A fairly standard tactic in digital filter design is to create a filter equation&lt;br /&gt;
that can perform any kind of standard filtering operation (lowpass, bandpass,&lt;br /&gt;
etc.) on an input signal. The most common implementation of this is called&lt;br /&gt;
the ''biquadratic filter equation'' (or ''biquad''). It consists of&lt;br /&gt;
the following equation:&lt;br /&gt;
&lt;br /&gt;
y&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; = Ax&amp;lt;sub&amp;gt;n&amp;lt;/sub&amp;gt; + Bx&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; + Cx&amp;lt;sub&amp;gt;n-2&amp;lt;/sub&amp;gt; - Dy&amp;lt;sub&amp;gt;n-1&amp;lt;/sub&amp;gt; - Ey&amp;lt;sub&amp;gt;n-2&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This equation uses the incoming sample, the ''last two'' incoming samples,&lt;br /&gt;
and the last two ''outgoing'' samples to generate its filter (another term&lt;br /&gt;
for a biquadratic filter is a ''two-pole'', ''two-zero'' filter, because&lt;br /&gt;
it has four delay coefficients to affect its behavior). By adjusting the&lt;br /&gt;
five ''coefficients'' (A, B, C, D, E), you can generate all manner of filters.&lt;br /&gt;
The MSP {{maxword|name=biquad~}} object implements a biquadratic filter. Unfortunately,&lt;br /&gt;
it takes as its input the input signal and the five coefficients that define&lt;br /&gt;
the filter. What we really want to do, though, is specify our filter not by&lt;br /&gt;
the equation, but by how we want it to sound.&lt;br /&gt;
&lt;br /&gt;
===The {{maxword|name=filtergraph~}} object===&lt;br /&gt;
&lt;br /&gt;
The user-interface object connected to the {{maxword|name=biquad~}} object in the tutorial&lt;br /&gt;
patcher is called a {{maxword|name=filtergraph~}}. It allows us to physically drag around&lt;br /&gt;
within a box to set parameters of a filter. In addition, you can send messages&lt;br /&gt;
to a {{maxword|name=filtergraph~}} object to set its parameters, as well as change what&lt;br /&gt;
kind of filter it shows. Whenever you make a change to the {{maxword|name=filtergraph~}}&lt;br /&gt;
object, it outputs a set of coefficients as a Max list which the {{maxword|name=biquad~}}&lt;br /&gt;
object interprets to perform the equivalent filter equation. The {{maxword|name=message}} box&lt;br /&gt;
below the {{maxword|name=filtergraph~}} in the patcher shows us these coefficients.&lt;br /&gt;
&lt;br /&gt;
* Using the {{maxword|name=umenu}} object, select a &amp;lt;code&amp;gt;lowpass&amp;lt;/code&amp;gt; filter from the&lt;br /&gt;
{{maxword|name=filtergraph~}}. Using the mouse, click and drag in the pink region&lt;br /&gt;
in the middle of the filter response. You can adjust the cutoff frequency&lt;br /&gt;
of the filter as well as its overall gain. Click on the edges of the pink&lt;br /&gt;
region and drag inward and outward. This allows you to set the resonance of&lt;br /&gt;
the filter. The values you are creating (in terms of cutoff frequency, gain,&lt;br /&gt;
and slope) can be seen in the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects to the right of the object.&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=filtergraph~}} object is capable of graphing and generating&lt;br /&gt;
coefficients for a wide variety of filter curves, including lowpass,&lt;br /&gt;
highpass, bandpass, bandstop (or notch), ''peaknotch'' (a band filter&lt;br /&gt;
that can either boost or cut a frequency band), ''lowshelf / highshelf''&lt;br /&gt;
(filters that can boost or cut frequencies lower or higher than a cutoff),&lt;br /&gt;
''resonant'' (a bandpass filter where its gain increasing with the Q),&lt;br /&gt;
and ''allpass'' (a filter that changes the phase relationships of frequencies&lt;br /&gt;
without altering their gains). All of these filters can be modeled by&lt;br /&gt;
a {{maxword|name=biquad~}} object.&lt;br /&gt;
&lt;br /&gt;
* Acclimatize yourself to the user interface of the {{maxword|name=filtergraph~}}&lt;br /&gt;
object by selecting different filter types from the {{maxword|name=umenu}} and&lt;br /&gt;
dragging around to create different filters. Note that some filters&lt;br /&gt;
have inherently more potential gain than others.&lt;br /&gt;
&lt;br /&gt;
===Filters in series: {{maxword|name=cascade~}}===&lt;br /&gt;
&lt;br /&gt;
Filtering plays a huge role in audio-related creative work, whether we're&lt;br /&gt;
discussing contemporary music production techniques or avant-garde sound art.&lt;br /&gt;
It's often the case that a simple filter that only affects one range of frequencies&lt;br /&gt;
isn't enough to perform the task we want. You can easily chain {{maxword|name=biquad~}} objects&lt;br /&gt;
(or other filters) by hand in an MSP patcher to create filters operating in series.&lt;br /&gt;
If you have an idea of how many filters you want to operate in this manner, you&lt;br /&gt;
can instead use a single object that creates and manages up to 24 different filters&lt;br /&gt;
arranged in series: {{maxword|name=cascade~}}.&lt;br /&gt;
&lt;br /&gt;
* Turn down the 'Biquad Volume' and turn your attention to area &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; of the&lt;br /&gt;
tutorial patcher. Turn up the 'Cascade Volume' {{maxword|name=number}} box and click on the&lt;br /&gt;
different selections in the {{maxword|name=preset}} object. Notice how the sound changes.&lt;br /&gt;
Using the {{maxword|name=number}} box labeled 'Select a filter', send the message&lt;br /&gt;
&amp;lt;code&amp;gt;selectfilt 0&amp;lt;/code&amp;gt; to the {{maxword|name=filtergraph~}} in this part of the patcher.&lt;br /&gt;
Change the {{maxword|name=number}} box to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt;,&lt;br /&gt;
and see how different component filters within the {{maxword|name=filtergraph~}} highlight&lt;br /&gt;
themselves. The settings for each of these filters also comes out of the object,&lt;br /&gt;
setting the &amp;lt;link type=&amp;quot;refpage&amp;quot; name=&amp;quot;number&amp;quot;&amp;gt;number box&amp;lt;/link&amp;gt; objects to the right.&lt;br /&gt;
&lt;br /&gt;
As we can see, the {{maxword|name=filtergraph~}} object is capable of maintaining the&lt;br /&gt;
state of more than one filter and showing us what the frequency response of&lt;br /&gt;
these filters would be if they were connected in series. The {{maxword|name=cascade~}} object&lt;br /&gt;
takes a signal in its left inlet and a set of coefficients in its right,&lt;br /&gt;
interpreting each incoming list as sets of 5 values, one set for each filter.&lt;br /&gt;
&lt;br /&gt;
* Pick a {{maxword|name=preset}} setting you like for the {{maxword|name=cascade~}} object.&lt;br /&gt;
Select a filter to edit with the &amp;lt;code&amp;gt;selectfilt&amp;lt;/code&amp;gt; message, and drag your&lt;br /&gt;
mouse in the {{maxword|name=filtergraph~}} to edit the filter. Notice how the filters&lt;br /&gt;
interact with one another. For example, a lowpass filter set at the same&lt;br /&gt;
frequency as a highpass filter will cancel one another out. Similarly,&lt;br /&gt;
a bandpass filter can sit at the 'slope' of a lowpass filter to simulate&lt;br /&gt;
a resonation point.&lt;br /&gt;
&lt;br /&gt;
If we unlock the patcher and open the&lt;br /&gt;
&amp;lt;link type=&amp;quot;vignette&amp;quot; module=&amp;quot;core&amp;quot; name=&amp;quot;inspector&amp;quot;&amp;gt;Inspector&amp;lt;/link&amp;gt;&lt;br /&gt;
for the {{maxword|name=filtergraph~}} object, we can edit the specific types of&lt;br /&gt;
filters that it generates coefficients for; in addition, we could change&lt;br /&gt;
how many filters are maintained and some features of the user interface.&lt;br /&gt;
By the opposite token, if you'd rather work with filters without a user&lt;br /&gt;
interface, the MSP object {{maxword|name=filtercoeff~}} takes the same settings&lt;br /&gt;
as the {{maxword|name=filtergraph~}} object without a graphical component, allowing&lt;br /&gt;
you to feed coefficients to a {{maxword|name=biquad~}} or {{maxword|name=cascade~}} object&lt;br /&gt;
without having to graph the filter yourself.&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
The {{maxword|name=biquad~}} object implements a generic filter equation that can&lt;br /&gt;
model most types of simple filters. Because it expects coefficients for&lt;br /&gt;
the filter equation, its often useful to use it in conjunction with&lt;br /&gt;
another object that will compute these numbers. The {{maxword|name=filtergraph~}}&lt;br /&gt;
object is a user-interface object that lets you visually construct simple&lt;br /&gt;
and complex filters of many types; the {{maxword|name=filtercoeff~}} object will&lt;br /&gt;
accomplish the same thing, without the user interface. The {{maxword|name=cascade~}}&lt;br /&gt;
object acts as a group of {{maxword|name=biquad~}} objects arranged in ''series'',&lt;br /&gt;
and allows you to easily construct compound filter curves in your patcher.&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=biquad~}} - Two-pole, two-zero filter&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=filtergraph~}} - Graphical filter editor&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=cascade~}} - Cascaded series of biquad filters&lt;br /&gt;
&lt;br /&gt;
{{maxword|name=filtercoeff~}} - Signal-rate filter coefficient generator&lt;br /&gt;
&lt;br /&gt;
[[Category:Teaching Material]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>