Namespaces

Variants
Actions

MSP Filter Tutorial 4: Subtractive Synthesis

From Cycling '74 Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Click here to open the tutorial patch: 04fSubtractiveSynthesis.maxpat In this tutorial, we'll look at using filters creatively with a group of MSP audio generators that...")
 
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
Click here to open the tutorial patch: [[04fSubtractiveSynthesis.maxpat]]
+
Click here to open the tutorial patch: [[Media:04fSubtractiveSynthesis.maxpat]]
  
In this tutorial, we'll look at using filters creatively with a group of
+
In this tutorial, we'll look at using filters creatively with a group of MSP audio generators that create different kinds of {{maxword|name=noise~}}. Noise generation is a core component of ''subtractive synthesis'', a sound design methodology that works by taking complex signsl and sculpting them with filters, subtracting energy from the original signal (compare this with additive synthesis, which works in the opposite fashion). Along the way, we'll discuss ways to shape this noise using an object that creates and controls a ''bank'' of parallel filters.
MSP audio generators that create different kinds of {{maxword|name=noise~}}.
+
Noise generation is a core component of ''subtractive synthesis'',
+
a sound design methodology that works by taking complex signsl and
+
sculpting them with filters, subtracting energy from the original
+
signal (compare this with additive synthesis, which works in the
+
opposite fashion). Along the way, we'll discuss ways to shape this
+
noise using an object that creates and controls a ''bank'' of
+
parallel filters.
+
  
 
===Noise===
 
===Noise===
  
Take a look at our tutorial patcher. It consists of three patcher regions.
+
Take a look at our tutorial patcher. It consists of three patcher regions. If we look at the area labeled <code>1</code>, we can see that we have three new MSP objects connected through {{maxword|name=*~}} objects to the {{maxword|name=dac~}}.
If we look at the area labeled <code>1</code>, we can see that we have three new
+
MSP objects connected through {{maxword|name=*~}} objects to the {{maxword|name=dac~}}.
+
  
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. Adjust the {{maxword|name=number}} box
+
* Turn on the audio in the patcher by clicking on the {{maxword|name=ezdac~}} object. Adjust the {{maxword|name=number}} box that controls the volume for the {{maxword|name=noise~}} object and listen to the result. Turn it down and turn up the volume for the {{maxword|name=pink~}} object. Do the same for the {{maxword|name=rand~}} object. Click in the {{maxword|name=number}} box that is connected to the inlet of the {{maxword|name=rand~}} object (labeled 'Frequency'). Type <code>100</code> and hit return. Try <code>1000</code> and hit return.Experiment with other values.
that controls the volume for the {{maxword|name=noise~}} object and listen to
+
the result. Turn it down and turn up the volume for the {{maxword|name=pink~}} object.
+
Do the same for the {{maxword|name=rand~}} object. Click in the {{maxword|name=number}} box
+
that is connected to the inlet of the {{maxword|name=rand~}} object (labeled 'Frequency').
+
Type <code>100</code> and hit return. Try <code>1000</code> and hit return.Experiment with
+
other values.
+
  
The {{maxword|name=noise~}}, {{maxword|name=pink~}}, and {{maxword|name=rand~}} objects all generate ''noise''
+
The {{maxword|name=noise~}}, {{maxword|name=pink~}}, and {{maxword|name=rand~}} objects all generate ''noise'' at a signal rate. Noise, at its essence, is a type of random number generation; as a result, these objects behave in a similar manner to Max objects such as {{maxword|name=random}} and {{maxword|name=drunk}}.
at a signal rate. Noise, at its essence, is a type of random number generation;
+
as a result, these objects behave in a similar manner to Max objects
+
such as {{maxword|name=random}} and {{maxword|name=drunk}}.
+
  
The {{maxword|name=noise~}} object generates ''white noise'', which means that all
+
The {{maxword|name=noise~}} object generates ''white noise'', which means that all possible frequencies in the audio spectrum are equally represented over time. The process of generating white noise digitally is quite simple: every sample, pick a random number between <code>-1</code> and <code>1</code>:
possible frequencies in the audio spectrum are equally represented over time.
+
The process of generating white noise digitally is quite simple: every sample,
+
pick a random number between <code>-1</code> and <code>1</code>:
+
  
 
[[Image:Filterchapter04a.png|border]]
 
