Really simple tone control plug-in

The Equalizer in Audacity is an excellent and flexible way of adjusting the tone of a recording, but if you just want to quickly boost or cut the bass (low frequencies) or treble (high frequencies) it is possibly overly complicated.

For a really simple tone control I’ve made a “Tone Control” plug-in.

To use this plug-in, download the attachment and extract the “tonecontrol.ny” file from the downloaded .zip file.
Put the “tonecontrol.ny” file into your Audacity plug-ins folder.
Restart Audacity and the tone control will be listed in the effects menu.

If you try this plug-in, please let me know how you get on with it and any suggestions for improvements.

[Updated file in follow-up post]

I haven’t tried it yet, and I know you’re trying to keep it simple, but why not allow setting of the half-gain frequencies as well?

– Bill

I think you’ve answered your own question there :smiley:

I have based the plug-in on tone controls that almost everyone will be familiar with - the tone controls that you get on a stereo system.

I actually wanted to make it even more simple and have just one slider with “move left for bass, move right for treble” but the number box to the left of the slider made it look confusing (why should a negative number mean more bass?). The interface options for Nyquist plug-ins are quite constrained (rotary controls would have been nice, but are not available), so this was the most simple and easy to use Eq that I could come up with.

A couple more technical details (invisible to the user):

You may notice that the slope of the filters is somewhat more gradual than expected from a second order filter which is made possible by the optional “slope” parameter in the code. The choice of slope and half gain frequency was fairly arbitrary (I’m working on my laptop with only the built in speakers at the moment so it’s really difficult to hear what it’s actually doing) but I was aiming at frequencies that would produce an “expected” result. Turning down the bass and treble will leave mid frequencies that are approximately centred on 1kHz.

I’m open to suggestions on tweaking the parameters for both slope and frequencies - the figures used should be ball-park but possibly not optimum.

For the Normalization, the consensus on the forum has been for “linked stereo”. Normalization is included because without it it’s very easy to boost the audio into distortion and for bit depths below 32 audio is clipped at 0dB. By default, normalization is based on the first 1 million samples, which can be a problem on long tracks where the first 1 million samples may be substantially quieter than other parts of the track. Finding the peak amplitude with Nyquist involves reading the audio data into RAM so testing the entire track with a long track will do nasty things (possibly crashing Audacity). As a compromise the normalization function tests 10 equally spaced sections of the selection with up to 1 million samples in each section. For short tracks this will look at all of the audio data and for very long tracks it has a reasonable chance of finding the highest peak. An alternative method for normalizing long selections that is used in some other plug-ins is to resample the track at a much lower sample rate then look for the peak in the low sample rate version. I tried this but when using a lot of treble boost the results were unreliable due to the lack of high frequencies in low sample-rate audio.

I look forward to your feedback when you’ve had chance to test it.

I tried running the effect on a 43-minute selection. With Normalize to -3 dB it hung up after 37 seconds (progress bar and time displays stopped updating), there was a flurry of disk activity, then maybe a minute later Audacity crashed. I ran the same parameters again on the same selection without normalization and it did not crash and completed in 1:25. Mac PPC dual G5 2 GHz, 3 GB RAM, lots of HD space free. Audacity 1.3.11 Jan 11. Other settings were +4 dB treble with a half-gain frequency of 4000 Hz. Bass at 0.

BTW, I added controls for bass and treble turnover frequencies. This shouldn’t affect it’s performance though.

It is instructive to run the effect on a selection of white noise then do a plot spectrum - a rough approximation of what the actual frequency response is.

Looking at the code:

(defun eqz (s-in h L)
      (eq-highshelf s-in 2000 h 0.5)
      600 L 0.5)

I wonder if eq-lowshelf and eq-highshelf are smart enough to just return the unmodified sound if the gain parameter is 0? If not, would it be worth it from a performance point of view to test for a gain parameter of 0 and not call the function in that case?

– Bill

Thanks for testing it Bill.

Sounds like it ate your RAM. Was that with a mono or stereo file?

I’d not tried it on anything that long but I suspected that normalizing would be rather hungry - seems a bit worse than I expected. I’ve now tried it on a 45 min mono 32bit 44100Hz track. It gobbled up a Gig of ram and took about 5 minutes with Normalize on. With a stereo file it would use double the RAN and the machine would probably start swapping data to disk, which will make it go really slow. I’ll have to see if I can optimise that.

No that won’t make any difference to performance.

Not quite, but pretty close. There will be some phase shift but other than the sub-filter there’s virtually no change to the frequency content.

Performance wise it would make little difference. Reading and writing the data and redrawing the waveform outweigh the actual processing time by a long way.

OK, updated.
Memory usage is down to about 50% of the previous version.
I’ve tested it on a 1 hour long 32 bit 48kHz stereo recording - RAM use went up to 1.3GB and it took about 5 minutes. The RAM was freed after the plug-in completed.
Accuracy of the Normalizing is also greatly improved. (1.52 KB)
If your computer does not have much RAM, set the Normalize feature to OFF (Normalizing in Nyquist is memory hungry, but the actual tone controls do not require much RAM at all).
Plug-In Installation

To install new plug-ins, place them in the Plug-Ins folder inside the Audacity installation folder. On Windows computers, this is usually under “Program Files”. On Mac OS X, it is usually under “Applications”. Restart Audacity, then the Plug-ins will appear underneath the divider in the “Effect”, “Generate” or “Analyze” menus.

I installed the plug in, but I cannot find óut how to use it:
I have some old (20-22 years) tapes with interview with an old man and have got them digitalized. But his voice is VERY bass’ed, or what ever you call it, and I cannot find out how to use the plugin to correct that…

Here is a piece of it

That is an extreme case , the plugin may not be able to cope with such extreme cases.

Try this equalization
suggested equalization.gif

Loudness Control? That’s common on music systems.

The problem can be clearly seen in the spectrum
Nearly all if the sound energy is below 800 Hz and there is very little sound above about 1000 Hz. It is the frequencies between about 1000 and 7000 Hz that makes voices bright and clear but they are almost completely missing. The recording is so bad that only a limited amount of improvement can be made by using extreme Equalization changes.

The attached XML file can be imported into the Equalization effect (as described here: to provide a curve similar to that described by Trebor. The new curve is called “de-muffle”.
de-muffle.xml (611 Bytes)

Thanks a lot. Now it’s possible to hear what he’s saying. Pitty that there is a scratch or what is is, every time he starts talking, but I guess I cannot have it all :slight_smile:
It is an interview from 1990, and Holger, the old man, was 87 at the time, telling about his childhood in Aarhus about 1900, so I was very eager to have it work. But it’s strange that this was part 2 of the interview, and part 1 was much better, I wonder why.

Possibly tape-head misalignment …

If the azimuth is even marginally off, the head will be unable to read the magnetic pattern properly, leading to a loss of higher frequencies upon playback.

or some error when digitising the tape.