Every RC filter you drew on paper and simulated in Falstad has an exact equivalent in Max/MSP. This tutorial builds the same low-pass and high-pass circuits from the schematics lecture, but as audio-rate patches you can hear in real time. Plug in your guitar or use a test tone.
A first-order RC low-pass filter and Max's [onepole~] object are mathematically identical. Both implement the same difference equation. The schematic is the analog version; the Max patch is the digital version.
The analog RC low-pass has a transfer function with one pole. When you discretize it (sample it at 44.1 kHz), you get a one-line formula:
That's it. The output sample y[n] is a weighted mix of the current input and the previous output. The coefficient a controls how much "memory" the filter has — higher a means more smoothing, lower cutoff.
In Max, [onepole~] does exactly this calculation, 44,100 times per second. You just tell it the cutoff frequency.
This is the same circuit as R in series, C to ground — your guitar's tone knob. In Max, [onepole~] takes a signal in and a cutoff frequency, and outputs the filtered signal.
Use [noise~] instead of [cycle~]. White noise has equal energy at all frequencies, so the spectrum display shows you the filter's frequency response directly. Sweep the cutoff and watch the spectroscope — you're looking at the same rolloff curve from the Falstad simulation.
Max doesn't have a built-in one-pole high-pass object, but you don't need one. A high-pass filter is just the original signal minus the low-pass output:
This is the same principle as the analog circuit: swapping R and C inverts which frequencies pass. Here we're doing the subtraction explicitly.
For a proper high-pass (and second-order filters), use [biquad~] with coefficients from [filterdesign]:
The [filterdesign] object calculates biquad coefficients for any filter type. This gives you the same result as the subtraction method but in a single object, and you can change it to bandpass, notch, or higher orders.
A guitar tone knob is a potentiometer (variable resistor) in series with a fixed capacitor to ground. As you turn the knob, R changes, which sweeps the cutoff frequency. In Max, just map a [live.dial] to the cutoff frequency of [onepole~].
The [live.dial] is your potentiometer. Its range (200–5000 Hz) corresponds to sweeping R from ~80 kΩ down to ~3.2 kΩ with a 10 nF cap. Use exponential scaling on the dial — our ears perceive frequency logarithmically, so a linear pot would feel like all the action is bunched at one end (which is exactly what happens with a real linear-taper pot on a tone control).
If you want students to enter actual resistor and capacitor values and hear the result, use [expr] to compute the cutoff:
Example values to try:
| R | C | fc | Sound |
|---|---|---|---|
| 22000 | 0.00000001 | 723 Hz | Classic tone-knob range. Audibly muffled. |
| 10000 | 0.000000047 | 339 Hz | Very dark. Like a guitar through a pillow. |
| 100000 | 0.000000001 | 1592 Hz | Gentle treble roll-off. Warm but clear. |
| 500000 | 0.000000002 | 159 Hz | Guitar cable effect. 20 ft cable × 100 pF/ft. |
| Concept | Analog (Schematic) | Digital (Max/MSP) |
|---|---|---|
| Low-pass | R in series, C to ground | [onepole~] |
| High-pass | C in series, R to ground | input - [onepole~] or [biquad~] |
| Cutoff frequency | fc = 1/(2πRC) | Right inlet of [onepole~], in Hz |
| Slope | −6 dB/octave (first-order) | Same: −6 dB/octave |
| Tone knob | Pot + cap to ground | [live.dial] → [onepole~] |
| See the response | Oscilloscope probe | [scope~] and [spectroscope~] |
| Steeper filter | Cascade two RC stages | Chain two [onepole~] or use [biquad~] order 2 |
Two [onepole~] in series gives a second-order filter (−12 dB/octave) — the same as cascading two RC stages on a breadboard. Three gives −18 dB/octave. Each stage makes the rolloff steeper. This is how the Big Muff's tone stack works: multiple passive RC stages.
A high-pass followed by a low-pass creates a bandpass — only frequencies between the two cutoffs survive. This is the basic mid-boost topology used in the Tube Screamer.
The [filtergraph~] UI object draws the frequency response curve and lets students drag the cutoff point interactively. Connect its output to [biquad~] to hear the changes as they drag. This is the closest thing to turning a real knob.
| Max Object | Filter Type | Analog Equivalent |
|---|---|---|
| [onepole~] | 1-pole low-pass | Single RC low-pass |
| [biquad~] | 2-pole, any type | Two-stage RC or active filter (op-amp) |
| [svf~] | State-variable (LP/HP/BP/notch) | State-variable filter circuit |
| [lores~] | Resonant low-pass | RLC circuit (inductor adds resonance) |
| [reson~] | Resonant bandpass | Wah-wah pedal (inductor + cap) |
Build a wah-wah pedal in Max: use [reson~] or [svf~] with a narrow bandpass. Map a [live.dial] to sweep the center frequency from 400 Hz to 2 kHz. Feed your guitar through it. Compare the spectroscope view to the EveryCircuit simulation of an RLC bandpass. Same shape, same sweep, same wah sound.