[PD] reson~ from max in pd

Frank Barknecht fbar at footils.org
Wed Mar 10 09:09:19 CET 2010


Hallo,
Björn Lindig hat gesagt: // Björn Lindig wrote:

> a friend asked me, wether there is a object similar to the [fffb~] in max/msp 
> (a "fast fixed filter bank") in pd. I did not find it instantly so I started 
> to build one after the formula posted in [reson~]s help in max:
> 
> y[n] = gain * (x[n] - r * x[n-2]) + c1 * y[n-1] + c2 * y[n-2]
> 
> I appended a patch, that I created after this formula. The Problem is, that I 
> would love to klone the max-object, but at the moment I have only inlets for 
> r, c1, c2 and gain. What I need is the math to calculate the values for r, c1, 
> c2 and gain for given center frequency, Q/Bandwith, and gain. 

The equation above is the important base equation for many filters, but in
practice it is pretty useless. The brains are in how to calculate the various
parameters given more musical inputs like frequency and bandwith/resonance, and
normalizing the output volume. Traditionally (i.e. since at least CSound times)
what is called "reson" is a two-pole-two-zero (2nd order) resonating bandpass
filter. In Pd an equivalent to equation above is a [biquad~] object or
alternatively this:

 |
 [rzero~]
 |
 [rzero~]
 |
 [cpole~]
 |
 [cpole~]
 |
 
with suitable transofrmations of the input parameters to get the pole/zero
coefficients right. 

> I started reading the chapters on time shifts and delays and filters in 
> miller-puckettes book and the book of J. O. Smith. But to be honest, I did not 
> yet understand much of what is writen there. So I thought, there might be 
> someone arround here, who can give me a fast answer, or who can point me into 
> the right direction. 

I think, JOS and MSP are already the right direction, another stop could be the
book at www.dspguide.com

> If it is the best to try resonz and resonr (I'm on train building pd-extended, 
> used vanilla before), I'll accept that. 

I believe, resonz is the same as reson~ in Max/MSP. All these resonX things
differ only in how they normalize the filter for different center frequencies.
resonr keeps the resonance gain constant, resonz normalizes the peak gain:
http://www.dsprelated.com/dspbooks/filters/Peak_Gain_Versus_Resonance.html

resonz~ and resonr~ can be build as abstractions, so there's no need to install
externals just for them:
http://lists.puredata.info/pipermail/pd-list/2008-12/067018.html

These and some more Pd vanilla filters are also part of the "rj" library:
http://trac.rjdj.me/browser/trunk/rjlib/rj

Ciao
-- 
Frank




More information about the Pd-list mailing list