Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time
// Stereo Bleed Remover
// Say you have a stereo clip, but some of the L signal
// is audible on the R channel and some of the R signal
// is audible on the L channel. Say you don't want that.
// This plugin will attempt to remove the channel bleed,
// so that you have two separate L/R channels, and only
// an absolute minimum trace of signal bleed is left.
// The process inherently loses some volume, so use the
// Trim slider to adjust the level (post FX) if desired.
// NOTE:
// This process will only work (well) with signals that
// have no phase differences between direct sources and
// their opposite bleed partials, like if stereo tracks
// were previously unsatisfyingly panned.
// Signals recorded with two microphones, and both mics
// panned to opposite L/R channels, will likely contain
// runtime/phase differences between the direct signals
// and their bleed partials on the opposite channels.
// With such material, this process will probably fail.
// author: chokehold
// url:
// tags: utility stereo bleed channel separation
desc: Stereo Bleed Remover
slider1:fxPcnt=0<0,100,0.01>Amount [%]
slider2:dBTrim=0<-12,12,0.0001>Trim [dB]
in_pin:Input Left
in_pin:Input Right
out_pin:Output Left
out_pin:Output Right
// Converts dB values to float gain factors. Divisions
// are slow, so: dB/20 --> dB * 1/20 --> dB * 0.05
function dBToGain (decibels) (pow(10, decibels * 0.05));
// Converts the slider's % value into linear [0,1] range
amount = fxPcnt * 0.01; // 1/100 = 1 * 0.01
// Turns the slider's dB value into a float gain factor
trim = dBToGain(dBTrim);
// Buffer left input sample, so the following step
// doesn't use its -then- already modified value
splL = spl0;
// Sum the inverted input samples onto their
// opposite channels at the amount set by user
spl0 += -spl1 * amount;
spl1 += -splL * amount;
// Output gain adjustment
spl0 *= trim;
spl1 *= trim;