-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automatic larsen suppression: putting it all together
- Loading branch information
1 parent
4a65139
commit daea654
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |