Namespaces

Variants
Actions

MSP Filter Tutorial 5: Parallel Filters

From Cycling '74 Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Click here to open the tutorial patch: 05fParallelFilters.maxpat In this tutorial, we'll look at creating ''networks'' of filters to make complex, time-varying timbres ...")
 
(The impulse)
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
Click here to open the tutorial patch: [[05fParallelFilters.maxpat]]
 
Click here to open the tutorial patch: [[05fParallelFilters.maxpat]]
  
In this tutorial, we'll look at creating ''networks'' of filters
+
In this tutorial, we'll look at creating ''networks'' of filters to make complex, time-varying timbres using an oscillator input.
to make complex, time-varying timbres using an oscillator input.
+
  
 
===The impulse===
 
===The impulse===
  
Look at the tutorial patch. It contains a few sound-producing
+
Look at the tutorial patch. It contains several sound-producing objects connected to a network of filter objects: three {{maxword|name=reson~}} objects in parallel and a {{maxword|name=lores~}} object in series with their outputs. The audio input for the filter network comes from a {{maxword|name=receive~}} object named <code>filterin</code>, allowing us to generate signals for our filters remotely.
objects connected to a network of filter objects: three {{maxword|name=reson~}}
+
objects in parallel and a {{maxword|name=lores~}} object in series with their
+
outputs. The audio input for the filter network comes from a {{maxword|name=receive~}} object named <code>filterin</code>, allowing us to generate signals for our filters remotely.
+
  
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. At the bottom of the patcher,
+
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. At the bottom of the patcher, adjust the {{maxword|name=number}} box labeled 'Dry Volume'. In the area of the patcher labeled <code>1</code>, click the {{maxword|name=button}} attached to the {{maxword|name=click~}} object. As per its name, you should hear a click!
adjust the {{maxword|name=number}} box labeled 'Dry Volume'. In the area of
+
the patcher labeled <code>1</code>, click the {{maxword|name=button}} attached to
+
the {{maxword|name=click~}} object. As per its name, you should hear a click!
+
  
The {{maxword|name=click~}} object generates a constant signal of <code>0</code>.
+
The {{maxword|name=click~}} object generates a constant signal of <code>0</code>. When you sent it a <code>bang</code> message, it outputs a ''single sample'' of value <code>1</code>, then returns to sending <code>0</code>'s. This is called an ''impulse'', and in an idea world generates an eve. spread of energy across all frequencies; we could think of it as the shortest possible burst of white noise we can create in our digital system. Sending a click through a filter returns a sound that has the exact frequency characteristics of that filter. We call this taking the ''impulse response'' of a signal chain.
When you sent it a <code>bang</code> message, it outputs a ''single
+
sample'' of value <code>1</code>, then returns to sending <code>0</code>'s.
+
This is called an ''impulse'', and in an idea world generates
+
an eve. spread of energy across all frequencies; we could think
+
of it as the shortest possible burst of white noise we can create
+
in our digital system. Sending a click through a filter returns
+
a sound that has the exact frequency characteristics of that filter.
+
We call this taking the ''impulse response'' of a signal chain.
+
  
* Click on a note in the {{maxword|name=kslider}} object at the top of the
+
* Click on a note in the {{maxword|name=kslider}} object at the top of the tutorial patcher in the area labeled <code>2</code>. You should hear a sawtooth wave fade in and out with a smooth envelope.
tutorial patcher in the area labeled <code>2</code>. You should hear a
+
sawtooth wave fade in and out with a smooth envelope.
+
  
The {{maxword|name=saw~}} object in our patcher is in a signal chain where
+
The {{maxword|name=saw~}} object in our patcher is in a signal chain where it has an envelope (controlled by a {{maxword|name=function}}, a {{maxword|name=line~}}, and a {{maxword|name=*~}} object). If we adjust the {{maxword|name=function}} object, we can change the shape of the note that gets fired each time we click on a key in the {{maxword|name=kslider}} object.
it has an envelope (controlled by a {{maxword|name=function}}, a {{maxword|name=line~}},
+
and a {{maxword|name=*~}} object). If we adjust the {{maxword|name=function}} object,
+
we can change the shape of the note that gets fired each time we
+
click on a key in the {{maxword|name=kslider}} object.
+
  
 
===A network of filters===
 
===A network of filters===
  
