User:Stevethefiddle/Fade and Crossfade

Linear Fade
This is the most simple type of fade where the level rises or falls at a constant rate. A linear fade in from silence is easily created in Audacity using. A linear fade out to silence is created using.

The "shape" of a fade is commonly described in terms that suggest the appearance of a constant level signal that has had the effect applied to it. For example, if a linear fade in is applied to a generated tone, the fade can be seen to follow a straight line from silence up to the original level.


 * [[Image:Fade-in-sine.png|Linear fade in of a sine wave]]

Exponential Fade
This is another very common fade type. Its popularity stems from the fact that it closely models the way in which sounds naturally decay. For example, comparing the waveform of a gunshot recording with that of a bell, we can clearly see that although the time scales are very different, the shape of the sound as it decays is very similar:


 * [[image:gunshot.png|gun shot waveform]]


 * [[image:bell.png|bell ring waveform]]

In Audacity, the Envelope Tool produces exponential fades.

A similar (but not identical) fade shape may be produced by applying a linear fade several times to the same selection. For example, here is a fade created by applying the Fade Out effect, then repeating it three times using the shortcut (Repeat Last Effect).


 * [[image:Repeated-fade-out.png‎|bell ring waveform]]

Equal Power Fade
If one sound is fading out while another sound is fading in, this is called a crossfade. A common problem when crossfading two sounds using linear fade effects is that the volume level may drop a little midway through the transition. To mitigate this problem it is common to use a fade shape that, compared to a linear fade, bows up in the middle, so that the volume level stays a little higher in the middle of the transition. One of the most commonly used crossfade shapes is an "Equal Power Fade"; so called because the average power (and hence loudness) remains fairly constant during a crossfade transition for music and other uncorrelated sounds. The next image shows two tracks, one with white noise and one with pink noise that are crossfading using Equal Power Fades.


 * [[image:Equal_power_cross-fade.png‎|Crossfade white noise with pink noise with equal power fade]]

Sine Curve Fade
A raised sine curve (or cosine curve) is based on the shape of a sine wave. This fade type is often used for fading out music as it produces a smoother, more musical sounding fade out than a linear fade. It is also commonly used as an alternative to the Equal Power Fade for crossfading.


 * [[image:Raised-cosine-fade.png‎ ‎|Raised cosine fade]]

DJ Crossfade Curve
DJ Mixers have a crossfade slide control that is essentially two faders back to back in one unit. Moved in one direction it will fade in source A and fade out source B, and when moved to the other extreme it will fade out source A and fade in source B. Early DJ mixing desks crossfaders produced a (roughly) equal power crossfade, but in response to demand from DJs, other fade shapes were developed that have a more pronounced curve, thus making the mix more pronounced during the transition. More information about the history of DJ crossfaders can be found on the Rane website.

Modern DJ mixers provide a curve control to provide adjustment of the fade taper contour. The image below compares the shapes of an equal power fade with a high curve fade that is similar to what would be achieved by setting the curve control fairly high on a DJ mixer's crossfader.


 * High-curve.png

Creating Fades with the | Envelope Tool
Because the Envelope Tool uses logarithmic fades, creating a precise fade shape can be very fiddly, but with patience almost any type of fade shape can be achieved.

Tips for drawing fades with the Envelope Tool:

In this example we will create a fade that starts at full volume, then starts to fade slowly, then gradually more rapidly to silence, as illustrated here:


 * Making-a-fade-shape.png


 * Begin the fade by setting a control point at the time position where the fade starts at full volume:
 * Click on the waveform with the envelope tool at the "start position" of the fade.
 * Drag the control point vertically to the nearest edge of the track to achieve full volume.
 * Note that if you drag the point beyond the edge of the track, the control point will be removed.


 * Set a control point where the fade becomes silent.
 * Click on the waveform with the envelope tool at the "end position" of the fade.
 * Drag the control point up or down toward the vertical centre of the track.
 * Note that the fade will be almost silent for a large section of the fade.


 * Logarithmic-envelope.png‎


 * Click where you want to add additional control points as necessary to push out the envelope to the required shape.


 * Equal-power-envelope.png‎

Fade In and Out
This is a Nyquist plug-in that can apply a linear fade in and fade out to the selected audio.

This tool was written by David R Sky to provide a simple, accessible way for visually impaired and other non-mouse users to apply fade in and out effects. The current Audacity 2.x has a Selection Toolbar providing a screen-reader friendly display of selection start time and duration (* except on Linux) which can be used for similar purpose, but this effect may be found to be quicker and easier to use.

Text Envelope
This is a Nyquist plug-in that can apply multiple changes to the amplitude of the selected audio, fading from one level to another as required.

