I would like to post here a new plugin. Let’s call it Spectral Gain. It was developed in Audacity 2.4.2. The link below gives you the latest version. Spectral-Gain.ny (4.96 KB)
(v3; UPDATED: 2022/09/01)
What is specific to this plugin:
You can adjust the gain of a spectrogram selection evenly across the selected frequencies. This is the same feature as we can find for example in the iZotope RX Advance module Gain.
A selection can start at the very bottom or very top of the frequency range. There is an error message when trying to run Spectral Edit Parametric EQ. It says that the low/high frequency is undefined. In the plugin Spectral Gain, an undefined value is replaced with the lowest/highest possible value.
Comparison with other similar spectral tools:
I believe that in this case, one screenshot is more than hundreds words, so here it goes.
Spectral Edit Parametric EQ was set to -24dB and run two times to show the effect clearly.
Spectral Gain was set to -30dB.
All three tools are very useful, but every one of them has its own specific purpose.
The code is mostly build based on the plugin Spectral Delete. So all credit and thanks should go to its author Steve.
Sure, no problem.
From a few quick tests, it appears to be working as intended. Congratulations
A few comments below:
(setf fade 0.005) ; in miliseconds
(setf fade 0.005) ; in seconds
;;;FILTERING - Based on the plugin Spectral Delete
Just thinking, it would be nice if the "sinc filter" was available in Audacity by default. Then there would be no need to put all of that filter code into the plug-in. This is something that I had planned before Audacity was acquired by Muse Group. If Audacity's Nyquist had this feature, then, just as we can use **(highpass8 signal hz)** without worrying how HIGHPASS8 is implemented, we would be able to use functions such as **(highpass-sinc signal hz)** without having to worry about how the sinc filter is implemented.
Along the same lines, I think it would also be nice if we had some "spectral filter" functions available in Audacity. Possibly something like:
**(spectral _sound func_ [_keywords ..._] :fade _seconds_ [_*args_])**
where "keywords" are one or more of: low-hz, high-hz, center-hz, width, which may take values T, NIL or a number. When set to T (boolean _True_), the keyword argument takes its value from the spectral selection. When the keyword is passed with a numeric value, the numeric value provides a fallback value if there isn't a "spectral" selection.
"*args" is a list of any additional arguments required by the function "_func_".
So, for example, to use HIGHPASS8 based on the spectral selection, we could just write something like:
(spectral *track* "highpass8" :fade 0.01)
or to high-pass with the sinc filter, using the spectral centre frequency, and 0.1 second fades:
it would be nice if the “sinc filter” was available in Audacity by default
I totally agree. I can imagine to create with it other multiband plugins, like multiband compressor or EQ match. For example, I am working on the next version of Dereverb and I have implemented “sinc filter”. It basically solved my problem with splitting and joining a signal.
Moreover, thanks to this exercise with Spectral Gain plugin, I have learnt (finally!) how to adjust the gain on the selected frequency range, instead of filtering it out.