* Turn down the 'Dry Volume' and turn up the {{maxword|name=number}} box
+
* Turn down the 'Dry Volume' and turn up the {{maxword|name=number}} box labeled 'Filtered Volume' at the bottom of the patcher. In the patcher area labeled <code>3</code>, click in the {{maxword|name=number}} box labeled 'Vowel'. Enter <code>0</code> in the {{maxword|name=number}} box and hit return. The <link type="refpage" name="number">number box</link> objects connected to the {{maxword|name=line~}} objects below should read <code>270., 2290., and 3010.</code>. Click on the {{maxword|name=kslider}} to play some notes. Click in the 'Vowel' {{maxword|name=number}} box and enter different values between <code>0</code> and <code>9</code> and listen to the results. Double-click the {{maxword|name=coll}} object named <code>formants</code> and look at the contents.
labeled 'Filtered Volume' at the bottom of the patcher. In the
+
patcher area labeled <code>3</code>, click in the {{maxword|name=number}} box
+
labeled 'Vowel'. Enter <code>0</code> in the {{maxword|name=number}} box and hit
+
return. The <link type="refpage" name="number">number box</link> objects connected to the {{maxword|name=line~}} objects
+
below should read <code>270., 2290., and 3010.</code>. Click on
+
the {{maxword|name=kslider}} to play some notes. Click in the 'Vowel'
+
{{maxword|name=number}} box and enter different values between <code>0</code> and
+
<code>9</code> and listen to the results. Double-click the {{maxword|name=coll}}
+
object named <code>formants</code> and look at the contents.
+
  
The {{maxword|name=coll}} object in our patcher contains ten lists of frequency
+
The {{maxword|name=coll}} object in our patcher contains ten lists of frequency values which correspond to the average ''formats'' for vowels in the English language ("ooo", "eee", "ah", etc.). In human speech, our lungs project air through our vocal chords, which modulate the air pressure into a regular waveform. Our mouth shapes this waveform, filtering the signal based on the shape of our mouth. These vocalizations can be modeled as sets of three bandpass filters tuned to different frequencies, creating a simalcrum of the sound our voice makes. The shaping of a sound in this manner is called ''formant'' filtering, and can be created in MSP using the circuit in our tutorial patcher.
values which correspond to the average ''formats'' for vowels in
+
the English language ("ooo", "eee", "ah", etc.). In human speech,
+
our lungs project air through our vocal chords, which modulate the
+
air pressure into a regular waveform. Our mouth shapes this waveform,
+
filtering the signal based on the shape of our mouth. These
+
vocalizations can be modeled as sets of three bandpass filters
+
tuned to different frequencies, creating a simalcrum of the sound
+
our voice makes. The shaping of a sound in this manner is
+
called ''formant'' filtering, and can be created in MSP using
+
the circuit in our tutorial patcher.
+
  
* In the lower-right of the tutorial patcher, adjust the {{maxword|name=number}} box
+
* In the lower-right of the tutorial patcher, adjust the {{maxword|name=number}} box labeled 'Q' to <code>30.</code>. Click the {{maxword|name=toggle}} box attached to the {{maxword|name=metro}} object above labeled <code>Random?</code>. Play some notes on the {{maxword|name=kslider}}.
labeled 'Q' to <code>30.</code>. Click the {{maxword|name=toggle}} box attached to
+
the {{maxword|name=metro}} object above labeled <code>Random?</code>. Play some
+
notes on the {{maxword|name=kslider}}.
+
  
Tightening the Q on our format filters makes the sound more
+
Tightening the Q on our format filters makes the sound more obviously 'vocal', as the resonation of the filters cuts out any extraneous energy from our sawtooth waveform.
obviously 'vocal', as the resonation of the filters cuts out any
+
extraneous energy from our sawtooth waveform.
+
  
* In the patcher area labeled <code>4</code>, adjust the {{maxword|name=number}} box
+
* In the patcher area labeled <code>4</code>, adjust the {{maxword|name=number}} box labeled 'Cutoff frequency' to <code>5000</code>. Play some notes. Adjust it down to something low, like <code>200</code>.
labeled 'Cutoff frequency' to <code>5000</code>. Play some notes.
+
Adjust it down to something low, like <code>200</code>.
+
  
The output of our formant filters feed into a lowpass filter
+
The output of our formant filters feed into a lowpass filter controlled by a {{maxword|name=lores~}} object. This cuts the treble from out sawtooth after it passes through the bandpass network of the {{maxword|name=reson~}} objects. Changing this value also changes the quality of the vocal model.
controlled by a {{maxword|name=lores~}} object. This cuts the treble from
+
out sawtooth after it passes through the bandpass network of the
+
{{maxword|name=reson~}} objects. Changing this value also changes the quality
+
of the vocal model.
+
  
* Adjust the values of the patcher to experiment with different ways to
+
* Adjust the values of the patcher to experiment with different ways to create a 'singing voice' out of a sawtooth wave and a filter network. The {{maxword|name=line~}} objects in the patcher attached to the filters control the interpolation between settings. If you unlock the patcher and change the second value in the {{maxword|name=message}} boxes, you can make the transitions smoother or more abrubt. Using the {{maxword|name=click~}} object, see how the different filter settings sound when driven by an impulse.
create a 'singing voice' out of a sawtooth wave and a filter network.
+
The {{maxword|name=line~}} objects in the patcher attached to the filters
+
control the interpolation between settings. If you unlock the patcher
+
and change the second value in the {{maxword|name=message}} boxes, you can
+
make the transitions smoother or more abrubt. Using the {{maxword|name=click~}}
+
object, see how the different filter settings sound when driven by an
+
impulse.
+
  
 
===Summary===
 
