Audiobook mastering (In Development and Test)

Share your Audacity/Nyquist plug-ins here, or test drive the latest plug-ins submitted by Audacity users.

After testing a plug-in from this forum, please post feedback for the plug-in author.
christop
Posts: 21
Joined: Tue Jun 04, 2019 8:27 pm
Operating System: Linux Debian

Audiobook mastering (In Development and Test)

Post by christop » Fri Sep 20, 2019 12:46 am

Here's my attempt at a "process" type of plug-in to automatically apply the three steps listed in the Audiobook Mastering version 4 thread.

A few notes:
  • I used highpass4 for the equalization step as that seems to give approximately the same rolloff as the "low rolloff for speech" EQ preset (about 24dB/octave).
  • I used code from the Limiter plug-in but removed some of the options that are not applicable to audiobook mastering to keep the interface simple and uncluttered.
  • This plug-in processes stereo channels independently, since I'm too concerned about processing stereo for audiobooks.
Any thoughts/suggestions/improvements? This is my first Audacity plug-in, so let me know if I messed anything up.
Attachments
master-audiobook.ny
(3.89 KiB) Downloaded 136 times

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

Re: Audiobook mastering

Post by kozikowski » Fri Sep 20, 2019 1:29 am

Did it work? Apply conventional tools according to the instructions and then run your code on the same sample.

It seems to be a race. Neil Darlow produced Macro code for using the existing tools in one step.

viewtopic.php?p=377215#p377215

The only reason this isn't a gift from the angels is one of the mastering tools, RMS Normalize doesn't come natively with Audacity—yet. So the Macro isn't stand-alone. Soooo close.

As we go.

Koz

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

Re: Audiobook mastering

Post by kozikowski » Fri Sep 20, 2019 1:49 am

This will need to hang until Steve (Senior Elf) gets back from holiday. He's one of the humans who can speak code. The code includes proper name, time and date, so I'm happy.

I noticed "brick wall" mentioned in the code. Effect > Limiter: Soft is used intentionally in existing mastering because it can tame expressive, theatrical presentation and nobody (so far) can hear it working.

Also, I couldn't follow the activity (no surprise there), but the steps have a very specific order. If you need the brick wall and other management, there's a good chance your application order may be wrong.

Koz

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

Re: Audiobook mastering

Post by kozikowski » Fri Sep 20, 2019 2:49 am

First-pass sound test. Top to bottom: Classic Mastering, Master Audiobook, and the original voice performance.

Screen Shot 2019-09-19 at 19.20.13.png
Screen Shot 2019-09-19 at 19.20.13.png (32.92 KiB) Viewed 1422 times
Master Audiobook (in the middle) has significant wave distortion with non-symmetrical up/down overall bending and the first word has significant negative waveform compression missing in the positive.

Note the same passage with classic processing (on top) is clean and symmetrical like the original, and only if you're paying strict attention do you find that the overall volume has been boosted very slightly and the fine tips of the peaks have been compressed to meet the ACX peak specification.

And I may know why. Classic Mastering intentionally creates distortion at the RMS Normalize step. It's perfectly normal for the sound channel to overload and send peaks above 100% in order to get the RMS volume correct. But this doesn't matter because Audacity works internally in 32-float format which doesn't overload. The last step, Soft Limiter, gently pushes all those overloading peaks back into compliance with no harm done.

Because the formerly overloaded peaks have very low RMS/loudness, this peak correction makes little or no difference in the final outcome—except to pass ACX.

There is one more difference I noted. The high pass filter doesn't have quite the moxie (technical term) that Low Rolloff does. It makes no difference in this particular case, but in the field, microphones can produce low frequency garbage that can be louder than the show. Also, many home microphones produce low pitch trash because, who's going to know and after all, it's expensive to fix and everybody looks at the price first.

We will know, because that kind of trash can keep you from passing ACX.

The top one is classic mastering, the bottom one is Master Audiobook.


Screen Shot 2019-09-19 at 19.42.28.png
Screen Shot 2019-09-19 at 19.42.28.png (30.9 KiB) Viewed 1422 times
Screen Shot 2019-09-19 at 19.42.55.png
Screen Shot 2019-09-19 at 19.42.55.png (23.12 KiB) Viewed 1422 times

Koz

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

Re: Audiobook mastering (In Development and Test)

Post by kozikowski » Fri Sep 20, 2019 2:57 am

This is a very well behaved sound test. Those distortions may get worse with a New User and a straight-out-of-the-box microphone.

Koz

christop
Posts: 21
Joined: Tue Jun 04, 2019 8:27 pm
Operating System: Linux Debian

Re: Audiobook mastering (In Development and Test)

Post by christop » Fri Sep 20, 2019 4:30 pm

Thanks for the feedback!

I did make sure the plug-in follows the steps in the proper order (equalize, RMS normalize, soft limit), as shown in the last handful of lines in the plug-in:

Code: Select all

  (let* ((equalized (equalize sig))
         (normalized (norm equalized))
         (limited (softlimit normalized thresh hold)))
(Those are done in exactly the order as listed, top to bottom.)

The mention of "brick wall" is from limiter.ny (Steve Daulton's Limiter plug-in). The "hardlimit" function is used by the "softlimit" function. To be honest, I don't know exactly how it works, but the limiting step in my plug-in should be identical to the soft limiter in the Limiter plug-in because I'm using the exact same code. If you zoom in on the waveform that looks clipped on the bottom, you'll probably see that it's not actually clipped (the peaks just all line up).

I suspect all of these differences are from using a fourth-order Butterworth high-pass filter (the "highpass4" function) instead of an equalizer in the "equalize" step. I've noticed that it often changes the waveform differently (visually) than the equalizer. It sometimes pushes the wave form up or down more than the equalizer does, which then causes the top or bottom to look clipped after the soft limiting step runs. From what I've read just now, a Butterworth filter has nonlinear phase response, which likely explains the differences we see. I'll look into changing the equalization/high-pass filtering step with something better (low or zero phase response). Hopefully that will fix both the waveform symmetry issue and the low-frequency trash issue.

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

Re: Audiobook mastering (In Development and Test)

Post by kozikowski » Fri Sep 20, 2019 8:18 pm

the waveform that looks clipped on the bottom, you'll probably see that it's not actually clipped (the peaks just all line up)
I'm not shocked. That exactly what happens if the performance actually overloads, except it happens to both positive an negative peaks. Most important the Soft Limiter smooshes (technical term) the peaks in such a way that they sound fine.
The mention of "brick wall" is from limiter.ny
I believe you. This is me, not a programmer.
the "highpass4" function
I can believe that. If somebody forced me to describe the damage, I'd say the 0Hz to 2Hz "DC level" was wandering giving the apparent effect of overall waveform rising and falling.

Both Butterworth and Chebyshev are messy, just in different ways.

That rolloff has a history. It's a close cousin to the rumble filter seen on sound mixers and in particular field mixers for exterior movie sound tracks. It's a terrific compromise but you can still fake it out. If you have an announcing voice that goes down that low, "NBC Radio News on the Hour," that might not be the filter for you.

This is the text version of the equalization effect. I think the name was the only thing that ever changed. It was designed as LF Rolloff... and got changed into Low Rolloff... for its debut.


<equalizationeffect>
<curve name="LF rolloff for speech">
<point f="50.0" d="-120.0"/>
<point f="60.0" d="-50.0"/>
<point f="65.0" d="-24.0"/>
<point f="70.0" d="-12.0"/>
<point f="80.0" d="-4.0"/>
<point f="90.0" d="-1.0"/>
<point f="100.0" d="0.0"/>
</curve>
</equalizationeffect>


Here's a thing I wrote on the sister posting.

viewtopic.php?p=377331#p377331

Koz

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

Re: Audiobook mastering (In Development and Test)

Post by kozikowski » Fri Sep 20, 2019 8:23 pm

That's the current curve. At a length of 4855, that green line is what it's really doing.


Screen Shot 2019-09-20 at 13.20.59.png
Screen Shot 2019-09-20 at 13.20.59.png (41.94 KiB) Viewed 1373 times

Koz

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

Re: Audiobook mastering (In Development and Test)

Post by steve » Mon Sep 23, 2019 1:36 pm

christop wrote:
Fri Sep 20, 2019 4:30 pm
The "hardlimit" function is used by the "softlimit" function.
If I recall correctly, that is there as a precaution against peaks that exceed 0 dB. Of course there shouldn't be any peaks greater than 0 dB in the original audio, but if there are, then the "soft limiter" alone would do nasty "wrap around" things to them. The brick-wall limiter is used to ensure that can not occur.
christop wrote:
Fri Sep 20, 2019 4:30 pm
the limiting step in my plug-in should be identical to the soft limiter in the Limiter plug-in
It would be a good idea to test that.
Create a test signal, and duplicate it. To one copy, apply the effects one at a time. To the other copy apply your plug-in. If the results are not identical, you have a bug.
christop wrote:
Fri Sep 20, 2019 4:30 pm
From what I've read just now, a Butterworth filter has nonlinear phase response, which likely explains the differences we see.
The Butterworth filter will, as you say, look different from the Equalization effect, due to differences in phase response, but that should not be a problem - the difference should not be audible. However, that flat bottom waveform looks suspicious.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

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

Re: Audiobook mastering (In Development and Test)

Post by kozikowski » Mon Sep 23, 2019 6:39 pm

If I recall correctly, that is there as a precaution against peaks that exceed 0 dB. Of course there shouldn't be any peaks greater than 0 dB in the original audio, but if there are, then the "soft limiter" alone would do nasty "wrap around" things to them. The brick-wall limiter is used to ensure that can not occur.
Writing that down.

Since the Limiter is the third step and it follows RMS Normalize which can create intentional "overload", how does it know the original show had clipping?

Koz

Post Reply