Something strange with BPF

I have a kind of problem working with BPF object.
i do not understand why but with some rq and freq, the signal gets really glitchy. I tried to whatch out for the amp and gain problems.

SynthDef(\prova, {|freq=9000, rq, mul, amp, mix = 0|   
	var wet, dry;
	dry =!2;
	wet =, freq.poll, rq.poll, rq.reciprocal.sqrt) * amp;, wet)

This is the synth def, and then

x =\prova,[
	\freq, rrand(120, 10000), 
	\rq, rrand(0.001, 20), 
	\amp, 1

I noticed that somehow, somethimes, i get glitches…
Some rq values I had glitches were: 2.92462; 19.9483; 5.23484; 6.43507 (even though with 6.25098 i did not have any problem)… I am reallly getting confused…

EDIT: this happens only with numers >1.

By the standard definition of Q, sqrt(1/2) is the magic number – for resonant LPF/HPF, this is the Q value corresponding to no resonance, or an ideally smooth rolloff. When Q is lower than this, you’re asking for “flatter than flat” and the math does blow up if the frequency is too close to 0 or Nyquist.

SC uses reciprocal-of-Q, so that magic number becomes sqrt(2). If rq > sqrt(2), you’re in questionable territory.

High rq means a very wide bandwidth, meaning that a BPF will have very little effect on the output anyway. So my suggestion is to reduce the upper bound for rq, to 1 or 1.4.


Thanks a lot jamshart!

Yesterday I ended up reducing rq values to 1, now I just tried with 2.sqrt and it works just fine; I was just not understanding why, and probably I was a little bit confused in my head initially, because of the rq instead of Q!

Thanks again!