[[Image:Filterchapter04a.png|border]]
 +
 
''A waveform and spectrogram plot of white noise.''
 
''A waveform and spectrogram plot of white noise.''
  
The {{maxword|name=pink~}} object generates ''pink noise'', which means that
+
The {{maxword|name=pink~}} object generates ''pink noise'', which means that every ''octave'' in the audio spectrum has equal weight. This is sometimes referred to as ''1/f'' noise, as the probability of a frequency occuring is the inverse of its value, e.g. frequencies of 100 Hz are twice as probable as 200 Hz. The aural difference between the two is fairly obvious: white noise has far more high frequency content and sounds 'harsher' than pink noise:
every ''octave'' in the audio spectrum has equal weight. This is
+
sometimes referred to as ''1/f'' noise, as the probability of a
+
frequency occuring is the inverse of its value, e.g. frequencies of
+
100 Hz are twice as probable as 200 Hz. The aural difference between
+
the two is fairly obvious: white noise has far more high frequency
+
content and sounds 'harsher' than pink noise:
+
  
 
[[Image:Filterchapter04b.png|border]]
 
[[Image:Filterchapter04b.png|border]]
 +
 
''Pink (1/f) noise: waveform and spectrogram.''
 
''Pink (1/f) noise: waveform and spectrogram.''
  
The {{maxword|name=rand~}} object is a random number generator that generates a
+
The {{maxword|name=rand~}} object is a random number generator that generates a signal, picking a new random value for that signal at a variable rate. It takes an argument (or a value at its inlet) to set the frequency of the random number selection. A frequency of <code>44100</code> makes the object indistinguishable from white noise. This allows us to create ''band-limited'' noise that has an upper boundary we can specify:
signal, picking a new random value for that signal at a variable rate.
+
It takes an argument (or a value at its inlet) to set the frequency of
+
the random number selection. A frequency of <code>44100</code> makes the object
+
indistinguishable from white noise. This allows us to create ''band-limited'' noise
+
that has an upper boundary we can specify:
+
  
 
[[Image:Filterchapter04c.png|border]]
 
[[Image:Filterchapter04c.png|border]]
 +
 
''A {{maxword|name=rand~}} object picking values at <code>1000</code> Hz: waveform and spectrogram.''
 
''A {{maxword|name=rand~}} object picking values at <code>1000</code> Hz: waveform and spectrogram.''
  
 
===Filtering noise===
 
===Filtering noise===
  
Because noise has such broadband frequency content, it can be filtered
+
Because noise has such broadband frequency content, it can be filtered and sculpted to create very precise timbres. The compositional technique of subtractive synthesis relies on this attribute of noise generation; it's often easier (or more efficient) to start with noise and filter it down then attempt to create the desired timbre through adding oscillators.
and sculpted to create very precise timbres. The compositional technique
+
of subtractive synthesis relies on this attribute of noise generation; it's
+
often easier (or more efficient) to start with noise and filter it down then
+
attempt to create the desired timbre through adding oscillators.
+
  
* Turn down the volumes in patcher area <code>1</code> and take a look at patcher
+
* Turn down the volumes in patcher area <code>1</code> and take a look at patcher area <code>2</code>. Turn up the volume using the {{maxword|name=number}} box at the bottom of the signal chain (controlling the {{maxword|name=*~}} object connected to the {{maxword|name=dac~}}). Click in the {{maxword|name=number}} box labeled 'Frequency' connected to the {{maxword|name=phasor~}} object, type <code>0.1</code> and hit return. Type a higher frequency (e.g. <code>3.0</code>) and hit return. Experiment with different values.
area <code>2</code>. Turn up the volume using the {{maxword|name=number}} box at the bottom
+
of the signal chain (controlling the {{maxword|name=*~}} object connected to the {{maxword|name=dac~}}).
+
Click in the {{maxword|name=number}} box labeled 'Frequency' connected to
+
the {{maxword|name=phasor~}} object, type <code>0.1</code> and hit return. Type a higher
+
frequency (e.g. <code>3.0</code>) and hit return. Experiment with different values.
+
  