This tool was written by Steve Daulton to provide an accessible alternative to the "Envelope Tool" for visually impaired and other users that do not use pointing devices.

Creating Fades from the Nyquist Prompt
Nyquist is a programming language that is included in Audacity. It can be used to write plug-ins for Audacity that may provide new effects, generators and analysis plug-ins. Nyquist commands may also be run directly in Audacity by entering code into the Nyquist Prompt Effect. Below are a few short code samples that may be run in the Nyquist Prompt to produce fades to selected audio. More information about Nyquist programming may be found in the Nyquist Audio Programming and Nyquist Plug-ins Reference sections of the wiki.

; Linear Fade Out: (mult s (pwlv 1 1 0))

; Linear Fade In. ; To avoid a click at the end, the pwlv envelope ; extends beyond the end of the selection. (mult s (pwlv 0 1 1 1.1 1))

; Multi-step fade out. (mult s (pwlv 1 0.4 0.775 0.8 0.447 0.9 0.316 0.95 0.224 1.0 0.0))

; sine curve fade in: (mult s 0.5  (sum 1 (osc (hz-to-step (/ (get-duration 2)))      1 *table* -90)))

; wiggly fade: (setf wiggle (mult 0.2 (hzosc (/ 6.0 (get-duration 1))))) (mult s (sum 1.0 wiggle))

Adding an extract of music to a presentation
Whether Powerpoint, OpenOffice Impress, a slide show for YouTube or any other audio-video presentation, it is often desirable to include audio clips within the presentation. Rather than simply cutting a recording to the required length, applying a fade in and fade out to the audio clip can add a touch of professionalism to the production.

The duration of the fade as well as the shape of the fade are crucial to the overall effect. Typically an audio clip will have a relatively short fade in and a longer fade out, but there are no hard and fast rules. Audacity allows you to experiment with different fade lengths. When preparing audio clips for use in your presentation you can export several versions with differing fade lengths, then when putting together the presentation, try your alternative versions and use whichever you most like.

Fading in music with a logarithmic shape fade is often very effective as you get a hint of the music first, then it rapidly fades to full volume. For fading out music, a sine curve fade often works well.

See also: Mixing

Removing a click from the start of a sound
If a sound starts suddenly, there will often be a noticeable click at the beginning. This is due to the waveform suddenly jumping from silence to the start of the waveform. This "jump" is often visible by zooming in closely on the start of the sound so you can see the original sample dots:


 * Click-at-start.png

Applying a short, linear fade in can eliminate the click by smoothing the transition from silence to the start of the sound.


 * Fade-in-start.png

Introduction
The purpose of a crossfade is to produce a smooth transition between two sections of audio. The two sections overlap and as one section fades out the other fades in. This technique is commonly used by DJ's, for "compilation" tracks and mashups. The use of crossfades is not limited to joining pieces of music, but can be used in many other situations where a smooth transition is required, including editing speech recordings, extending songs, creating loops for audio sequencers, repairing damaged recordings and much more.

How to Crossfade Two Tracks
First, the tracks should be imported or recorded. By default, importing two audio files will create two audio tracks one above the other. Similarly, recording a new track will by default create a new track below any other tracks in the project. This is the arrangement that we want as the starting point (for clarity the illustrations show mono tracks, but the procedure is exactly the same for stereo tracks).

Roughly position the tracks
Drag the second track to roughly the right place using the Time Shift tool http://manual.audacityteam.org/m/images/3/3c/TimeShiftTool.png. Don't worry about getting the position too precise at this stage as we will adjust the position later. For crossfading two music tracks, an overlap of around 5 seconds is usually suitable, though sometimes a much shorter, or longer crossfade may sound better. How long the crossfade transition lasts is largely a matter of personal taste.


 * Crossfade-overlap-tracks.png

Align tracks more precisely
Tracks will often begin and end with a short period of silence. Leading/trailing silence may be removed by selecting and deleting. Audacity's Cut Preview can be useful to check that the selection to be deleted is correct.

The end of the first track will be the point at which the first track finally stops (has faded to silence). The start of the second track will be the point at which the second track starts to fade in.


 * Crossfade-beat-match.png

After selecting the region to be crossfaded, create a split at both ends of the selection using. The split marks will greatly facilitate selecting the appropriate areas in each track.


 * Crossfade-split-tracks.png

Trim the tracks
If, as in the images above, it is necessary to trim the tracks further, select the unwanted region after the fade out (in the upper track in this case) by double-clicking in it, then delete it.


 * Crossfade-trimmed.png

Apply fades
A fade out can then be applied to the overlapping section in the first track, and a fade in applied to the overlapping section of the second track.


 * Crossfade-complete.png

{{ednote|Steve 13Sep12: Additional material to be added:

Reducing unwanted sudden noises
}}