Fixing volume/pitch differences between recordings?

I recorded one of my audio books to my pc and added each section in to one project but the volume/pitch (I’m not very good at deciphering what the wave means) for some sections drifts up other drift down. Is there a way to fix this? I have attached a screenshot to make it clearer what the problem is, I would like to get section 3, 4, 5 & 7 in line with section 1, 2, 6 & 8.

Make a backup copy of the project first in case it messes up.
I presume that you have already exported each recorded section as backup WAV files - if not, do that asap.

When you have your back-ups safe, I’d suggest that you use the “Normalize” effect on each section in turn and Normalize to about -3 dB.
Then listen to each section and compare the volume. If any of the sections are noticeably louder than others, move the section to a new track and use the volume slider on the left of the track (in the Track Control Panel) to adjust the volume level down a bit.

If normalizing doesn’t do the job, try equalization which removes all frequencies below 20Hz, see attached image …
before (left) then after (right) equalization blocking frequencies below 20Hz (highlighted in red).jpg
You don’t need to equalize each section individually (as you would have to do with normalize) apply the (red) equalization to the whole thing.

Unfortunately neither solution worked. Compressor/leveller help a bit but I’m not sure they are the right tools to use.

What’s the problem sound like?
There’s only a limited amount that we can tell from a picture. If the issue that you are wanting to fix is “volume” (loudness) then use the amplify effect on sections to make them louder or quieter.

Apologies, I typed that in a bit of a hurry and originally missed out the important phrase “move the section to a new track”.
It would have been easier to adjust each section if you had left them on their own track rather than moving them all into the same track.

I’ve tried to replicate your problem (below) and the equalization trick works for me:
(below I’ve moved the vertical bit of the equalization “curve” away from the vertical axis so it is clearer)

If that equalization trick doesn’t work then the only other explanation I can think of is that, due to some hardware problem, you have an asymmetric waveform … Asymmetric musical waveforms

A sort-of cure for the asymmetry would be to adding or subtracting constant values to each section individually, to shift it up or down, so they are all approximately symmetrical about the zero line. Steve may know the (Nyquist) command used in Audacity to add/subtract a contant (DC offset) value.

There is a slight shift up/down in volume between sections and the audio changes in depth? (it sometimes sounds more hollow)
I think I’m just going to leave it as it is and live with it, I recorded it from tape so I didn’t expect high quality audio.
Thanks for trying to help.

Found it, (at least for a mono track) …

 (setf s (sum s (* 0.3 1.0)))

Select the part of the waveform you want to shift up/down, put that code into the “Nyquist Prompt”, (in Audacity “Effect”),
Change the “0.3” to the offset value you need to shift the waveform up or down by, (negative value moves it down).

At the start and end of where the offset has been applied the waveform will go vertical and there will be a click,
use “fade-in” and “fade-out”, (in Audacity “Effect”), to replace the vertical bits of the waveform with slopes, (which won’t produce a click).

[NB: the equalization trick that I’ve mentioned (twice) in this thread will correct the two offset bits in the waveform in ths post simultaneously ].

Trebor, I notice that you are assuming that the problem is DC off-set. While the image posted by Ezekiel000 certainly appears to have DC off-set, at that zoom level I don’t think it’s really possible to tell if it is DC off-set, or that the waveforms are asymmetrical. Whether it is just asymmetry in the waveform or DC off-set, neither of these phenomena are audible.

My best guess is that the main difference that Ezekiel000 is hearing is a difference in the tonal quality (frequency), possibly due to recording on different days and sometimes being closer or further away from the microphone. If that’s correct, then just changing the volume will give only a very approximate match. Some further improvement could perhaps be made with Equalization, but it’s difficult to say anything useful down that road without being able to hear the problem.

Regarding applying an off-set with the Nyquist Prompt effect:
For a mono track all you need is

(sum s 0.3)

to apply a +0.3 (linear) shift.

For a stereo track there are two common methods:
The short but cryptic way:

(multichan-expand #'sum s 0.3)

and the long-hand method:

  (sum (aref s 0) 0.3)
  (sum (aref s 1) 0.3)

The long-hand method allows the off-set to be applied individually to the left and right channels. (aref s 0) is the left channel and (aref s 1) is the right channel.

On Ezekiel000’s screengrab each section is consistently offset, but some sections are negative some positive: an ultra-low frequency alternating signal could cause that presentation (say 0.001Hz , peak amplitude 0.2) , however the equalization I suggested, removing everthing below 20Hz, would have cured that and removed all the offsets.

Thanks anyway Steve for posting the Nyquist code for adding DC offset to stereo: that will come in handy when I encounter asymmetrical waveforms and want to maximize the volume.

Yes, the equalization that you suggested would have cured any offsets, but Ezekiel000 said that it didn’t work, which would suggest that the problem may not be DC offset.

I expect that you are already aware that waveforms can have peaks that are significantly more positive than negative, or the other way round, with any DC offset being present, but try running this code on a selection to see a really clear example:

(mult -0.2 (sum (osc-tri 200)(osc-tri 400)(osc-tri 800)))

You’re welcome. If you’re interested I can show you how to add DC offset to a selection, but keep the ends of the selection unchanged. But that’s really going off-topic, so if you’re interested in pursuing that, then the Nyquist board would be a good place to start a new thread.