Write your own filter, and watch what it does
One line of maths is a low-pass filter. The figures on this page run that line in your browser: they show what it does to every frequency and to a single click, and they change as you turn its knob. Press Play it to hear the same filter on a bass line.
- You'll writea filter in one line, with
y': the output one sample ago. - You'll seeits Response (what it does to each frequency) and its Impulse (what one click becomes).
- You'll hearfour of them in a row, with feedback, ring as their poles slide out to the unit circle.
1One line
Every sample, the output y moves a share a of the way from where it was, y', towards the input x:
module OnePole in x out y setting a: 0.08, from 0.005 to 1 y = y' + a * (x - y')end
A fast wiggle in x is gone before y has moved far, and a slow one is followed almost exactly. Slow passes, fast doesn't: that's a low-pass filter.
2Why the click tells you everything
Send in one click, a single 1 and then silence. The first output is a. After that the input is 0, so each sample keeps 1 − a of the one before: a fade that never quite ends. That fade is the filter's impulse response.
Any sound is a row of clicks of different sizes, so the filter's output is its impulse response added up for each one. The Response view is worked out from the impulse response itself (SynthMaker plays the module one click and measures it), so what you see is what you hear.
3Four in a row, and feedback
Put four of the same line in a row and you get a steeper low-pass. Now take the last output, one sample ago, and subtract a share of it from the input, feedback * y':
module Ladder in x out y setting a: 0.1, from 0.005 to 1 setting feedback: 0, from 0 to 4.4 s1 = s1' + a * (x - feedback * y' - s1') s2 = s2' + a * (s1 - s2') s3 = s3' + a * (s2 - s3') y = y' + a * (s3 - y')end
Each stage lags a little behind its input, and at one frequency the four lags add up to half a cycle: there the part fed back is upside down, so subtracting it adds to it. Turn feedback up and that frequency grows a peak.
4Watch a module of your own
An Analyzer passes the sound through untouched and shows it. Put one straight after a Code module and three of its views show what the module itself does: Response, Impulse and Poles. They're worked out from the module at its settings now, so there's no need to play a note, and they move as you turn its knobs.
- Open Smooth Pluck and choose Code. Under
smooth = Smooth(cutoff: 1.2 kHz), addlook = Analyzer(). - In the first wire line, put
lookstraight aftersmooth. - Choose Patch. The Analyzer's card is with the others (beside the Patch on a computer, under it on a phone); in the menu under its picture, choose Response.
- Turn Smooth's Cutoff on its card: the curve slides with it.
smooth = Smooth(cutoff: 1.2 kHz)look = Analyzer() …voice -> osc1 -> filter1 -> smooth -> look -> vca1 -> out
| View | What it shows |
|---|---|
| Response | The module's gain at every frequency, 20 Hz on the left to 20 kHz on the right, in dB (the bright line; the lines across are 12 dB apart), and its phase (the amber line). |
| Impulse | What the module puts out after one click, sample by sample. Under it, choose 64, 512 or 4096 samples. |
| Poles | Its poles (×) and zeros (○), drawn with the unit circle. |
| Scope and Spectrum | The sound itself as it passes, while you play: its wave, or its frequencies. |
Read Smooth's Response from the left: flat at 0 dB, so the lows pass as they are. At the cutoff it's 3 dB down, and above it the curve falls about 6 dB for every octave higher. One pole, one gentle slope. Turn the cutoff down and the × slides towards the circle, the fade gets longer and the curve falls sooner.
Ready-made
Smooth Pluck with the Analyzer already after Smooth. It starts as a Scope: choose Response, Impulse or Poles in its menu.
Open the example sound: Smooth, watched ↗ (opens in a new tab)Try it
- In figure 1.1, turn a right down: the corner drops below 200 Hz and the click becomes a slow fade.
- In figure 1.2, play it and turn feedback up while the bass line plays: the filter starts to sing.
- Open either in SynthMaker, open the filter's code, and change a line: play it and hear what your change does.
Remember
y = y' + a * (x - y')is a low-pass filter: each sample moves a share of the way.- The impulse response (one click in) says everything about a filter like this; its Response is worked out from it.
- Feedback slides poles towards the unit circle; near it the filter rings, and on it the sound would never stop.



