Mix and Render -> clipping

Hello…

Maybe basic question. How to avoid clipping?
Let’s for example make two track with tone (generate->tone gain=1) so we got two track of same tone with 0dB gain. If I now Mix and render that two tone I got a lot of clipping. But normalizing that seems to give undistorted waveform. So what is ‘correct’ wai to go and is it there some automatics?!? Ie what is better? To normalize both tracks to -6dB before mixing or to normalize mixed track to 0dB?

Is there some control to make that automaticaly on the fly?

Slavko

By default Audacity uses 32-bit (float) audio tracks. 32-bit float is different from the other supported formats as it can handle signals that a re greater than 0 dB (only in recent versions of Audacity - old versions of Audacity would always clip at 0 dB regardless of the format). This means that you can (as you have observed) mix tracks that, when combined, exceed 0 dB, then Amplify the mixed track by a negative amount and bring it back into normal audio range without clipping.

Although 32-bit (float) audio can exceed 0 dB, some effects and processes will clip at 0 dB, so “good practice” is to ensure that individual tracks are always below 0 dB.

If you play a multi-track project and the combined sound exceeds 0 dB, then the output meter (green) will indicate that the output sound is being clipped (red line appear at the right-hand end). You will also probably hear that it is clipping. Although the 32-bit float format can support values over 0 dB, sound cards will still clip the audio at 0 dB. So generally the best approach is to adjust the track levels as you go to avoid clipping on playback. Usefully it is not necessary to be too fussy about this, as if the mix goes a bit over 0 dB in one or two places, it can be brought back down into normal range after mixing.

Note that there is a difference between amplifying using the “Amplify” effect and amplifying using the “Normalize” effect. The Amplify effect amplifies both channels of all selected tracks by the same amount, whereas Normalize will amplify each channel of each track by whatever amount is required to bring the peak level to the target level.

If you are amplifying stereo tracks and you want to preserve the Left/Right balance then you would use the Amplify effect as a higher peak on one channel would cause the Normalize effect to amplify one channel more than the other.

For multi-track projects, if you want to amplify and preserve the relative levels of all tracks, then you can select all tracks (Ctrl+A) then use the Amplify effect. The relative levels will be maintained.

There is no fully automatic way to adjust the mix level on the fly as with real world sound (as opposed to test signals) it would usually be undesirable to do so. For example. if you have 3 tracks, 2 voice tracks and one instrumental track. Do you want one voice track to be prominent (at the front) and the other two tracks in the background? Do you want both voices at the front and the music in the background? Do you want an equal balance of all three tracks? Do you want the music in the foreground and the voices in the background? Audacity has no way of knowing your artistic objectives and any attempt to automate the mixing is likely to produce the wrong result in the majority of cases. The “Mixer Board” (“View” menu) provides a useful tool for adjusting the track levels as it allows you to adjust the playback level of each track while the project is playing. When you have adjusted the levels so that the “mix” is as you like it (so that it sounds right and does not clip), you can then “mix down” the tracks into a single track (Tracks menu > Mix and Render). This final mix track can then be amplified (Amplify effect) to bring the overall level up or down to the required level.

Hello…

Thanks for explanation. I already gees that floating point samples are the reason why the clipped signal can be normalized without distortion. But the second part of message is still confusing me.
Here is for example what I want.
The first track is recorded vocal. The peak amplitude is somewhere around -3dB. After that the second track is dubbed while the 1st is playing. The second track has the peak around -3dB too. Now when I overdub the third track there are problem. The playing 1st ans 2nd track summed has amplitude over 0dB and has clipping. Thats bad. Now how to proceed with that? One way is to make already recorded tracks to have peak under -6dB and summ is under 0dB. Thats work. But when I recorded the next track and want to record next one then I got clipping again. And with next recording again. So I Think that I should keep all tracks recorded with maximum possible dinamycs (peak just below 0dB) and somehow just control the playback (mixing) gain. So when Audacity playing multiple tracks it already does same job as mix down. But how to calculate the correct gain and where to apply that without modifing samples?

That’s a good question and accurate deductions.

Usually when overdubbing I only listen to one or two previously recorded tracks rather than the whole mix. I find that this helps with accurate timing as each recorded track is played (hopefully) in time with one “click track” (not necessarily a “click” track - but a common rhythmical track). This approach will not suit all recording jobs, but is often a useful approach.

Onto your main question:
The “Mixer Board” (View menu) duplicates the effect of the volume and pan sliders on the left side of the audio tracks, but with much bigger volume sliders, so they are easier to control. These sliders affect playback and do not have any effect on the audio data.

