Forums > MaxMSP

Filtering buffer contents with peek+slide?

November 4, 2009 | 11:56 am


I want to build a wavetable synth using a series of tables. Every table would have the same series of waves but would be low-pass filtered to a specific cutoff to match a specific pitch range so to have a good compromise between spectral richness and protection against aliasing. I plan to use 10 tables matching 10 octaves downwards from 22.05 kHz.

Of course I could prepare the wavetables outside Max but I was wondering whether it would be possible to filter the sounds upon loading within Max (and possibly in non real-time).

The idea would be to load the sound to be filtered into a buffer, read each sample with peek~, filter with slide and record in another buffer with another instance of peek~.

My questions:
1.If I want to apply a sharp lowpass filtering to my sound in nonrealtime, is slide the best option?
2. How should I calculate the smoothing argument to get a filtering at SR/2, SR/4, etc?

Thank you in advance.

Roald Baudoux

November 5, 2009 | 7:57 pm

1. biquad (or 2-3 maybe)

2. SR/3

why peek~? why not play~ and record~?


November 13, 2009 | 4:27 pm

Nonrealtime could be much faster than real time…

November 13, 2009 | 4:43 pm

The best way would probably be to implement a standard filter algorithm using Max objects only.

For instance, the the biquad~ use the following function:

For each sample n,
y[n] = a0 * x[n] + a1 * x[n-1] + a2 * x[n-2] – b1 * y[n-1] – b2 * y[n-2]

I may have I go at this later if I have time.

December 9, 2009 | 8:22 pm

Sorry for the delay to answer, I got caught by one thousand other things.

Thank you Hans, this is a good peek into that stuff but I suppose I’d need a similar equation for a high slope low-pass filter. Any idea where I could get that?

Roald Baudoux

December 9, 2009 | 11:32 pm

The function above can be used for almost any filter. Play around with filtergraph~ to find good values for the coefficients.

This generalization of the above formula should work for simple low-pass filters (taken from, but the general formula may be required for high sloped ones.

y[n] = y[n-1] + a * (x[n] - y[n-1])

Viewing 6 posts - 1 through 6 (of 6 total)