Patcher area <code>2</code> contains a {{maxword|name=noise~}} object sending its signal into
+
Patcher area <code>2</code> contains a {{maxword|name=noise~}} object sending its signal into a {{maxword|name=lores~}} filter. The frequency of the lowpass filter is being modulated by a {{maxword|name=phasor~}}, which we've scaled to ramp between <code>100</code> and <code>600</code> at the frequency we specify. As a result, the cutoff frequency of the filter 'sweeps' at regular intervals. This is an example of an ''LFO'', or ''low-frequency oscillator'', being used to modulate a parameter of an audio processing system. As you can hear, the {{maxword|name=lores~}} object attenuates the high frequencies output from the {{maxword|name=noise~}} object. In addition, the resonance value of the {{maxword|name=lores~}} causes the filter to have a peak just below its cutoff frequency, giving a notably 'pitched' sound to the filtered noise.
a {{maxword|name=lores~}} filter. The frequency of the lowpass filter is being modulated
+
by a {{maxword|name=phasor~}}, which we've scaled to ramp between <code>100</code> and <code>600</code>
+
at the frequency we specify. As a result, the cutoff frequency of the filter 'sweeps'
+
at regular intervals. This is an example of an ''LFO'', or ''low-frequency oscillator'',
+
being used to modulate a parameter of an audio processing system. As you can hear,
+
the {{maxword|name=lores~}} object attenuates the high frequencies output from the {{maxword|name=noise~}} object.
+
In addition, the resonance value of the {{maxword|name=lores~}} causes the filter to
+
have a peak just below its cutoff frequency, giving a notably 'pitched' sound
+
to the filtered noise.
+
  
 
===Banks of filters===
 
===Banks of filters===
  
* Turn down the volume on area <code>2</code> in the tutorial patcher and take
+
* Turn down the volume on area <code>2</code> in the tutorial patcher and take a look at area <code>3</code>. One-by-one, turn up and down the {{maxword|name=gain~}} sliders connected to the {{maxword|name=dac~}} object.
a look at area <code>3</code>. One-by-one, turn up and down the {{maxword|name=gain~}} sliders
+
 
connected to the {{maxword|name=dac~}} object.
+
The {{maxword|name=fffb~}} object stands for ''Fast, Fixed, Filter Bank''. Unlike the {{maxword|name=cascade~}} object, which implements a number of {{maxword|name=biquad~}} filters in series, the {{maxword|name=fffb~}} object arranges a number of {{maxword|name=reson~}} objects in ''parallel'', which is to say that the settings of one filter will not affect any of the others. The {{maxword|name=fffb~}} object takes a number of arguments which set its behavior: the ''number'' of filters, the ''base frequency'' of the filter bank, the ''ratio'' between filters, and the ''Q'' of the filters. All of the parameters of the object with the exception of the number of filters can be changed with Max messages; the number is fixed because, as we can see, each filter connects to a separate outlet. This allows us to create filter banks, where we can 'tap' each bandpass filter individually:
  
The {{maxword|name=fffb~}} object stands for ''Fast, Fixed, Filter Bank''. Unlike
+
[[Image:Filterchapter04d.png|border]]
the {{maxword|name=cascade~}} object, which implements a number of {{maxword|name=biquad~}} filters
+
in series, the {{maxword|name=fffb~}} object arranges a number of {{maxword|name=reson~}} objects
+
in ''parallel'', which is to say that the settings of one filter will not
+
affect any of the others. The {{maxword|name=fffb~}} object takes a number of arguments
+
which set its behavior: the ''number'' of filters, the ''base frequency'' of
+
the filter bank, the ''ratio'' between filters, and the ''Q'' of the filters.
+
All of the parameters of the object with the exception of the number of filters
+
can be changed with Max messages; the number is fixed because, as we can see,
+
each filter connects to a separate outlet. This allows us to create filter banks,
+
where we can 'tap' each bandpass filter individually:
+
  
