Creating a feedback minimizer/maximizer

So off the back of an interesting conversation with @tremblap about getting the most out of a feedback system, specifically ambisonic feedback…:

(blog with more info)

… I got to thinking about how to go about building something using fluid.stuff.

So at a basic level, I can use fluid.sinefeature~ to pick out the loudest peak(s) and use that to drive a filter of some kind. I guess a notch filter for a feedback minimizer and a peak filter for a feedback maximizer.

I do have some questions on how to best something like that up.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Question 1 (the q question)

Mapping the frequency outputs of fluid.sinefeature~ to a filter seems straight forward enough, I just don’t know how to best handle bandwidth/q for something like this. Should it just be a dialed in static value (fairly resonant, but still with a bit of width) or is trying to tie the q to some descriptor analysis beneficial here (e.g. spectral spread).

This question is twofold, the first one essentially being “what do feedback killer systems do?” and the variation of that “what would be more effective for mapping in this context?”.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Question 2 (the minimizer vs maximizer question)

For the feedback minimizer, it makes sense that a straight up notch filter (using svf~ or something fancier?) would be the best choice.

For the maximizer I would think that a notch filter might be most effective, in terms of narrowing the spectra and focussing the energy on that area, though I do worry that it will end up making the overall feedback sound more like a nasal wah pedal, rather than keeping broadband noise/feedback going, just helping it along.

I don’t see myself toggling between minimizer and maximizer during a performance, but I have always wanted something that let me (quickly, and while sound checking) find the “sticky” room modes I want to dislodge and just set some notch filters on them without having to do tediously do this manually (what I’ve done for gigs in larger spaces in the past (including Kaizo Snare)).

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Question 3 (the fluid.voiceallocator quesetion)

One of the interesting things that @tremblap mentioned was combining fluid.sinefeature~ with fluid.voiceallocator (thread) to have multiple filters handing things off seamlessly. I suppose this would work well in either approach (minimizer or maximizer).

Where I get real confused with this is what to do with the state outputs of fluid.voiceallocator in terms of managing multiple filters at once.

I built a quick mockup using sine waves following the loudest two peaks to get a sense of what is happening (with some example audio), but would it just be a matter of driving the filter gains instead of sine wave gains (though not sure how that would work with bandpass filters).

patch.zip (3.9 MB)

(this takes some bits from the mc. patch I had built in the voiceallocator thread a while back)

Also, if I wanted to drive multiple voices, I guess it would just be cascaded filters? (though again, not sure how that would work with bandpass)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Any thoughts welcome!

2 Likes

I’ll reply to #3 and with a conceptual patch that I might use for my current piece (if I manage I’ll use a minimiser in my 100dB gain pre comp loop to force other modes)

So for now, high Q notches is what I do. as a proof of concept, here we go with 2 sines as my 2 main feedback freqs

This patch is VERY dirty even on my standard. Do not start it with headphones. Smoothing needs to happen in multivoice so probably a poly management of some sort but I cannot be bothered, I’ll do it in SC when I need it for real :smiley:


