Self-oscillating filters... how?

christripledot's icon

Sorry if this has been covered before; I've tried a good few searches and only got scraps.

Is there a way of making [biquad~] self-oscillate? I've tried feeding it low amplitude noise, and [click~]s, and the like, but I can't find a way to excite it without a relatively loud and constant input signal.

I'm just trying to play my synth filter with its oscillator inputs turned off. I could just use my MS-10, but... meh... I wanna do it in software too. Any input gladly received!

Thanks for looking :)

ch's icon

You may be interested by the [p oscillation] in the biquad~ help patch.

Peter McCulloch's icon

Also, if you're on mac, check out my external (available in the Toolbox) called PM.Chamberlin~: it's a self-oscillating state-variable filter with saturation.

Charles Baker's icon

Yep, biquad~ has a self oscillation help sub patch:
Also you can get some cool self oscillation with
the MSP svf~ object,
the tap.svf~ object
and the new PM.Chamberlin~ svf object on Macs
The tap.svf~ and the PM.Chamberlin~ both sound 'better' than the MSP svf~...(but see later)
tap.svf~ costs $, is purchased with "TapTools" external set, and includes the LFO and portamento you need for a good "Tomita Whistle" patch built into object!
the PM.Chamberlin~ svf sounds just great, handles overdriving into saturation beautifully, and is free.
The MSP svf~ has one very cool thing: you get the simultaneous output of all 4 possible filters defined by the "Center Frequency" and "Bandwidth" settings: Lowpass, Highpass, Bandpass, Notch/BandReject...this expands the timbral variety you can get from the one filter a great deal.
ymmv, pax
cfb aka j2k

Peter McCulloch's icon

One limitation to the normal svf~ object is that its cutoff doesn't go that high. (check it on spectrograph~; I think it's somewhere around SR/4) You can get around this by wrapping svf~ inside a poly~ patch and upsampling it to get higher cutoffs. ("up 2" as an argument to the poly patch will double the range, which should be enough)

flowdesigner's icon

IS it possible to play the biquad~ oscillator?

christripledot's icon

Hi Charles *waves white flag ;)*

Thanks for the advice, chaps. Please excuse the late reply; been drinking at a wedding.

The "stoke" message seems to be the sort of thing I'm looking for, but it's not quite there... In the [p oscillation] subpatch everything seems to work fine, but I don't really see how I can use it in conjunction with a [filtercoeff~]. For example, if I jam a [filtercoeff~] into the example patch, the oscillation just tails off, even with the Q in the thousands. I'm afraid I don't know enough about filter maths to go without [filtercoeff~], and while I know that ignorance is the best excuse for learning, it seems like a hell of a lot to wade through just to achieve a decent-sounding filter. I have enough trouble with trigonometry.

The sort of behaviour I'd like to achieve is: filter self-oscillates when Q hits a sensible level (say, between 10 and 30, as this seems to be the most useful "juicy" range when there is signal input), regardless of input level.

Does anyone have an example of a [biquad~] based filter, that self-oscillates much like a real analogue filter would? Preferably one that works at audio rate, too?

(Peter, your PM.Chamberlin~ sounds great, but I'm after a native Max solution because I don't just use Macs.)

Peter McCulloch's icon

The reason you won't be able to do true self-oscillation with biquad~ is that it requires saturation in the feedback; biquad~ is unbounded (and consequently easy enough to blow up!). Analog filters are limited by hardware in their feedback, which is why they don't get infinitely loud in self-oscillation.

If you can tolerate the vector size delay, you could do some sort of feedback based decision making for the filter's Q/gain. Use an envelope follower on the output of the filter, then (you'll need tapin~/tapout~ 0 for the loop) use that to set the gain of the filter. I do this with peak filters to simulate guitar feedback-type effects. These type of effects are really interesting, though it may not be the sound you're looking for.

This is the type of problem that gen~ is intended to solve. Worth noting: biquad~ may not be the solution you're looking for because (at least as I understand it) biquads don't sweep well without very frequent updating.

christripledot's icon

Thanks for the thorough explanation, Peter.

I might have a go at some sort of tapin~/tapout~ feedback loop like you suggest... I've done similar things with notch filters and cheby waveshaping and it sounds nice and fruity, particularly when you build up a number of resonant peaks (ripples?) either side of the stopband.

There's no such thing as a sound I'm not looking for :D

Obviously there are things that are better achieved with analogue gear than with digital emulations, so maybe it's time I built up my MOTM filter modules and bought another MOTU to interface them. Mwahahahaha

christripledot's icon

Peter, don't take this the wrong way; I mean it as constructive criticism only. There's no way I could know where to begin coding a filter!

After giving PM.Chamberlin~ a test on something other than my crappy office speakers, I can't help but notice some artefacts that sound like aliasing going on with the resonance.

I tried to upsample it in a [poly~], but it doesn't seem to like it much - the cutoff no longer reflects the desired frequency.

Is it an easy fix to make it work at different sample rates? Do you think that would help the 'aliasing'? (If that is indeed what I'm hearing!)

Thanks,
Chris

Peter McCulloch's icon

No worries, Chris. PM.Chamberlin~ only works at 44.1k right now. I'd like to improve that at some point, but it's set up that way because I had to do some corrections in the tuning in order to get it playable for self-oscillation. You shouldn't need to upsample it, as it's already doing upsampling internally.

If you can send me an example patch with the aliasing artifacts, I'll give it a listen. There is a slight amount of pink noise in the filter itself so that it can self-oscillate (in an analog system this translates into "amplify the noise of input of the filter itself", so that could be what you're hearing, but it shouldn't be coming out really loud. The more your turn up the resonance, the crankier it'll get.

Other thing to note: to adjust the level of the resonant peak to the input signal, use pre and post gain. Boost before and cut after = less resonant boost.

christripledot's icon

Aha - good tip about the pre/post gain.

I think it must be the pink noise that I'm hearing... I expected more of a pure sine tone from the self-oscillation, but it's got harmonics more akin to a dirty analogue filter - it sounded like aliasing at first, but after I dropped it into my filter core patch (which is surrounded on both sides by assorted non-linear distortion) it came out sounding nice and gritty like my MS-10.

So a big win all round! :D

Peter McCulloch's icon

Also, if you want more of a pure sine tone, you can always mix in a cycle~ tuned by the filter's cutoff after the filter. Yes, it's cheating, but...