Tone control plug-in

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
billw58
Posts: 5832
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Tone control plug-in

Post by billw58 » Sat Nov 27, 2010 1:58 am

I'd like to nominate Steve's "Really simple tone control plug-in" http://forum.audacityteam.org/viewtopic ... 28&t=21920 for inclusion in the Audacity distribution. I think it would be a boon to those users who are intimidated by the Equalization effect.

-- Bill

Click Here to Download the Current Version

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10 / 11

Re: Tone control plug-in

Post by Gale Andrews » Tue Nov 30, 2010 1:40 am

billw58 wrote:I'd like to nominate Steve's "Really simple tone control plug-in" http://forum.audacityteam.org/viewtopic ... 28&t=21920 for inclusion in the Audacity distribution. I think it would be a boon to those users who are intimidated by the Equalization effect.
I'm OK in principle as long as it replaces Bass Boost. Not otherwise, because I think we could use the menu space to add other plug-ins for which there is no current alternative.

EQ does (in 1.3.13) have Treble Cut, Treble Boost, Bass Cut and Bass Boost presets. Any comments on those?

I haven't seen a lot of comments that EQ is intimidating - are there many such? I think Martyn accepts a possible case after 2.0 to have two EQ effects (one curves, one graphic) with possibly a reduced interface like this for the Graphic EQ. Perhaps the case for that is weaker if we replace Bass Boost with Tone Control?

The Help Screen in Tone Control would have to be fixed for excessive height as per Conventions.

I suggest the Technical Details should make clear Equalization and Normalization refer to that employed in this plug-in, not the built-in effects of that name.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

billw58
Posts: 5832
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Tone control plug-in

Post by billw58 » Tue Nov 30, 2010 6:02 am

Well, no-one else seems to be clamouring for this, so perhaps we can let it go. If Steve feels like polishing the help screens and putting it up on the Nyquist effect download page, that's up to him.
Gale Andrews wrote:
EQ does (in 1.3.13) have Treble Cut, Treble Boost, Bass Cut and Bass Boost presets. Any comments on those?
Gale
The bass cut and treble cut have such severe cuts that the graph goes off the scale in the default view, which is +/- 36 dB. They are not the inverse of the "boost" presets - it occurs to me that they should be. But it depends on what you want to do. Gentle bass or treble reduction is one thing. The way these are structured one would be better of using the High Pass Filter or Low Pass Filter. I'll bookmark that page and make comments there.

The distribution of the default EQCurves.xml still hasn't propagated to the Mac nightlies, but that's another discussion.

-- Bill

steve
Site Admin
Posts: 85703
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Tone control plug-in

Post by steve » Wed Dec 01, 2010 7:33 pm

billw58 wrote:I think it would be a boon to those users who are intimidated by the Equalization effect.
+1
Gale Andrews wrote: I'm OK in principle as long as it replaces Bass Boost.
I'm generally OK with that, but there are some issues that should be considered.

The Bass Boost effect is approximately twice as fast as the Tone Control plug-in. The Tone Control is reasonably quick for a Nyquist plug-in, but Nyquist plug-ins are inherently slower than other effects.

The Bass Boost has a "Preview". This is not currently possible with Nyquist plug-ins (but would be a great addition and is currently listed in the Nyquist Wish List.

The "Normalize" feature in the Tone Control is potentially dangerous (as is the case with all Nyquist plug-ins that include a Normalize feature) because if used on long audio tracks it can eat up all available memory and cause Audacity to freeze or crash.
Gale Andrews wrote:I haven't seen a lot of comments that EQ is intimidating - are there many such?
I've not seen any posts saying "oh oh oh, the Equalizer is so intimidating it scares me..."
but I get the impression from quite a lot of users that they have avoided trying to use the Equalizer because it looks too complicated.

I think the main benefit of a "reduced interface" for the Equalizer would be to make it more convenient for people that already use it. If it encourages some less technical users to have a go with it, then that's a bonus, but because of the number of features (sliders/curves, filter length, preset manager, invert ...) I think it will mostly continue to be seen as a "power user" tool. For this reason, I think a quick and easy "tone control" would be a significant benefit for many users.

It is not an uncommon question to see someone ask "I've found the bass boost effect, but how do I do the opposite and reduce the bass?"
This begs the question, how can they find the bass boost without finding the Equalization effect?
I think the answer to this is that they immediately understand "bass boost", but "Equalization" sounds technical and scary so they skip over it.
If they saw "Tone Control", then my guess is that they would recognise that also.
Gale Andrews wrote:EQ does (in 1.3.13) have Treble Cut, Treble Boost, Bass Cut and Bass Boost presets. Any comments on those?
Yes - basically along the same lines as Bill, but that's a different discussion.

Tone Control plug-in
I've revisited this bit of code and made a few changes.

As mentioned, there is a potential hazard with the Normalise feature, so I have set that to OFF as the default.
This is a shame as it is a particularly useful feature of the effect, but there is currently no way to apply normalisation in Nyquist plug-ins without running the risk of crashing. Even the great R.D. has only succeeded in producing memory safe normalisation by using a 2 pass effect (a highly complicated Nyquist script that needs to be applied once to measure the current amplitude and a second time to apply the amplification).

This is a serious limitation in Nyquist that applies to several currently available plug-ins. My number #1 feature request for Nyquist would be for the peak amplitude of the selection to be passed to Nyquist, either as a Global variable, or as a property of "s".

If it is technically possible to do so, I would think that attaching the peak value of "s" as a property would be the better way to do it. The global variable "LEN" could probably be attached in the same way, and in the future possibly other properties, such as the track name (could be very useful for labels).

However, we currently do not have such a feature, so I've looked at alternatives.

I notice in my original code that I have used a very complicated method to calculate the peak amplitude. I did this to try and minimise the memory usage, but I think now that it is only of benefit to earlier versions of Audacity that were suffering from a bug that prevented memory from being released properly. This Audacity/Nyquist bug has now been fixed so there is no need for such a complicated method, so I have simplified this bit of the code.

To avoid the normalisation problem altogether, I have also produced a version (tonecontrol-2) that has an "Output Amplification" slider instead of Normalisation. I don't think this is as convenient for users, but it is safer.

The Help screens have now been fixed.

I'm not sure about including the "technical details" in the "Tips" section - it may be useful for some users so they can see exactly what the effect does, but does it undermine the "simplicity" of the effect? What do you think?

I have also made a third version (tonecontrol-3) that resamples the wave before calculating the peak level - I've seen this used in some of the existing plug-ins, but as far as I can tell it makes no difference to the speed or memory usage.

Here are the three versions.
tone-control.zip
tone control - three versions
(4.67 KiB) Downloaded 191 times
Learn more about Nyquist programming at audionyq.com

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10 / 11

Re: Tone control plug-in

Post by Gale Andrews » Thu Dec 02, 2010 12:37 am

steve wrote:
Gale Andrews wrote:I'm OK in principle as long as it replaces Bass Boost.
I'm generally OK with that, but there are some issues that should be considered.
Another issue may be that Tone Control will be well down at the bottom of the Effect Menu. Could be counteracted slightly by calling it "Bass/Treble Control"?
steve wrote: I've not seen any posts saying "oh oh oh, the Equalizer is so intimidating it scares me..."
but I get the impression from quite a lot of users that they have avoided trying to use the Equalizer because it looks too complicated.

I think the main benefit of a "reduced interface" for the Equalizer would be to make it more convenient for people that already use it. If it encourages some less technical users to have a go with it, then that's a bonus, but because of the number of features (sliders/curves, filter length, preset manager, invert ...) I think it will mostly continue to be seen as a "power user" tool. For this reason, I think a quick and easy "tone control" would be a significant benefit for many users.
I kind of get the impression from that that even a reduced interface for Graphic EQ may be over the heads of some users. My non-Forum correspondents (who are definitely not technically inclined as you noticed) seem reasonably OK with Graphic EQ on a "push a slider and hope" basis.. once they can find it. I would prefer EQ initialised to Graphic EQ.

The main benefit of Bass Boost though is I think the speed as much as lack of complexity. It gives you "something" like what you wanted quickly without a lot of agonising to get the "perfect" result. When I am in the mood to get the "perfect result", I use all the available graphic EQ sliders so I would regret some being removed.
steve wrote:As mentioned, there is a potential hazard with the Normalise feature, so I have set that to OFF as the default.This is a shame as it is a particularly useful feature of the effect, but there is currently no way to apply normalisation in Nyquist plug-ins without running the risk of crashing...To avoid the normalisation problem altogether, I have also produced a version (tonecontrol-2) that has an "Output Amplification" slider instead of Normalisation. I don't think this is as convenient for users, but it is safer.
I don't think "Output Amplification" will be useful if you are targeting more basic users. You could make the "Off" text for "Normalize Output" to be "Off (safer on long tracks)", though David Sky used to have normalise in a number of his older plug-ins and I don't think he was too worried about crashes.

I'd prefer a space between "0" or "-3" and "dB".
steve wrote: The Help screens have now been fixed.

I'm not sure about including the "technical details" in the "Tips" section - it may be useful for some users so they can see exactly what the effect does, but does it undermine the "simplicity" of the effect? What do you think?
I'd say ditch the technical details and the talk about bit depth in "Normalize Output". If you use some briefer text like this:

Code: Select all

(defun help ()
   (format nil
"TONE CONTROLS:
To increase treble (high frequencies) or bass
(low frequencies), move the appropriate slider to
right. Move the slider to left to reduce the 
treble or bass. 

Set the slider to center [0] for no change.

NORMALIZE OUTPUT:
Increasing or reducing treble or bass makes the
output louder or softer. The 'Normalize Output' 
option can adjust the loudest part of the output 
to compensate. If 'Normalize to 0 dB' sounds too
loud, try 'Normalize to -3 dB' instead. NOTE: 
Normalize could make Tone Control slow or liable
to crash if used on longer tracks or selections.

TIPS:
Test on a short section before applying to the
entire track. If you do not like the result, use
'Undo' from the 'Edit' menu. 

For technical details of this effect, see the 
comments in tonecontrol.ny."))
you can get away well enough with one screen I think.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

steve
Site Admin
Posts: 85703
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Tone control plug-in

Post by steve » Thu Dec 02, 2010 1:37 am

Thanks for the suggestions Gale.

I'm not sure about the first part of "Normalize Output" help - I'll sleep on it.

Yes I agree, technical details can go in the comments.
Gale Andrews wrote:When I am in the mood to get the "perfect result", I use all the available graphic EQ sliders so I would regret some being removed.
Absolutely - there are many occasions when I want to just knock down or up a specific range and anything wider than 1/3 octave would be too inaccurate. I would be strongly against permanently loosing some of the sliders - in the "reduced interface" mock-up that you referred to earlier, I very purposefully illustrated the number of bands as user selectable.
Gale Andrews wrote: I don't think "Output Amplification" will be useful if you are targeting more basic users.
Probably more useful than nothing. Just being there draws attention to the fact that they may need to adjust the overall level.
But I agree that Normalising would be a lot easier for many users.
Gale Andrews wrote: You could make the "Off" text for "Normalize Output" to be "Off (safer on long tracks)"
Good idea.
Gale Andrews wrote:though David Sky used to have normalise in a number of his older plug-ins and I don't think he was too worried about crashes.
Yes, I know - but I've already had complaints about the tone control making Audacity lock up, and the issue is exactly the same in many of David’s plug-ins.
We really do need a fix for this. Any attempt to Normalize a full side of an album is likely to push memory usage up by about 1 GB, which will be very unfortunate for many users. Any idea how I/we can get a developer interested in fixing it?
Gale Andrews wrote:you can get away well enough with one screen I think.
That would be nice, but I'd rather have 2 screens if it is necessary to make the instruction clear and useful. I'll have a think about the wording for the bit on "Normalise".

Of course, another alternative to "Bass Boost" would be if someone coded a tone control as a native (C+) effect - then it could have the preview, be faster, and no problem with Normalising (but given a choice I'd rather they implemented a method of passing the peak amplitude from Audacity to Nyquist as that would benefit so many more plug-ins).
Learn more about Nyquist programming at audionyq.com

steve
Site Admin
Posts: 85703
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Tone control plug-in

Post by steve » Thu Dec 02, 2010 2:19 am

How about - if instead of the Normalize control, I just put in an option:

Use Overload Prevention: Yes (read Help) / No (safer on long tracks)


and in the Help File:

Code: Select all

TONE CONTROLS:
To increase treble (high frequencies) or bass
(low frequencies), move the appropriate slider to
right. Move the slider to left to reduce the
treble or bass.

Set the slider to center [0] for no change.

OVERLOAD PREVENTION:
This option will automatically lower the overall
level if required to prevent distortion.
** WARNING ** If used on very long tracks or
selections it may crash Audacity.

TIPS:
Test on a short section before applying to the
entire track. If you do not like the result, use
'Undo' from the 'Edit' menu.

If Overload Prevention is disabled it may be
necessary to reduce the overall track level
before applying this effect.

For technical details of this effect, see the
comments in tonecontrol.ny.
Learn more about Nyquist programming at audionyq.com

waxcylinder
Posts: 15366
Joined: Tue Jul 31, 2007 11:03 am
Operating System: Windows 10 / 11

Re: Tone control plug-in

Post by waxcylinder » Thu Dec 02, 2010 11:07 am

steve wrote:
I think the main benefit of a "reduced interface" for the Equalizer would be to make it more convenient for people that already use it. If it encourages some less technical users to have a go with it, then that's a bonus, but because of the number of features (sliders/curves, filter length, preset manager, invert ...) I think it will mostly continue to be seen as a "power user" tool. For this reason, I think a quick and easy "tone control" would be a significant benefit for many users.

+1

I agree that it would be good to get the digital audio novices started off in a simpler, less intimidating way - But it is important that we retain the full EQ functionality too for the power users.

WC

steve
Site Admin
Posts: 85703
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Tone control plug-in

Post by steve » Thu Dec 02, 2010 12:11 pm

Bass/Treble effect (with optional Overload Protection)
Help screen (now only one) updated and Technical Details moved into comments.
Attachments
bass-treble.ny
(2.78 KiB) Downloaded 147 times
Learn more about Nyquist programming at audionyq.com

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10 / 11

Re: Tone control plug-in

Post by Gale Andrews » Fri Dec 03, 2010 2:11 am

steve wrote:I would be strongly against permanently losing some of the sliders - in the "reduced interface" mock-up that you referred to earlier, I very purposefully illustrated the number of bands as user selectable.
OK, I had forgotten user could choose number of bands, sorry. But even that control is itself a possible extra complication/confusion if users are struggling with EQ.

Is one extra pair of sliders worth considering for "Bass/Treble" so you have "Deep Bass", "Light Bass","Soft Treble","High Treble" or some such?
Steve wrote:Any attempt to Normalize a full side of an album is likely to push memory usage up by about 1 GB, which will be very unfortunate for many users. Any idea how I/we can get a developer interested in fixing it?

Of course, another alternative to "Bass Boost" would be if someone coded a tone control as a native (C+) effect - then it could have the preview, be faster, and no problem with Normalising (but given a choice I'd rather they implemented a method of passing the peak amplitude from Audacity to Nyquist as that would benefit so many more plug-ins).
Asssuming I'm correct this a problem with Audacity-Nyquist, then it (and anything else in the Nyquist wish list which is a bug /performance limitation) can in principle be tracked as a bug on Bugzilla (as opposed to an enhancement).

However, isn't your issue really the same as the existing Bug 87 "Nyquist implementation: Excessive memory usage" (which I think relates to usage in processing)? If so this has been raised before by Edgar-rft, and as Richard pointed out, seems almost insoluble because Nyquist memory management assumes source/destination audio files.

Hence the only practicable solution would seem to be that proposed by Leland (memory pool tracking).

Back to your Bass/Treble effect, in the technical details in the comments - is the output amplification only applied when needed i.e. you are talking about the "overload prevention"?

I noticed that prevention doesn't stop View Clipping showing individual samples here and there as clipped (e.g. if you go for positive EQs or repeat the effect). That's true with 32-bit or 16-bit data.

I think the prevention idea is good, but I'd prefer standard terminology e.g. "Prevent Clipping" if this is to be proposed for distribution in Audacity.

Other minor points:

* Do we need "Select help if required from menu" - should be obvious?

* "View Help: No (process)" confused me - It could be taken as the opposite (don't process the effect, show the help). There are two ways of handing this choice and I think it should be a "convention":

"Show Help Menu" : No,Yes

or

"<Apply Effect> or View Help": Apply Effect,View Help

Vocal Remover opts for the second solution, which I prefer as being clearer - but I don't mind the second solution if e.g "No (apply effect)" and "Yes".

"No (safer on long tracks)" overflows on Ubuntu 800x600 and even on XP 1024x768 at slightly increased DPI. So I think you will either have to put the "(safer on long tracks)" as a new line underneath "Allow Clipping" (or whatever); or just have "No (safer)" for the combo box text.



Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Post Reply