[[Image:Filterchapter04d.gif"/><img src="images/filterchapter04e.png|border]]
+
''Output of the lowest and highest two filters in our {{maxword|name=fffb~}} object: waveform and spectrogram.''
''Output of the lowest and highest two filters in our {{maxword|name=fffb~}} object:
+
waveform and spectrogram.''
+
  
* Using the mouse, click and drag on the {{maxword|name=dial}} object in patcher area <code>3</code>.
+
* Using the mouse, click and drag on the {{maxword|name=dial}} object in patcher area <code>3</code>. This has the audible effect of shifting the entire filter bank upwards or downwards. Turn up different {{maxword|name=gain~}} sliders to hear the results.
This has the audible effect of shifting the entire filter bank upwards or
+
downwards. Turn up different {{maxword|name=gain~}} sliders to hear the results.
+
  
The value from the {{maxword|name=dial}} is interpreted as a MIDI pitch, converted
+
The value from the {{maxword|name=dial}} is interpreted as a MIDI pitch, converted to frequency (via the {{maxword|name=mtof}}) object, and used to format the <code>freqRatio</code> message to the {{maxword|name=fffb~}} object. The <code>freqRatio</code> message takes two arguments: the center frequency of the first (lowest) filter, and the ''ratio'' between it and subsequent filters. The letter <code>H</code>, when used as the ratio, tells the {{maxword|name=fffb~}} object to set the filters in the bank to ''harmonic'' multiples of the base frequency. So the message <code>freqRatio 100. H</code> would set our ten filters up to be centered to <code>100</code> Hz increments.
to frequency (via the {{maxword|name=mtof}}) object, and used to format the <code>freqRatio</code>
+
message to the {{maxword|name=fffb~}} object. The <code>freqRatio</code> message takes
+
two arguments: the center frequency of the first (lowest) filter,
+
and the ''ratio'' between it and subsequent filters. The
+
letter <code>H</code>, when used as the ratio, tells the {{maxword|name=fffb~}} object
+
to set the filters in the bank to ''harmonic'' multiples of the base
+
frequency. So the message <code>freqRatio 100. H</code> would set our ten
+
filters up to be centered to <code>100</code> Hz increments.
+
  
* Click in the <link type="refpage" name="number">number box</link> objects connected to the {{maxword|name=pak}} object.
+
* Click in the <link type="refpage" name="number">number box</link> objects connected to the {{maxword|name=pak}} object. Type <code>200.</code> in the lefthand {{maxword|name=number}} box, and <code>1.5</code> in the righthand {{maxword|name=number}} box. Click on the {{maxword|name=number}} box connect to the <code>message</code> box containing the message <code>QAll $1</code>. Enter the value <code>100.</code> and hit return. Turn up and down the different {{maxword|name=gain~}} sliders to hear the results.
Type <code>200.</code> in the lefthand {{maxword|name=number}} box, and <code>1.5</code> in
+
the righthand {{maxword|name=number}} box. Click on the {{maxword|name=number}} box connect
+
to the <code>message</code> box containing the message <code>QAll $1</code>. Enter
+
the value <code>100.</code> and hit return. Turn up and down the
+
different {{maxword|name=gain~}} sliders to hear the results.
+
  
We can easily set our filters in a frequency ratio other than a
+
We can easily set our filters in a frequency ratio other than a harmonic series. Setting our base frequency to <code>200.</code> and our ratio to <code>1.5</code> results in a bank of ten filters set to the frequencies <code>200, 300, 450, 675, 1012.5, 1518.75, 2278.125, 3417.1875, 5125.78125, 7688.671875, and 11533.0078125</code> Hz, respectively. As with the {{maxword|name=reson~}} object, we have direct control over the ''Q'' of these filters. A Q of <code>100</code> r esults in a bandwidth of 1/100 the frequency, creating narrow, pitched filters.
harmonic series. Setting our base frequency to <code>200.</code> and
+
our ratio to <code>1.5</code> results in a bank of ten filters set to
+
the frequencies <code>200, 300, 450, 675, 1012.5, 1518.75, 2278.125,
+
3417.1875, 5125.78125, 7688.671875, and 11533.0078125</code> Hz,
+
respectively. As with the {{maxword|name=reson~}} object, we have direct
+
control over the ''Q'' of these filters. A Q of <code>100</code> r
+
esults in a bandwidth of 1/100 the frequency, creating narrow,
+
pitched filters.
+
  
