Skip to content

Commit

Permalink
automatic larsen suppression: putting it all together
Browse files Browse the repository at this point in the history
  • Loading branch information
dariosanfilippo committed May 9, 2020
1 parent 4a65139 commit daea654
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions als.dsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* Automatic Larsen Suppression system through spectral centroid calculation and
* adaptive notch filtering.
*/

import("stdfaust.lib");
import("detection.lib");
import("suppression.lib");

declare als author "Dario Sanfilippo";
declare als copyright "Copyright (C) 2020 Dario Sanfilippo <[email protected]>";
declare als license "GPL v3.0 license";

// signal inspector
inspect = _ <: attach( _ ,
_ :
vbargraph("Spectral centroid [style:numerical]", 0, 48000));

on = checkbox("[0]Active");
memory = checkbox("[1]Memory");
freeze = 1 - checkbox("[2]Freeze");
gain = hslider("[3]Input gain (dB)", 0, -64, 64, .001) : ba.db2linear;
response = hslider("[4]Response (seconds)", .1, .001, 1, .001);
q = hslider("[5]Selectiveness (Q factor)", 1, .1, 10, .001);
vol = hslider("[6]Output volume (linear)", 0, 0, 1, .001);
spec_cent(in) = dt.sc(2, memory, response, in) : ba.sAndH(freeze) : inspect;
suppressor(in) = su.notch2(spec_cent(in), q, in);
als(in) = suppressor(in1) * on + in1 * (1 - on) * vol
with {
in1 = in * gain;
};
process = als;

0 comments on commit daea654

Please sign in to comment.