This happens to me every now and then too. At first I thought it might be because you have leave the gain at unity, but doing 0.1 => filter.gain and 0.1 => osc.gain did hardly anything, even though I have a really low volume. Weird!

Yes, this was shocking for me because I always turn my laptop level right down when trying new audio code, but even with that precaution, the above code seemed to blast out at full volume, very alarming!_________________http://basementhum.blogspot.com

We see the filtered result rises unstoppably all the time. This will surely overloaded the DAC very fast, and you might have to set DAC's gain to 1/MaxFloat to not let it clip hahahahah.. (seems silly)..

But i always suspected it has something to do with the combination of both freq and Q. First, i'll try to lower the filter's freq to the point that it won't behave like this:

Yeah. This seems dangerous at first (with this high freq) but when played, comes out pretty smooth. And it's safe to change filter to LPF, HPF also --> it still function correctly. Even if we increase the filter.freq to 30000 = beyond nyquist frequency here with my VM running at sample rate = 44100, it still doesn't blow up.

So, one of my favourite solution is to increase Q according to the increased freq. I don't know the math behind this, but it does the trick and safe our ears. Maybe the ChucK developer team can identify the reason of this behavior from the butterworth codes in ChucK source code.

Thanks kijjaz, its nice to notice how simple it is to do per-sample debugging with chuck.

I'd like to get a better idea of exactly how (and when) Q and frequency interact to create the screaming effect, (that would be quite disastrous during an ambient interlude ). Will post back if I learn anything more._________________http://basementhum.blogspot.com

I'd like to get a better idea of exactly how (and when) Q and frequency interact to create the screaming effect,

I think they simply become what is called "unstable" in filter design. It's fairly well understood how to prevent that (by science, I mean, not by me ).

I noticed the same thing, BTW, it totally wrecked the start of one of my last livecode sessions on live radio. I don't know what I did to get it under controll, probably just change freq and Q randomly._________________Kassen

That's odd. When I run this one, I do get the runaway 'blow up' effect (intel macbook).

My bet is that Kijjaz is running audio at 48KHz while you will be at 44.1KHz (I think those are the Linux & Mac defaults and I think those are your platforms). For digital filters sample rate matters. A given cut-off will mean different coefficients for different sample rates and in this case one of those may have a instability-causing rounding error. At other frequencies the reverse may hold true.

I think I'm going to report this to the list where we may reach Perry. Perry is probably our digital filter expert._________________Kassen

Looking around some more i noticed that BiQuad filter class has .norm (normalization) and .eqzs (equal gain zeroes) parameters. Hunting on the chuck list suggests to me that these parameters relate to an auto 'anti-blowing-up capability' of the BiQuad filter class.

The HP BP and LP have no such params. I understand that it's possible to use BiQuad to recreate these standard types (while taking advantage of its anti-blowup functionality?), but unfortunately that's a task way beyond my modest understanding of filter design.

(I've started reading introductory papers, but my eyes glaze over before anything starts to make sense. I have the feeling that smarter people than me must have already figured this stuff out )

I'm surprised that there doesn't seem to be a built-in set of 'safe' standard filters in ChucK, of the kind that exist in all other audio synthesis environments I've used (HP BP LP BR). I think the existence of a set like this would go a long way towards increasing the accessibility of ChucK for new users.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum

Please support our site. If you click through and buy from our affiliate partners, we earn a small commission.