* Click the <code>message</code> box to the right of patcher area <code>3</code>
+
* Click the <code>message</code> box to the right of patcher area <code>3</code> that contains a series of lists. Listen to the results by adjusting the {{maxword|name=gain~}} sliders.
that contains a series of lists. Listen to the results by adjusting
+
the {{maxword|name=gain~}} sliders.
+
  
The {{maxword|name=fffb~}} object takes many other messages, enabling
+
The {{maxword|name=fffb~}} object takes many other messages, enabling us to set the filters not in ratio at all. Sending lists in the format <code>filter_# frequency Q</code> allows us to set each filter in the bank individually. In our example, we've set the ten filters to frequencies from a musical chord.
us to set the filters not in ratio at all. Sending lists in
+
the format <code>filter_# frequency Q</code> allows us to set each
+
filter in the bank individually. In our example, we've set the
+
ten filters to frequencies from a musical chord.
+
  
 
===Metering===
 
===Metering===
  
Next to each {{maxword|name=gain~}} slider in patcher area <code>3</code> is a
+
Next to each {{maxword|name=gain~}} slider in patcher area <code>3</code> is a user-interface object that registers the amplitude of the signal connected to it. These {{maxword|name=meter~}} objects allow us to see the gain of each filter in the {{maxword|name=fffb~}} ''pre-fader'', i.e. before we listen to it.
user-interface object that registers the amplitude of the signal
+
connected to it. These {{maxword|name=meter~}} objects allow us to see the
+
gain of each filter in the {{maxword|name=fffb~}} ''pre-fader'',
+
i.e. before we listen to it.
+
  
* Turn down all the {{maxword|name=gain~}} sliders in patcher area <code>3</code>. Click
+
* Turn down all the {{maxword|name=gain~}} sliders in patcher area <code>3</code>. Click in the {{maxword|name=number}} box that triggers the <code>Qall</code> message. Type <code>0.5</code> and hit return. Type <code>10.</code> and hit return. Listen to the results and notice the effect of the Q on the gain of each filter, and look at how the {{maxword|name=meter~}} objects respond.
in the {{maxword|name=number}} box that triggers the <code>Qall</code> message.
+
Type <code>0.5</code> and hit return. Type <code>10.</code> and hit return. Listen
+
to the results and notice the effect of the Q on the gain of each filter,
+
and look at how the {{maxword|name=meter~}} objects respond.
+
  
Because the {{maxword|name=fffb~}} object works in parallel, the output gain of
+
Because the {{maxword|name=fffb~}} object works in parallel, the output gain of all the filters in the bank will typically be ''greater'' than the gain of the incoming signal. Depending on the Q values and the frequencies used, the potential volume output from the {{maxword|name=fffb~}} can be quite high. The {{maxword|name=meter~}} object lets you observe your volumes visually in the patcher window ''before'' you listen (and potentially hurt your ears).
all the filters in the bank will typically be ''greater'' than the
+
gain of the incoming signal. Depending on the Q values and the frequencies
+
used, the potential volume output from the {{maxword|name=fffb~}} can be quite
+
high. The {{maxword|name=meter~}} object lets you observe your volumes visually
+
in the patcher window ''before'' you listen (and potentially hurt
+
your ears).
+
  
 
===Summary===
 
===Summary===
  
MSP has three simple-to-use noise generator objects, which generate white
+
MSP has three simple-to-use noise generator objects, which generate white noise ({{maxword|name=noise~}}), pink noise ({{maxword|name=pink~}}), and band-limited random signals ({{maxword|name=rand~}}). These objects are ideal candidates for filtering. The {{maxword|name=fffb~}} object implements a fixed filter bank of parallel bandpass filters which can be controlled via ratios of a base frequency or individually. The {{maxword|name=meter~}} object allows you to visually see the amplitude of any part of the MSP signal path, and is incredibly useful for metering and debugging your audio patchers.
noise ({{maxword|name=noise~}}), pink noise ({{maxword|name=pink~}}), and band-limited random
+
signals ({{maxword|name=rand~}}). These objects are ideal candidates for filtering.
+
The {{maxword|name=fffb~}} object implements a fixed filter bank of parallel bandpass
+
filters which can be controlled via ratios of a base frequency or individually.
+
The {{maxword|name=meter~}} object allows you to visually see the amplitude of any part
+
of the MSP signal path, and is incredibly useful for metering and debugging
+
your audio patchers.
+
  
 
===See Also===
 
