Audio Auto-Leveler in Bitwig - Gain Staging
Tutorial | Nov 16, 2022
In this video, I demonstrated how to create a simple auto-leveling patch in the grid. I used an oscilloscope, a divide or division operation, and a follow-off to average out the audio signal. I also implemented a threshold algorithm to make sure that the auto-leveler doesn't amplify noise annoyingly. This technique works in any modular environment and can be useful for maintaining the same loudness level for a generative grid patch or audio clip.
You can watch the Video on Youtube - support me on Patreon
In this video, I demonstrate creating an auto-leveling patch in Bitwig Studio's Grid to maintain consistent volume levels, especially useful for generative patches or normalizing audio clips. Here are the main points:
Auto-Leveling Concept: The goal is to amplify a signal so its highest peak reaches 0 dB without clipping.
Using Divide Operation: I use a divide operation where the input signal is divided by a follower tracking its volume, resulting in a signal that peaks at 0 dB.
Adjusting Follower Settings: The follower's rise and fall times are adjusted to respond appropriately to volume changes, ensuring the output doesn't clip but remains dynamic.
Adding Peak Limiter: A peak limiter is included to ensure the signal never exceeds -0.3 dB, preventing clipping.
Handling Noise Floor: To avoid amplifying noise or quiet parts excessively, I add a threshold control. When the signal falls below this threshold, the patch maintains the last known loudness level instead of continuing to amplify.
Implementation Flexibility: I note that this technique isn't limited to Bitwig's Grid but can be applied in any modular environment or programming language focused on signal processing.
Practical Applications: This patch is particularly useful for maintaining consistent levels in live streaming, broadcasting, and performances with generative music patches in Bitwig Studio.
This tutorial is an insightful guide for those looking to understand and implement dynamic volume control within their Bitwig Studio projects, highlighting the software's flexibility and capability for intricate sound processing tasks.
Questions & Answers #
Maybe you dont watch the video, here are some important takeaways:
How can I use this auto-leveling patch in a generative grid patch? #
To use this auto-leveling patch in a generative grid patch, you will need to use an FX Grid and take the audio in, audio out. Then take an oscilloscope, switch it to slow mode, and take the highest peak and calculate the distance between the highest peak and plus one and minus one. Then you will need to amplify the signal until the highest peak peaks at zero dB. To do this, you will need to use a divide or division operation with a follow-off of the input signal. This will react quickly to loudness increases and over time, it will settle at a certain volume. You can also play around with the rise and fall knots to adjust the speed at which the patch reacts.
How can I use this auto-leveling patch to maintain the same volume for a stream on YouTube? #
To use this auto-leveling patch to maintain the same volume for a stream on YouTube, you will need to use an FX Grid and take the audio in, audio out. Then take an oscilloscope, switch it to slow mode, and take the highest peak and calculate the distance
This is what im talking about in this video. The text is transcribed by AI, so it might not be perfect. If you find any mistakes, please let me know.
You can also click on the timestamps to jump to the right part of the video, which should be helpful.
[00:00.000] Hey folks, welcome back to another video.
[00:03.080] Today it's about a small little patch or thing you can implement inside the grid to create
[00:08.400] some kind of auto-leveling thing to increase the volume of a signal, maybe inside of a
[00:14.960] grid patch where you have a generative grid patch running and you want to maintain the
[00:20.080] volume of this grid patch because you never know where it's going next, right?
[00:24.480] Or you have this audio clip and you want to auto-normalize the signal to the highest peak.
[00:29.000] So we can do something like this in the grid with an FX grid pretty easily actually.
[00:37.720] So inside here we have an audio in, audio out and we take an oscilloscope, switch this
[00:44.880] to slow mode and what we want to do is we want to take here the highest peak and want
[00:52.240] to calculate the distance between the highest peak and plus one and minus one and then want
[00:58.280] to amplify the signal until the highest peak peaks at zero dB which is plus one and minus
[01:03.840] one in the real world.
[01:05.840] So you can come up with all kinds of flat operations to do this but the simplest one
[01:10.240] is actually to use a divide or division operation.
[01:15.440] So if you take the signal, maybe take this out here, if you take the input signal and
[01:20.040] divide it by itself you end up with one which is kind of what we want but not really because
[01:28.240] we don't want to actually take every sample we get from the audio signal and want to divide
[01:33.440] it by itself.
[01:34.440] We want to have a rough estimation of that so we can take here a follow-off of that.
[01:41.600] We follow the shape of this audio input, looks like this, like you can see at the green line.
[01:52.040] So if you take a short rise and a short fall you can see we have a rectified signal, audio
[01:57.440] signal, only positive values here and the shape matches perfectly here, the shape of
[02:05.840] the audio signal.
[02:06.840] So that's not what we want, we want to ease out, we want to average out the signal.
[02:10.920] We can do this by increasing the fall time here and maybe switch this to RMS.
[02:17.160] So now you can see here it reacts pretty drastically or pretty fast to loudness increases but then
[02:24.520] over time it settles at a certain volume kind of, right?
[02:32.400] So that's exactly what we want and we can take this and divide it here with the original
[02:39.520] input from the audio.
[02:41.880] You can see we increase here the level and some of these peaks are perfectly nice at
[02:46.640] 0 dB or plus one or minus one.
[02:49.760] You can also output this here and you can hear it.
[02:55.000] So with this small patch here you created a small easy simple auto-gain algorithm.
[03:02.480] You can also play around here with the rise and fall knots because when you decrease here
[03:09.120] the fall time it almost sounds like a compressor.
[03:23.280] Until you get distortion, maybe use a gain here at the end, you can pull this down.
[03:30.960] You can see here we end up with a pretty flat signal but we want to have an auto-gain.
[03:43.840] And if you go back here to our original audio clip you can see we are peaking now at around
[03:49.480] 0 dB even though the clip volume is not that high.
[03:53.800] You can also decrease here the signal loudness and you will see over time the loudness will
[04:00.280] be increased until again we hit 0 dB and it takes exactly 10 seconds to that to happen.
[04:10.440] Because we have a rise of time here of 0 or 10 milliseconds this one reacts to loudness
[04:18.440] increases much much faster which is also nice because sometimes you have a plastic volume
[04:24.000] increase right something like this and this one reacts pretty fast to that you are still
[04:32.120] at 0 dB yes.
[04:37.920] So if you get quiet it takes 10 seconds until it settles back again to 0 dB and when you
[04:46.160] have loudness increase here pretty drastically it reacts instantaneously which is pretty
[04:50.800] nice because you never really clip the channel and to make this even more clear you can bring
[04:58.840] in a tool device or maybe not a tool device bring in here peak limiter just to make sure
[05:08.280] and maybe make a ceiling of minus 0.3 dB.
[05:15.400] You can see we never clip here we never run into the limiter itself right we never touch
[05:24.000] the ceiling and it takes now 10 seconds until the signal loudness comes back.
[05:34.920] So this is perfectly nice if you have maybe a stream on YouTube with Bitwig and you want
[05:40.200] to maintain the same loudness level or you have broadcast and you want to maintain the
[05:46.680] same loudness level for the voices or you have a generative crit patch like I said and
[05:52.520] you want to maintain the signal loudness over the course of your performance you can use
[05:57.720] something like this pretty easily but we still have one problem left and that's noise floor
[06:04.600] because sometimes you have a reverb tail that's slowly fading out maybe about 10 seconds or
[06:10.800] longer or you have some kind of break inside your set and you have noise in there noise
[06:16.240] floor from hardware devices then this patch here will increase the noise until it hits
[06:21.920] 0 dB and that's not what you want so we can implement some kind of threshold.
[06:28.080] So this is the outer level and to implement this threshold it's also not very hard we
[06:35.560] have to take some logic in here and we take this one here and we want to compare the signal
[06:44.000] or the output here of the follower we want to compare with a constant and the constant
[06:49.520] is basically our threshold level and every time the signal from this follower goes below
[06:57.480] a certain point we want to maintain the last known follower value and we can do this with
[07:06.480] the hold signal hold and put this in here okay so whenever the signal goes below a certain
[07:17.160] point threshold is actually here so whenever this audio file here goes below this point
[07:25.680] we send out the gate and hold the last known position from this follower so even though
[07:30.520] the follower goes down and down and down and down because there's a fade out from the
[07:35.040] reverb and the loudness decreases and decreases and so on we still maintain the same loudness
[07:40.360] we know from the last point when this audio file crossed the threshold line so therefore
[07:48.080] you can maintain the loudness but you also completely switch off this auto leveler when
[07:54.920] you have noise or when you have a certain you know certain quietness in your song so
[08:00.760] we have 0.5 here and at the moment we are below the threshold level as you can see we
[08:06.640] send out your gate signal because we are pretty quiet so when we increase this here basically
[08:15.640] switch off this hold so there's no gate on here so we switch off this hold and we just
[08:23.160] let the signal from the follow up as through here to yeah auto level the signal and whenever
[08:31.800] the signal goes down because you have a break or reverb tail this one switches on after quite
[08:41.480] some time because it takes 10 seconds here maybe you can also take the signal from here
[08:46.160] right that's maybe also something you can try out if it suites your use case better
[08:58.000] therefore it reacts faster whenever we go down at this volume it basically holds this
[09:03.640] current volume here okay so this is basically a threshold algorithm and switch this and these
[09:20.200] two is the auto leveler and this is your threshold you maybe can call this here noise floor you
[09:32.240] can make sure yeah to not amplify noise annoyingly like I said simple patch and this is also
[09:40.400] something you never learn in a grid was probably because it's not about the grid it's about
[09:48.280] signal processing and it works in every modular environment the same so we can implement this
[09:55.520] maybe also in plug data you can implement this in pure data in max or reactor or even
[10:01.840] in C++ it's the same thing it's not about the grid it works everywhere the same okay
[10:08.560] so yeah that's it I think for this video I think it's pretty helpful for some of you
[10:14.800] and leave me a like if you think so leave a comment if you have some questions thanks
[10:19.480] for watching and see you in the next video bye