As a rough guide, reducing the playback level by about 4 dB per track will usually keep the mix below 0 dB. The exact amount could be anything up to -6 dB, but you do not need to be totally precise with the playback levels while you are recording. All you need is a “good enough” mix to allow you to record the next part. Precise mixing is done after you have recorded all of the parts.

Personally I’d like a “master playback volume” slider that either adjusted all of the track sliders in tandem, or acted like a Main Mix slider on a real hardware mixer, but we don’t currently have such a feature in Audacity.

Note also that when using 32-bit float as the audio track format, the precision is so high that you can amplify the track volume up and down by a lot and do it repeatedly with virtually no loss of sound quality. You would have to make really extreme amplification changes to cause noticeable deterioration of the sound quality. For example, if you amplify a track by -50 dB, then amplify by a further -50 dB, then amplify by a further -50 dB, and again by a further -50 dB (a huge total reduction of -200 dB) and then Normalize back up to the original level, I doubt that you will hear the difference from the original.

Theoretically, using the mixer board will produce higher quality than “destructive” amplification, but in practice (with 32-bit float) you can use either method. I often use a combination of these methods - sometimes it’s more convenient to use the Mixer Board (or track volume sliders) and sometimes it’s more convenient to amplify the tracks.

Tip: A quick way to amplify all tracks by the same amount: Ctrl+A (select all) then “Effects menu > Amplify”.

Hello…

Usually when overdubbing I only listen to one or two previously recorded tracks rather than the whole mix. I find that this helps with accurate timing as each recorded track is played (hopefully) in time with one “click track” (not necessarily a “click” track - but a common rhythmical track). This approach will not suit all recording jobs, but is often a useful approach.

This is the ‘studio way’. But I do that record’s for fun. And when we record the vocals and/or instrument’s we like to hear few track’s. For example. The start is metronome/click track and recorded is clarinet. Then clicktrack is deleted (just few lead clicks is still present) and trumpet is overrecorded. After that vocals come. And recording one with hearing both instruments is way funnier than lisstening clicktrack. (we don’t have the drummer :frowning: )

As a rough guide, reducing the playback level by about 4 dB per track will usually keep the mix below 0 dB. The exact amount could be anything up to -6 dB, but you do not need to be totally precise with the playback levels while you are recording. All you need is a “good enough” mix to allow you to record the next part. Precise mixing is done after you have recorded all of the parts.

-6dB is for 2 tracks… for next one the problem comes. and every new track set more problems if we want to keep levels same.

Personally I’d like a “master playback volume” slider that either adjusted all of the track sliders in tandem, or acted like a Main Mix slider on a real hardware mixer, but we don’t currently have such a feature in Audacity.

That is (probably) the best way as all tracks can be leaved to the bear 0dB figure. I’m not sure but the Audacity mixer toolbar(not board) seems to do just that?!?

Note also that when using 32-bit float as the audio track format, the precision is so high that you can amplify the track volume up and down by a lot and do it repeatedly with virtually no loss of sound quality. You would have to make really extreme amplification changes to cause noticeable deterioration of the sound quality. For example, if you amplify a track by -50 dB, then amplify by a further -50 dB, then amplify by a further -50 dB, and again by a further -50 dB (a huge total reduction of -200 dB) and then Normalize back up to the original level, I doubt that you will hear the difference from the original.

With 16bit sampling depth is it hard to see(hear) differences but is there. But with 24bit soundcard this can make problem too. (but that’s not my case)

Theoretically, using the mixer board will produce higher quality than “destructive” amplification, but in practice (with 32-bit float) you can use either method. I often use a combination of these methods - sometimes it’s more convenient to use the Mixer Board (or track volume sliders) and sometimes it’s more convenient to amplify the tracks.

Tip: A quick way to amplify all tracks by the same amount: Ctrl+A (select all) then “Effects menu > Amplify”.

Just wan’t to avoid thinking what is the best in current situation.

Possible solution?!:
As Audacity mixer toolbar seem’s to do the job (to work like Amplify efect) I think the good way to set proper level is to LIMIT position of that slider to just alow gain to get all currently playing tracks to the 0dB (or -3dB) and thus prevent clipping. And same with the downmix.

If Audacity automatically limited levels so clipping could never occur this could cause problems:
say there was a track which only had a solo, which came in part-way through a multi track mix,
with the automatic limiting you have suggested the soloists volume would be way too low.

It’s one of the studio ways (and over-used in my opinion :stuck_out_tongue: )
Generally, for multi-track recording, my preference is to have a “click track” that is one or more real instruments, played by real people, rather than a rigid mechanical (electronic) click.