===See Also===

Latest revision as of 15:31, 28 June 2012

Click here to open the tutorial patch: Media:04fSubtractiveSynthesis.maxpat

In this tutorial, we'll look at using filters creatively with a group of MSP audio generators that create different kinds of noise~. Noise generation is a core component of subtractive synthesis, a sound design methodology that works by taking complex signsl and sculpting them with filters, subtracting energy from the original signal (compare this with additive synthesis, which works in the opposite fashion). Along the way, we'll discuss ways to shape this noise using an object that creates and controls a bank of parallel filters.

Contents

[edit] Noise

Take a look at our tutorial patcher. It consists of three patcher regions. If we look at the area labeled 1, we can see that we have three new MSP objects connected through *~ objects to the dac~.

  • Turn on the audio in the patcher by clicking on the ezdac~ object. Adjust the number box that controls the volume for the noise~ object and listen to the result. Turn it down and turn up the volume for the pink~ object. Do the same for the rand~ object. Click in the number box that is connected to the inlet of the rand~ object (labeled 'Frequency'). Type 100 and hit return. Try 1000 and hit return.Experiment with other values.

The noise~, pink~, and rand~ objects all generate noise at a signal rate. Noise, at its essence, is a type of random number generation; as a result, these objects behave in a similar manner to Max objects such as random and drunk.

The noise~ object generates white noise, which means that all possible frequencies in the audio spectrum are equally represented over time. The process of generating white noise digitally is quite simple: every sample, pick a random number between -1 and 1:

Filterchapter04a.png

A waveform and spectrogram plot of white noise.

The pink~ object generates pink noise, which means that every octave in the audio spectrum has equal weight. This is sometimes referred to as 1/f noise, as the probability of a frequency occuring is the inverse of its value, e.g. frequencies of 100 Hz are twice as probable as 200 Hz. The aural difference between the two is fairly obvious: white noise has far more high frequency content and sounds 'harsher' than pink noise:

Filterchapter04b.png

Pink (1/f) noise: waveform and spectrogram.

The rand~ object is a random number generator that generates a signal, picking a new random value for that signal at a variable rate. It takes an argument (or a value at its inlet) to set the frequency of the random number selection. A frequency of 44100 makes the object indistinguishable from white noise. This allows us to create band-limited noise that has an upper boundary we can specify:

Filterchapter04c.png

A rand~ object picking values at 1000 Hz: waveform and spectrogram.

[edit] Filtering noise

Because noise has such broadband frequency content, it can be filtered and sculpted to create very precise timbres. The compositional technique of subtractive synthesis relies on this attribute of noise generation; it's often easier (or more efficient) to start with noise and filter it down then attempt to create the desired timbre through adding oscillators.

  • Turn down the volumes in patcher area 1 and take a look at patcher area 2. Turn up the volume using the number box at the bottom of the signal chain (controlling the *~ object connected to the dac~). Click in the number box labeled 'Frequency' connected to the phasor~ object, type 0.1 and hit return. Type a higher frequency (e.g. 3.0) and hit return. Experiment with different values.

Patcher area 2 contains a noise~ object sending its signal into a lores~ filter. The frequency of the lowpass filter is being modulated by a phasor~, which we've scaled to ramp between 100 and 600 at the frequency we specify. As a result, the cutoff frequency of the filter 'sweeps' at regular intervals. This is an example of an LFO, or low-frequency oscillator, being used to modulate a parameter of an audio processing system. As you can hear, the lores~ object attenuates the high frequencies output from the noise~ object. In addition, the resonance value of the lores~ causes the filter to have a peak just below its cutoff frequency, giving a notably 'pitched' sound to the filtered noise.

[edit] Banks of filters

  • Turn down the volume on area 2 in the tutorial patcher and take a look at area 3. One-by-one, turn up and down the gain~ sliders connected to the dac~ object.

The fffb~ object stands for Fast, Fixed, Filter Bank. Unlike the cascade~ object, which implements a number of biquad~ filters in series, the fffb~ object arranges a number of reson~ objects in parallel, which is to say that the settings of one filter will not affect any of the others. The fffb~ object takes a number of arguments which set its behavior: the number of filters, the base frequency of the filter bank, the ratio between filters, and the Q of the filters. All of the parameters of the object with the exception of the number of filters can be changed with Max messages; the number is fixed because, as we can see, each filter connects to a separate outlet. This allows us to create filter banks, where we can 'tap' each bandpass filter individually:

Filterchapter04d.png

Output of the lowest and highest two filters in our fffb~ object: waveform and spectrogram.

  • Using the mouse, click and drag on the dial object in patcher area 3. This has the audible effect of shifting the entire filter bank upwards or downwards. Turn up different gain~ sliders to hear the results.

The value from the dial is interpreted as a MIDI pitch, converted to frequency (via the mtof) object, and used to format the freqRatio message to the fffb~ object. The freqRatio message takes two arguments: the center frequency of the first (lowest) filter, and the ratio between it and subsequent filters. The letter H, when used as the ratio, tells the fffb~ object to set the filters in the bank to harmonic multiples of the base frequency. So the message freqRatio 100. H would set our ten filters up to be centered to 100 Hz increments.

  • Click in the <link type="refpage" name="number">number box</link> objects connected to the pak object. Type 200. in the lefthand number box, and 1.5 in the righthand number box. Click on the number box connect to the message box containing the message QAll $1. Enter the value 100. and hit return. Turn up and down the different gain~ sliders to hear the results.

We can easily set our filters in a frequency ratio other than a harmonic series. Setting our base frequency to 200. and our ratio to 1.5 results in a bank of ten filters set to the frequencies 200, 300, 450, 675, 1012.5, 1518.75, 2278.125, 3417.1875, 5125.78125, 7688.671875, and 11533.0078125 Hz, respectively. As with the reson~ object, we have direct control over the Q of these filters. A Q of 100 r esults in a bandwidth of 1/100 the frequency, creating narrow, pitched filters.

  • Click the message box to the right of patcher area 3 that contains a series of lists. Listen to the results by adjusting the gain~ sliders.

The fffb~ object takes many other messages, enabling us to set the filters not in ratio at all. Sending lists in the format filter_# frequency Q allows us to set each filter in the bank individually. In our example, we've set the ten filters to frequencies from a musical chord.

[edit] Metering

Next to each gain~ slider in patcher area 3 is a user-interface object that registers the amplitude of the signal connected to it. These meter~ objects allow us to see the gain of each filter in the fffb~ pre-fader, i.e. before we listen to it.

  • Turn down all the gain~ sliders in patcher area 3. Click in the number box that triggers the Qall message. Type 0.5 and hit return. Type 10. and hit return. Listen to the results and notice the effect of the Q on the gain of each filter, and look at how the meter~ objects respond.

Because the fffb~ object works in parallel, the output gain of all the filters in the bank will typically be greater than the gain of the incoming signal. Depending on the Q values and the frequencies used, the potential volume output from the fffb~ can be quite high. The meter~ object lets you observe your volumes visually in the patcher window before you listen (and potentially hurt your ears).

[edit] Summary

MSP has three simple-to-use noise generator objects, which generate white noise (noise~), pink noise (pink~), and band-limited random signals (rand~). These objects are ideal candidates for filtering. The fffb~ object implements a fixed filter bank of parallel bandpass filters which can be controlled via ratios of a base frequency or individually. The meter~ object allows you to visually see the amplitude of any part of the MSP signal path, and is incredibly useful for metering and debugging your audio patchers.

[edit] See Also

noise~ - White noise generator

pink~ - Pink noise generator

rand~ - Band-limited random signal

fffb~ - Fast fixed filter bank

meter~ - Visual peak level indicator