Hi,
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.
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.
If it is the best to try resonz and resonr (I'm on train building pd-extended, used vanilla before), I'll accept that. On the other hand, I would be realy curious about the math that is used to solve this problem.
Thank you very much!
Bjoern
#N canvas 611 38 615 510 10; #X obj 105 -13 inlet~; #X obj 105 394 outlet~; #X obj 153 218 delwrite~ del3; #X obj 125 348 delwrite~ del2; #X obj 105 121 +~; #X obj 104 239 +~; #X obj 104 320 +~; #X obj 125 99 *~; #X obj 122 218 *~; #X obj 138 299 *~; #X obj 239 -10 inlet~; #X text 239 -27 r; #X obj 307 -10 inlet~; #X obj 383 -7 inlet~; #X text 303 -33 c1; #X text 389 -26 c2; #X obj 124 14 delwrite~ del1 1; #X obj 125 78 delread~ del1; #X obj 123 198 delread~ del2 1; #X obj 138 278 delread~ del3 1; #X obj 427 134 samplerate~; #X msg 387 134 1; #X obj 387 155 /; #X obj 387 91 loadbang; #X floatatom 387 198 0 0 0 0 - - -; #X obj 387 112 t b b; #X obj 387 176 * 1000; #X obj 387 221 s one_sample; #X obj 125 34 r one_sample; #X obj 125 55 * 2; #X obj 131 177 r one_sample; #X obj 147 254 r one_sample; #X obj 105 150 *~; #X obj 455 -4 inlet~; #X text 456 -22 gain; #X connect 0 0 4 0; #X connect 0 0 16 0; #X connect 4 0 32 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 6 0 3 0; #X connect 7 0 4 1; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 7 1; #X connect 12 0 8 1; #X connect 13 0 9 1; #X connect 17 0 7 0; #X connect 18 0 8 0; #X connect 18 0 2 0; #X connect 19 0 9 0; #X connect 20 0 22 1; #X connect 21 0 22 0; #X connect 22 0 26 0; #X connect 23 0 25 0; #X connect 24 0 27 0; #X connect 25 0 21 0; #X connect 25 1 20 0; #X connect 26 0 24 0; #X connect 28 0 29 0; #X connect 29 0 17 0; #X connect 30 0 18 0; #X connect 31 0 19 0; #X connect 32 0 5 0; #X connect 33 0 32 1;
Check the 'cyclone' lib, it has Max clones. I think there is at least
one other reson~ included in Pd-extended.
.hc
On Mar 9, 2010, at 5:08 PM, Björn Lindig wrote:
Hi,
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.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.If it is the best to try resonz and resonr (I'm on train building pd- extended, used vanilla before), I'll accept that. On the other hand, I would
be realy curious about the math that is used to solve this problem.Thank you very much!
Bjoern
#N canvas 611 38 615 510 10; #X obj 105 -13 inlet~; #X obj 105 394 outlet~; #X obj 153 218 delwrite~ del3; #X obj 125 348 delwrite~ del2; #X obj 105 121 +~; #X obj 104 239 +~; #X obj 104 320 +~; #X obj 125 99 *~; #X obj 122 218 *~; #X obj 138 299 *~; #X obj 239 -10 inlet~; #X text 239 -27 r; #X obj 307 -10 inlet~; #X obj 383 -7 inlet~; #X text 303 -33 c1; #X text 389 -26 c2; #X obj 124 14 delwrite~ del1 1; #X obj 125 78 delread~ del1; #X obj 123 198 delread~ del2 1; #X obj 138 278 delread~ del3 1; #X obj 427 134 samplerate~; #X msg 387 134 1; #X obj 387 155 /; #X obj 387 91 loadbang; #X floatatom 387 198 0 0 0 0 - - -; #X obj 387 112 t b b; #X obj 387 176 * 1000; #X obj 387 221 s one_sample; #X obj 125 34 r one_sample; #X obj 125 55 * 2; #X obj 131 177 r one_sample; #X obj 147 254 r one_sample; #X obj 105 150 *~; #X obj 455 -4 inlet~; #X text 456 -22 gain; #X connect 0 0 4 0; #X connect 0 0 16 0; #X connect 4 0 32 0; #X connect 5 0 6 0; #X connect 6 0 1 0; #X connect 6 0 3 0; #X connect 7 0 4 1; #X connect 8 0 5 1; #X connect 9 0 6 1; #X connect 10 0 7 1; #X connect 12 0 8 1; #X connect 13 0 9 1; #X connect 17 0 7 0; #X connect 18 0 8 0; #X connect 18 0 2 0; #X connect 19 0 9 0; #X connect 20 0 22 1; #X connect 21 0 22 0; #X connect 22 0 26 0; #X connect 23 0 25 0; #X connect 24 0 27 0; #X connect 25 0 21 0; #X connect 25 1 20 0; #X connect 26 0 24 0; #X connect 28 0 29 0; #X connect 29 0 17 0; #X connect 30 0 18 0; #X connect 31 0 19 0; #X connect 32 0 5 0; #X connect 33 0 32 1;
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
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
Frank
Thank you Frank! Your information is very useful and interesting. I think, the jurney of learning how to make filters has just begun!
Best regards,
Bjoern
Am Mittwoch 10 März 2010 09:09:19 schrieb Frank Barknecht:
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