Unfortunately not. The mixer toolbar will adjust the output (playback) level, but that is after the sounds from the tracks have been mixed together, so it does not prevent the mix from being distorted - it just makes the distorted mix quieter.

As long as your individual tracks are recorded below 0 dB (without clipping distortion), then the levels can all be adjusted after the tracks are recorded. For the purposes of your “monitor mix”, it does not really matter what method you use to adjust the mix. Technically the “best” way is to use the Mixer Board, but my advice would be; don’t get hung up on it - use whatever works for you.

Huh…

Seems that my english is to bad to post correct question. So I will try to rephrase it with example.
So just drop dubbing and other and focus on main volume.

Assume I have 8 mono audio tracks all with different level’s and panning to be just harder.
Now I want to make playback for all tracks except track 7. (for example I have two differents vocals on track 7 and 8).
The mixer output is way to high so clipping ocour. How to avoid that?!? I see the use of ‘Amplify’ ussable here. But here we need to set proper level. So how to ‘gues’ proper factor? One way is to sum -3dB for each present track. so for 7 of them the -21dB si the figure. But doing that the output is to low. So is there some toll to scan all the files and sugest the correct level? (The max possible level without clipping)

Why I just don’t do that with manual guesing? If I switch vocals from track 7 to track 8 the setting is different again…

I presume that you’re not recording full scale sine tones, but are recording real instruments and voices, in which case the first few tracks will probably not distort (much) when they are mixed together even if you do nothing.
At any convenient stage during the recording process you can adjust the mix using the techniques already described (probably using the Mixer Board).
A headphone amplifier is a useful piece of equipment as it allows you to adjust the overall level in your headphones, but if you don’t have one then you can use the sound card’s volume control.
Make a rough mix, ensuring that the mix does not clip, then adjust the overall output level with the sound card volume, or the mixer toolbar, or a headphone amp.

To make the meters easier to see, you can click and drag to resize the meter toolbar. I usually have the meters full screen width.
multitrack.png

Hello Steve…

In your image you have 5 tracks. So if all of them is recorded to 0dB then you have clipping. But if you have peak at -15dB (5tracks * -3dB) then no clipping is possible (at mixer sliders all at 0dB). But there are heck. Let’s assume that we have just 3 tracks. To get best noise figure they should be recorded as close to 0dB mark as possible, but before playback normalized to -9dB to avoid clipping. This works but isn’t best way as we can have few dB in spare. just look that situation…

Again 3 tracks.
The 1’st is rhitm section (drums) with peak at -6dB. The second one is the Solo clarinet with peak at -6dB and the third is vocal at -6dB. So the mix of them should have clipping but does not as clarinet play when vocal is very quiet or not present at all and vice versa. So clipping never occour. So again the question 'How to measure the SAFE maximum level with real peak values and all sliders accounted?
In other words If I hit play the bacground proces is realy the “Mix and render” with output to sound card instead file.
So if I do “Mix and render” I got output (can have clipping but it’s 32bits float so can be repaired) and on that mixed signal I do the ‘Amplify’ I got needed amplification to reach required level. So how to got that value without do Mix and render?


Or example How to easy got correct value?
Again example.
Track 1 has sine 0dB
Track 2 has same sine at 0dB
Track 3 has same sine at -6dB
With all sliders we have nasty clipping.
So How to get correct value to amplify all the chanells (need to preserve ratio!) and not have clipping?
For now I do (select all track I want) in this case all of them and do “Mix and render” then I click Amplify just to got sugested value (-8dB in this case) and cancel operation and then undo mix and render. So now I know I need to amplify all track with -8dB to avoid clipping. So is there easyest way to got that?

You don’t need to know what the levels will need to be.

You’ve got all the tools, it’s really just a matter of familiarity and practice now.
Perhaps this will help:

http://youtu.be/CZCWgJo7-iM

Hello… In that video is just what I wan’t to avoid.
Trying to set correct volume! I can set volume like in the video. And assume that I got just right ratio of all the instruments. Then In near the end of song everybody does cressendo and got clipping. How to decrease all the sliders with same amount?!? As I know here are no master volume. So My point is to ‘amplify’ all signal (sumed) to just below clipping. Then With any position of mixer buttons I can’t got clipping. For now I just normalize all track with NoOfTracks*-3 [dB] level. It’s works nice but in some wery quiet portition the noise is more audible. (with 8 tracks and -24 dB normalization)

