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...")
 
Line 104: Line 104:
  
 
[[Image:Filterchapter04d.gif"/><img src="images/filterchapter04e.png|border]]
 
[[Image:Filterchapter04d.gif"/><img src="images/filterchapter04e.png|border]]
 +
 
''Output of the lowest and highest two filters in our {{maxword|name=fffb~}} object:
 
''Output of the lowest and highest two filters in our {{maxword|name=fffb~}} object:
 
waveform and spectrogram.''
 
waveform and spectrogram.''

Revision as of 21:23, 22 June 2012

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 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.

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.

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.

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:

[[Image:Filterchapter04d.gif"/>Error: bad URI in <img>!