Crossfade & Mashup Tool

Upload two audio tracks, set your overlap points, choose an equal-power or linear fade curve, and export a seamlessly blended WAV file. Includes BPM detection, key compatibility checking, optional tempo matching, and beat-aligned transitions. Everything runs in your browser.

Share

Track A (Lead-out)

Track B (Lead-in)

Upload both tracks above to configure the crossfade.

All processing happens in your browser. No audio is uploaded to any server.

Audio Crossfading Explained: Equal-Power Curves, Tempo Matching, and Harmonic Mixing

A crossfade is the overlap between two audio tracks where one fades out as the other fades in. Every DJ uses this technique, but the mathematics behind a clean crossfade are more specific than most people realize. The difference between a crossfade that sounds seamless and one that sounds wrong often comes down to one choice: whether you use a linear or an equal-power curve. Get that wrong, and the middle of your overlap feels quieter than either track alone.

Why Equal-Power Is the Right Default

Human hearing does not perceive loudness on a linear scale. It follows something closer to a logarithmic curve, which is why the decibel scale exists. When you apply a straight linear fade (gain goes from 1.0 to 0.0 on Track A while Track B goes from 0.0 to 1.0), the perceived loudness at the midpoint drops noticeably. At the exact overlap center, both tracks are at 50% linear amplitude. The combined power is 0.5² + 0.5² = 0.5, which is about 3 dB below full power. Your ears notice that dip.

Equal-power crossfading solves this using cosine and sine curves: gainA = cos(t × π/2) and gainB = sin(t × π/2), where t runs from 0 to 1 across the overlap window. At the midpoint (t = 0.5), both gains are approximately 0.707. The combined power is 0.707² + 0.707² = 1.0. The total stays constant throughout the entire fade. This is the approach described in the Web Audio API specification book by Boris Smus and used by professional DJ software including Serato, rekordbox, and Traktor. Use equal-power for music unless you specifically want the linear fade for creative effect, such as a hard slam cut or a deliberate volume swell.

How the Crossfade Parameters Work

The tool gives you three parameters that control the shape of the combined output file.

  • Track A fade-out start point. This is the sample position in Track A where the gain begins dropping. Everything before this point plays at full volume. Setting this earlier gives more context from Track A; setting it later gives less runway for the fade.
  • Track B fade-in start point. This is the position inside Track B where the tool reads from when building the overlap. You can start at the beginning of Track B (default) or skip into it to begin from a specific section.
  • Crossfade duration. Longer durations produce smoother, more gradual blends. Short durations (under 2 seconds) produce quick cuts. Most DJ transitions in modern electronic music fall between 4 and 16 seconds. Radio edits and pop mashups typically use 2 to 6 seconds.

The output file structure is: Track A at full gain up to the fade-out start, then the crossfade window where both tracks overlap with gain-weighted mixing (sample-by-sample addition of the two gain-scaled signals), then Track B alone for the rest of its duration.

Tempo Matching via Resampling

If the two tracks have different tempos, the transitions will feel rhythmically misaligned even with a perfect crossfade curve. The tempo match option detects the BPM of both tracks using onset detection and peak interval analysis, then resamples Track B at a constant playback rate equal to BPM(A) / BPM(B) before the crossfade is applied. This is the same technique as changing the playback rate on the Pitch Shifter, but set to a fixed ratio rather than a user-defined semitone value.

The trade-off is pitch. Resampling at a rate above 1.0 speeds the audio up and raises the pitch. Resampling below 1.0 slows it down and lowers the pitch. A tempo difference of 10 BPM between two tracks at 120 BPM produces a ratio of 1.083, which shifts the pitch of Track B up by approximately 1.4 semitones. For electronic music where pitch accuracy is less critical this is usually acceptable. For tonal music where the two tracks need to be in the same key, you may want to pitch-shift Track B first using the Pitch Shifter to correct for this side effect.

Harmonic Mixing and the Circle of Fifths

Tempo alignment is only half of a clean transition. The other half is harmonic compatibility. When two tracks play simultaneously, their key relationship determines whether the overlap sounds consonant or dissonant. DJ software uses the Camelot wheel, which maps all 24 major and minor keys onto a clock face. Adjacent keys on the wheel (sharing the same number or differing by one number) are harmonically compatible. Keys that are far apart on the wheel will clash.

This tool detects the key of each uploaded track using chromagram analysis and displays the Camelot notation alongside the standard key name. If the two keys are not adjacent on the Circle of Fifths (not within a perfect fourth or perfect fifth of each other), a warning appears. The warning does not block the export. Some producers deliberately combine clashing keys for creative tension, but for a smooth DJ-style mix, harmonic compatibility matters. You can check key relationships visually using the Chord Wheel and Circle of Fifths tool, then use the Pitch Shifter to bring one track into a compatible key before uploading it here.

Beat-Aligned Entry Points

Choosing a fade-in start position by dragging a slider is approximate. The beat-align option runs onset detection on Track B and snaps the fade-in start point to the nearest detected transient. Transients are sudden energy increases in the waveform that correspond to drum hits, chord attacks, or the start of a phrase. Starting the crossfade at a transient rather than a random sample position ensures the transition begins on a rhythmic boundary.

This is particularly useful when Track B starts mid-phrase, such as when you want to begin blending from a specific bar or section rather than from the very beginning. The number of detected transients is shown in the interface so you can gauge how strongly rhythmic the track is before enabling the option.

Real-World Applications

The most direct use case is DJ mix preparation. Instead of relying on a full DJ software setup, you can rough out a transition here, listen to the preview, and adjust the parameters before committing. The exported WAV is production-ready and can be imported into Ableton Live, FL Studio, Logic Pro, or any other DAW for further editing.

For mashup production, the tool lets you align two tracks at any overlap point without needing to manually draw automation curves in a DAW. Set the crossfade duration to cover the full length of both tracks if you want a long, gradual blend, or use a short window if you want a hard swap with just a brief overlap. Once exported, bring the WAV into your DAW and use the Key and BPM Finder to verify the output has the expected characteristics.

The tool also works for podcast and audio content production. Fade from one music bed into another, create smooth transitions between interview segments with different background music, or blend sound design elements together with a controlled overlap.

Technical Details and Export Quality

The crossfade is computed sample-by-sample using the Web Audio API's OfflineAudioContext for export. Each sample in the overlap window is the sum of the gain-weighted samples from Track A and Track B at that moment. No lossy compression is applied. The output is rendered at the same sample rate as Track A (typically 44,100 Hz or 48,000 Hz) and encoded as a 16-bit PCM WAV file. If the two tracks have different channel counts, the tool upmixes the mono track to stereo by duplicating the channel data so the output is always at least stereo.

All processing runs entirely in your browser. No audio data is sent to any server. Files stay on your device at all times, making this safe to use with unreleased music, client recordings, or any audio you want to keep private. The preview playback also runs locally using the same computed buffer, so what you hear in the preview is exactly what will be exported to the WAV file.

From the Blog

View All