The grownups never produce and edit music just below clipping. That’s asking for trouble. Leave generous headroom. Broadcast “natural” volume (for example) is -20dB in the US, -18dB in Europe. That’s 20dB of room for explosions, applause, gunshots, and expressive music.

Final level setting is saved for rendering and Export when you’re ready to create the deliverable. That’s when you go into volume management.

If you have an enormous difference between the low portions of the show and the high, you may need to apply loudness compression either manually with the Envelope Tool, or semi-automatically with the internal Audacity compressors. Chris’s Compressor is a grand master at musically reducing the volume range of a track or show.

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

Koz

The grownups never produce and edit music just below clipping. That’s asking for trouble. Leave generous headroom. Broadcast “natural” volume (for example) is -20dB

I can’t agree with all of that. So if I record with 16bit card and -20dB then then I in reality acquire data with just 13 bits. So the SNR is quite bad. So for recording to keep SNR good we must acquire as close to 0dB but with prediction to safety level. So the peak wil probably be somewhere in -6 to -3dB range. Processing in Audacity with 32bit float has veri little (barely audible) difference if processing is done in 0dB or -20dB. Of course if we have 24bit acquision card with 144dB range we can do the recording at -20dB range and to have good dynamic range.

So for test just pick one soundtrack with deep dynamics and normalize it to 0dB then make mp3. Normalize same track to -20dB and make mp3 too. Then listen to them. (setting volume for 20dB louder when listen second one) If you don’t hear difference then I presume you are deaf :blush: (kidding)

Which is why nobody doing original work of any quality uses 16-bit. This slides directly into Audacity’s problem managing 24-bit. 16 yes, and 32-floating, but there are pages of people having problems with 24-bit, either recording directly, or converting from 32-floating for delivery.

Straight 16-bit gives you a better than 90dB loudness range. If everything works properly, that’s 20dB headroom with a 70dB + noise floor. The -20dB thing is a delivery format and much production is done at that standard, but you certainly don’t have to. You do need to meet certain standards because the Galactic Overloards are talking about Commercial Loudness Reduction again. “How come the Geico commercial is so much louder than ‘Dancing with the Stars?’”

If you have noisy hardware, then you run into exactly the same problem they had with analog tape. It overloads here, and the noise floor is there. It’s your job to shoe-horn the show into the middle, and yes, it wasn’t fun.

44100, 16-bit Stereo is a compromise designed to get Music CDs out the door in 1980. It is neither a very high quality format for production nor a desired goal.

Koz

…as I know the many hobby users are stil on 16bit/44-48kHz hardware and Audacity as free is well suited to hobby use.

With reasonable recording levels (does not need to push hugely close to 0 dB) very professional sounding results can be achieved with 16-bit recording.
A peak recording level of -10 dB still puts the digital noise floor 86 dB below the peak level, which is very good, and (subjectively) much better than occasional clipping.

In general:
If you have 3 tracks which you want to mix and you want to be able to use all of them to full scale (1.0 FS, or 0dB) then you can calculate the required multiplication factor like following:
Since we are adding 3 signals of potentially 1.0 FS the sum signal is potentially 3.0 FS. This can not be represented in the final representation system. So we need to divide the end signal by 3 or, in dB: lower the end signal by 20 x log 3 = 9,54 dB (use the log with base 10 on your (software) calculator !!!)


When you have:
Track 1 has sine 0dB
Track 2 has same sine at 0dB
Track 3 has same sine at -6dB

You can calculate like so:
The 0 dB signals use 1.0 FS
The -6dB signal uses 10^(-6/20) = 0.5 FS (using the inverse form of the log calculation above)
The sum of these signals would use 1 + 1 + 0.5 = 2.5 FS
To bring back the 2.5 FS signal to within 1.0 FS you need to divide the sum by 2.5 or lower it by 20 x log 2.5 = 7.96 dB

Since the multiplication of a sum is the same as the sum of the multiplication of the terms of that sum, you can reduce all tracks the same amount (factor or dBs) before summing them, to keep the balance of the tracks. This would certainly be the preferred (and only) way if you are not using an intermediate representation system like floating point which can store signals bigger than 1.0.

Works fine with test tones, but with real-world audio the sum (“mix”) of three audio tracks with peak levels of 0 dB, 0 dB and -6 dB will almost always be less that 7.9588 dB (2.5 linear). It will only sum to 2.5 if the maximum peaks in all three tracks occur at exactly the same time (and all three are positive going, or all three are negative going at that moment in time).

I know. Was explaining how you can exactly deduce it for the worst case, indeed when extremities are going on at the same time. If after doing this, there is headroom left, fine to use it :slight_smile: