Fading an audio signal in and out gradually
In background music applications, it is sometimes desirable to fade in or fade out the music instead of abruptly muting it. This article explains how to create a fade in/fade out control using an Inc/Dec level control and some basic logic.
Fade control
Start by adding the following blocks to your design. These should be inline with the signal you'd like to fade in and out. Note that the second level control, located after the Inc/Dec level control is optional. This is only required if you need to provide level control for the user.
- Double-click on the Inc/Dec Level control to open its dialog.
- Set the maximum level to 0dB and the minimum level to -100dB.
- Set the Inc/Dec Step to the desired number of dB per step. 2 or 3dB works well in most cases.
- Set the Inc/Dec Rate for how often (in milliseconds) the level will increment or decrement by one step. 100 milliseconds works well in most cases.
Adjusting the Step and Rate will change both the speed and the smoothness of the fade in/out.
Using the Fade in/Fade out control
The Fade in/Fade out control is controlled by the Logic State block. Turning on the Logic State will make the Inc/Dec Level control increase level until it reaches the maximum level setting. Turning the logic state off will do the opposite, bringing the level down to the minimum setting.