Fuzzbox Physics
All Labs

RC Filters in Max/MSP

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.

Key Insight

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.

1. From Schematic to Difference Equation

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:

Analog: f_c = 1 / (2πRC) Digital: y[n] = (1 - a) · x[n] + a · y[n-1] where a = e^(-2π · f_c / sr)

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.

2. Patch 1: Low-Pass Filter (Treble Cut)

The concept

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.

Source
[adc~] or [cycle~]
Guitar input or test oscillator
Filter
[onepole~]
One-pole low-pass, cutoff from slider
Output
[dac~]
Speakers / headphones
Patch: Low-Pass Filter
cycle~ 440 adc~ 1 choose one source *~ 0.5 input gain R (in ohms) C (in farads) 22000. 0.00000001 10 nF = 1e-8 expr 1./(6.283185*$f1*$f2) 723.43 f_c in Hz simpler: just set cutoff directly slider 20. 5000. drag to sweep cutoff sig~ onepole~ or from formula scope~ spectroscope~ dac~ turn on audio (cmd+/)

Build it step by step

  1. Create [cycle~ 440] as a test source (or [adc~ 1] for guitar)
  2. Add [*~ 0.5] to keep the level safe
  3. Create [onepole~ 723] — that 723 is your cutoff in Hz
  4. Connect the output to [dac~] and turn on audio
  5. Add a [flonum] or [live.dial] connected to the right inlet of [onepole~] to sweep the cutoff
  6. Add [scope~] and [spectroscope~] to see the filtering happen
Try This

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.

3. Patch 2: High-Pass Filter (Bass Cut)

The trick

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:

highpass = input - lowpass(input) If [onepole~] removes the treble, subtracting it from the original removes the bass.

This is the same principle as the analog circuit: swapping R and C inverts which frequencies pass. Here we're doing the subtraction explicitly.

Patch: High-Pass Filter
noise~ white noise shows frequency response dry (original) onepole~ 723 low-pass param cutoff sig~ -~ original − lowpass = highpass scope~ spectroscope~ dac~

Alternative: [biquad~]

For a proper high-pass (and second-order filters), use [biquad~] with coefficients from [filterdesign]:

Max patch[filterdesign @response highpass @order 1 @frequency 723] | [biquad~]

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.

4. Patch 3: Tone Knob (Variable Low-Pass)

Simulating the guitar tone pot

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

Patch: Tone Knob
adc~ 1 guitar in live.dial range: 200 – 5000 Hz "TONE" label, exponential scale sig~ onepole~ optional: wet/dry like a real tone pot scope~ input scope~ output spectroscope~ dac~
Connecting to the Schematic

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

5. Patch 4: Calculate fc from R and C

If you want students to enter actual resistor and capacitor values and hear the result, use [expr] to compute the cutoff:

Max patch[flonum] R (ohms) [flonum] C (farads) | | [expr 1./(6.283185*$f1*$f2)] | [flonum] ← cutoff frequency in Hz | [sig~] | [onepole~]

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.

6. Comparing Analog and Digital

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

7. Going Further

Cascading filters (−12 dB/octave)

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.

Max patch[noise~] | [onepole~ 1000] ← first RC stage: −6 dB/oct | [onepole~ 1000] ← second RC stage: −12 dB/oct total | [onepole~ 1000] ← third RC stage: −18 dB/oct total | [dac~]

Bandpass filter

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.

Max patch[adc~ 1] guitar in | [biquad~] high-pass at 300 Hz (cuts bass) | [onepole~ 3000] low-pass at 3 kHz (cuts treble) | [dac~] only 300 Hz – 3 kHz passes through

Using [filtergraph~] to visualize

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.

Pre-built Max objects for common filter types

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)
Exercise

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.