===Summary===
  
The filter objects in MSP can be connected into networks of filters that
+
The filter objects in MSP can be connected into networks of filters that can be used in all manner of interesting ways. Bandpass filters (such as {{maxword|name=reson~}}) can be used in parallel to simulate the 'formants' of instruments or human speech. The {{maxword|name=click~}} object allows you to test the ''impulse response'' of a filter network by sending a single positive sample through it, generating a pure impression of the frequency response of the filter.
can be used in all manner of interesting ways. Bandpass filters (such
+
as {{maxword|name=reson~}}) can be used in parallel to simulate the 'formants'
+
of instruments or human speech. The {{maxword|name=click~}} object allows you to
+
test the ''impulse response'' of a filter network by sending a single
+
positive sample through it, generating a pure impression of the frequency
+
response of the filter.
+
  
 
===See Also===
 
===See Also===

Revision as of 15:24, 13 August 2012

Click here to open the tutorial patch: 05fParallelFilters.maxpat

In this tutorial, we'll look at creating networks of filters to make complex, time-varying timbres using an oscillator input.

Contents

The impulse

Look at the tutorial patch. It contains several sound-producing objects connected to a network of filter objects: three reson~ objects in parallel and a lores~ object in series with their outputs. The audio input for the filter network comes from a receive~ object named filterin, allowing us to generate signals for our filters remotely.

  • Turn on the audio in the patcher by clicking on the ezdac~ object. At the bottom of the patcher, adjust the number box labeled 'Dry Volume'. In the area of the patcher labeled 1, click the button attached to the click~ object. As per its name, you should hear a click!

The click~ object generates a constant signal of 0. When you sent it a bang message, it outputs a single sample of value 1, then returns to sending 0's. This is called an impulse, and in an idea world generates an eve. spread of energy across all frequencies; we could think of it as the shortest possible burst of white noise we can create in our digital system. Sending a click through a filter returns a sound that has the exact frequency characteristics of that filter. We call this taking the impulse response of a signal chain.

  • Click on a note in the kslider object at the top of the tutorial patcher in the area labeled 2. You should hear a sawtooth wave fade in and out with a smooth envelope.

The saw~ object in our patcher is in a signal chain where it has an envelope (controlled by a function, a line~, and a *~ object). If we adjust the function object, we can change the shape of the note that gets fired each time we click on a key in the kslider object.

A network of filters

  • Turn down the 'Dry Volume' and turn up the number box labeled 'Filtered Volume' at the bottom of the patcher. In the patcher area labeled 3, click in the number box labeled 'Vowel'. Enter 0 in the number box and hit return. The <link type="refpage" name="number">number box</link> objects connected to the line~ objects below should read 270., 2290., and 3010.. Click on the kslider to play some notes. Click in the 'Vowel' number box and enter different values between 0 and 9 and listen to the results. Double-click the coll object named formants and look at the contents.

The coll object in our patcher contains ten lists of frequency values which correspond to the average formats for vowels in the English language ("ooo", "eee", "ah", etc.). In human speech, our lungs project air through our vocal chords, which modulate the air pressure into a regular waveform. Our mouth shapes this waveform, filtering the signal based on the shape of our mouth. These vocalizations can be modeled as sets of three bandpass filters tuned to different frequencies, creating a simalcrum of the sound our voice makes. The shaping of a sound in this manner is called formant filtering, and can be created in MSP using the circuit in our tutorial patcher.

  • In the lower-right of the tutorial patcher, adjust the number box labeled 'Q' to 30.. Click the toggle box attached to the metro object above labeled Random?. Play some notes on the kslider.

Tightening the Q on our format filters makes the sound more obviously 'vocal', as the resonation of the filters cuts out any extraneous energy from our sawtooth waveform.

  • In the patcher area labeled 4, adjust the number box labeled 'Cutoff frequency' to 5000. Play some notes. Adjust it down to something low, like 200.

The output of our formant filters feed into a lowpass filter controlled by a lores~ object. This cuts the treble from out sawtooth after it passes through the bandpass network of the reson~ objects. Changing this value also changes the quality of the vocal model.

  • Adjust the values of the patcher to experiment with different ways to create a 'singing voice' out of a sawtooth wave and a filter network. The line~ objects in the patcher attached to the filters control the interpolation between settings. If you unlock the patcher and change the second value in the message boxes, you can make the transitions smoother or more abrubt. Using the click~ object, see how the different filter settings sound when driven by an impulse.

Summary

The filter objects in MSP can be connected into networks of filters that can be used in all manner of interesting ways. Bandpass filters (such as reson~) can be used in parallel to simulate the 'formants' of instruments or human speech. The click~ object allows you to test the impulse response of a filter network by sending a single positive sample through it, generating a pure impression of the frequency response of the filter.

See Also

click~ - Create an impulse