----------begin_max5_patcher----------
1464.3ocyZstaahDE92NOEiP4Gckbsl6LrRUpuGaqhlfG6PCF7B3roau7ruy
ErqcJNL.CQqiM1.C7Memay4bHe6lEQ2W9rpNB7mf+BrXw2tYwB6gLGXQ69Kh
1IeNMWVaGVTg5eJu+KQKcmpQ8bi8vox5T4Z0OOdhhC6JOzjqZrWEp8n6kMoO
jUr8tJUZiC02iVAWBPPLw7MGZ1hwqffO2dMtaSyW2qbWPTc11BYdzoAjs1NC
zyp2ySNC+rhiviMG6G2biYyRO44NUcsbq52HpZcVycaxxaTUfaQKAt8qT+M3
Vb6dxc6A2RFrjfDyMjOgXkHXTb+hhNEBLTvDBWQYuWl9HHCrAjMZRBsjjQFI
G4wcxQR33XZ4gBiNFBthljdcRRSrrSPb1zI8SxrhlnkZt19wramzl2IsYgi1
Mf6A4cSX7qnUQXCGiicTMYEqOBeurXqkscRSVmzDENZ9u4q1VUdXO.OXthgX
C8hisgp3HOrfuFOYwysmplm4xT0fII2F7I1ENlRlBGYyMGeR879Jv6tMCA9v
Gz9qe+6f1eS9iAGehxcVxPpcYIZxHCPQ4AyD1sXy1J49GNs75lxhlMFEqd.v
N4X7qvQ3YQmvLa.YDVbFGKbXdQbtei24Y01fVaxKk88iii8ZA1vhnSy2J4Nk
F76TEx6yeIC+knTzdvZUia11FJRuphlNK0Wj4MBQiWQnLl.AYTtHVeRM80uR
buhowTS9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mrzk3idjFJjP9fDJD
Hg8AI7TQZ.llSqREub2HAPMg71cK3Au7BZLdNV00mRWNFa82pxVte+Spp51Q
awHZm7KkUmdBnQ5pzc6xs6VodJ633Y1iHqReHyzqgCU14UzybWOli1UpYXwg
rVRpYmFRaGNJj6T06a+OPx1Hja9wM+G.9LKfJ
-----------end_max5_patcher-----------
1 Like

I should add - if smoothing, use voice birth flag (1) to ramp your notch to -100dB and the death flag (3) to ramp it back up. (here because filtergraph is #($*#)(I use 0(dead-already) and 3(death) to amp to 1 (mag is lin on filtergraph) and therefore 1 and 2 are notching (so amp 0)

something more subtle would take the mag of the peak to decide the notch amount and/or the speed of the notching, but this is just to get you going.

1 Like

Cool, that makes more sense now.

Basically just taking the flags and using that to manipulate the gains of the filters (either peak or notch). Will pester Pete for some nice audio-rate filters suitable for this and report back when I get something going.

1 Like

it is also the number of peaks vs number of voices - like good old midi synth with decaying voices. the good news is that EQ voices are cheap, so you could have 6 voices for 2 peaks, and get real smooth in fading in/out the cuts/boosts… or do like above and go nasty. I like the latter obviously :wink:

1 Like

ok here goes the SC version. Look at that elegance :slight_smile:

// set a simple synth, a bus and a voice management
(
b = Bus.audio(s);
SynthDef(\sin, {arg freq = 111; Out.ar(b,SinOsc.ar(freq, mul: 0.1 * EnvGate(0, fadeTime: 1)))}).send;
// x = {Out.ar(0,In.ar(b,1).dup)}.play;
~count = 0;
~voices =Array.fill(3,nil);
)


// put the anti feed EQ at the end
(
{
	var audio = In.ar(b,1);
	var freqs,mags,voices;
	#freqs,mags = FluidSineFeature.kr(audio, 2, -40, 1);
	voices = FluidVoiceAllocator.kr(freqs,mags, 4);
	4.do{|i|
		audio = MidEQ.ar(audio, voices[0][i].max(20), 1, (InRange.kr(voices[2][i],1,2) * -60).lag(0.5)); //slowed down for demo
	};
	Out.ar(0,audio.dup);
}.play;//.draw;
)

// play a voice and hear it disappear :)
(
~voices[~count.mod(3)] = Synth(\sin, [\freq, 400.0.rrand(4000).postln]);
~count = ~count + 1;
~voices[~count.mod(3)].release;
)

@tedmoore @spluta and @mccrmck might propose better sc… but check this!

1 Like

ok this is tooooooo sexy - I need to play with number of voices and smoothing, but as it is very nervous it does some sexy bubbling - first is just the feedback network (boost by 60db into a compressor) and then you see when I start the -40 on 2 peeks…

2 Likes