An interesting use of the Pop Mute effect.
I did some experiments with this type of de-esser some time ago, and at least for some voices it can work very well.
I presume that when using it for de-essing, you would set the filter frequency fairly high, according to the centre frequency of the sibilance, in which case it would probably be useful to set the default frequency somewhat higher. For example, to set the default filter frequency to 4000 Hz (4 kHz), you would change line 15 to:
;control hz "Frequencies above" int "Hz" 4000 60 8000
I’d also be inclined to restrict the range a bit more as any setting below 1000 Hz will be useless for correcting sibilance, so something like:
;control hz "Frequencies above" int "Hz" 4000 1000 8000
or define it in kHz and multiply “hz” by 1000 in the “scale input values” section
;control hz "Frequencies above" int "kHz" 4 1 8
and
;; scale input values
(setf hz (* hz 1000)) ;convert from kHz
(setf hz (min hz (/ *sound-srate* 2)))
There’s a technical error in your code, which doesn’t affect it’s performance, but could cause a problem if the code is modified by someone else and they don’t spot the error.
In lines 38 and 39 you have:
(defun filter (sig)
(bandpass2 *track* hz 4.7071))
Given that you are passing the sound to be filtered to this function as “sig”, you should be using “sig” rather than track in the second line of this function, like this:
(defun filter (sig)
(bandpass2 sig hz 4.7071))
A couple of other issues that I notice:
-
In the interface it says “Frequencies above”, which implies a shelf or low-pass filter, but the actual filter is a band-stop filter. I assume that the code is correct and the wording in the interface is left over from previous experiments with different types of filter. Simply calling that control “Frequency” or “Center frequency” would describe better what the control actually does.
-
In the “Listen” choice, I’m confused by what the option “Removed parts” is intended to do. I assumed that would give the part of the sound that would be removed when using the “processed part” option. In other words, the difference between the original (input) sound, and the processed sound. If that is the intention, then the second to last line of the code needs to be (diff track processed), like this:
(let* ((filtered (filter *track*))
(passband (diff *track* filtered))
(gated (multichan-expand #'inverse-gate filtered))
(processed (sum passband gated)))
(if (= apply 1)
(diff *track* processed)
processed))