Command line leveller effect

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
Sergey1024
Posts: 4
Joined: Tue Mar 24, 2009 4:55 pm
Operating System: Please select

Command line leveller effect

Post by Sergey1024 » Tue Mar 24, 2009 5:07 pm

Hello,
I have been using the Leveller (by Lynn Allan) effect of Audacity, and it works great.
But I need to apply the Leveller to several hundred files and it is very tedious to do it in the GUI.
Is there any way to use this effect from the command line or in a batch mode?
Thanks in advance,
--Sergey

kozikowski
Forum Staff
Posts: 68941
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Command line leveller effect

Post by kozikowski » Tue Mar 24, 2009 8:51 pm

The Audacity version of Leveler is a brute force peak limiter that sounds worse and worse as the compression value goes up. I've been known to use it in the higher settings to simulate a police radio.

I personally like Chris's Compressor...

Chris's Compressor
http://pdf23ds.net/software/dynamic-compressor/

It simulates the compression found in a radio station, so it's really easy to ignore what it's doing. You may be able to apply this filter to groups of files in Audacity 1.3 Chains command.

Koz

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

Re: Command line leveller effect

Post by steve » Wed Mar 25, 2009 3:53 am

kozikowski wrote:You may be able to apply this filter to groups of files in Audacity 1.3 Chains command.
Unfortunately you can't. But if you import several tracks into Audacity, you can apply the effect to many tracks at the same time.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

AngeloBalza
Posts: 1
Joined: Wed Mar 25, 2009 10:14 am
Operating System: Please select

Re: Command line leveller effect

Post by AngeloBalza » Wed Mar 25, 2009 10:19 am

Hi,
I have the same needs. Tried to download from Chris' blog but the software seems doesn't work properly....

So is NOT possibile to use Audacity from command line to distort some voices in wav files?

May thanks,

Angel

Sergey1024
Posts: 4
Joined: Tue Mar 24, 2009 4:55 pm
Operating System: Please select

Re: Command line leveller effect

Post by Sergey1024 » Wed Mar 25, 2009 12:17 pm

Thanks for explaining the shortcomings of the Leveller (by Lynn Allan) and for the reference to Chris's Compressor.
I see another Compressor (by Dominic Mazzoni) in Audacity effects menu.
Do you know what is the difference between Chris's and Dominic's compressors?
Thanks a lot,
--Sergey

kozikowski
Forum Staff
Posts: 68941
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Command line leveller effect

Post by kozikowski » Wed Mar 25, 2009 8:58 pm

Most of the Audacity embedded effects were produced by implementing the appropriate math function, see if it works OK, and out the door. They do just what they're supposed to do, full stop.

Chris did his by carefully listening to each iteration and changing the code around until it sounded better. He also made it one stop shopping. It's not unusual for jobs with the other filters to take multiple steps to get everything just right. Chris thought that could be way better, so he built all the usual tools into one step.

World of difference and like I said, with one minor change to Chris's presets, (change the compression to .77) his compressor sounds amazingly like one of the Los Angeles NPR radio stations.

Koz

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

Re: Command line leveller effect

Post by steve » Wed Mar 25, 2009 11:01 pm

Technically, one of the main differences between the standard Audacity compressor and Chris's, is that the standard Audacity compressor is built around an algorithm for a traditional dynamic compressor with a relatively slow attack time. This means that when you use it on sounds that have sharp transients (such as percussive instruments), the initial peak will occur before the compressor starts to respond. The advantage of this is that it can help to even out the average level of a track, but sudden peaks are relatively unaffected, so that you still here the sharp attack of percussive sounds. The disadvantage is that it is useless for limiting peak sounds to within a set range (which is not what it is designed to do).

Chris's compressor on the other hand, looks ahead at what sound is coming next, and starts to adjust the gain in anticipation. It is ideal for evening out the average loudness of music (reducing the dynamic range) AND limiting the peaks. (A more detailed explanation is given on Chris's web site). It was primarily designed for reducing the dynamic range of classical music to make it easier to listen to in noisy environments (in a car). As koz intimated, rather than looking at implementing a particular algorithm, Chris has set out to solve a particular problem, and in the process has produce a very effective, and "musical" compressor that lends itself very nicely to many dynamic processing jobs.
kozikowski wrote:with one minor change to Chris's presets, (change the compression to .77)
It is easy to set the default settings to whatever you wish. As this is a "Nyquist" effect, the code is in plain text and may be edited in an ordinary text editor (such as NotePad).
To change the default compression ratio, look for the line (fairly near the top) that contains:

Code: Select all

;control compress-ratio "Compress ratio" real ""
At the end of that line are 3 numbers - the first is the default value, the second is the minimum value (-0.5), and the last is the maximum value (+1.25)
To set the default compression amount to 0.77, make the line :

Code: Select all

;control compress-ratio "Compress ratio" real "" .77 -.5 1.25
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

kozikowski
Forum Staff
Posts: 68941
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Command line leveller effect

Post by kozikowski » Thu Mar 26, 2009 3:01 pm

This is me printing the screen.

My particular application is capturing "radio" talk shows and listening in the car. The internet version has the volume compression of the original performance, that is, usually none. If somebody leans into the microphone, they get a lot louder in a big hurry.

The air show, of course, levels all that out so you can listen anywhere. That's what Chris does.

I just posted on his web site that he is now Officially Popular. Google will hit him even if I spell his name wrong.

Koz

Sergey1024
Posts: 4
Joined: Tue Mar 24, 2009 4:55 pm
Operating System: Please select

Re: Command line leveller effect

Post by Sergey1024 » Thu Mar 26, 2009 3:41 pm

Thank you both for the detailed explanation.
I see that Chris’s version does have the standalone command line version (though it requires MONO).
(I can't find the source code for it yet - I will ask the author.)
Thanks a lot again!
--Sergey

kozikowski
Forum Staff
Posts: 68941
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Command line leveller effect

Post by kozikowski » Thu Mar 26, 2009 4:22 pm

It's a text file (xml instructions).
Open it up in TextEdit or NotePad.

Koz

Post Reply