How can I get the instrumentals only from a file and remove the vocals?
I understand this is called karaoke.
A software that can do this is called sox
It has an option for karaoke:
Out Of Phase Stereo effect. Mixes stereo to twin-mono where each mono channel contains the difference between the left and right stereo channels. This is sometimes known as the ‘karaoke’ effect as it often has the effect of removing most or all of the vocals from a recording.
So from command line this ...
sox song.wav music.wav oops
would create music with vocals removed.
Can't get any easier?
There are more programs. audacity can do it too. It is graphical.
Here is a how to. What sox automated you need to do manually with audacity so it is a bit more difficult but also lets you tweak more (so based on experience one or the other might be a better options).
To have a live removal of vocals from a stereo recording we can add a LADSPA filter as a sound output to pulseaudio. There is a quite good karaoke plugin from the Steve Harris' LADSPA Plugins which will remove central vocals from a stereo recording, and which can also be used with Audacity.
These plugins will be installed with the package swh-plugins . The amount of voice removal and consecutive mono conversion is given as control parameter in dB.
To apply the effect we need to know the pulseaudio name of our default audio sink with
The default sink name is marked with an asterix like in the example below:
* index: 1 name: <alsa_output.pci-0000_00_14.2.analog-stereo>
We can then apply the karako filter with the following command
pactl load-module module-ladspa-sink sink_name=Karaoke master=<name> plugin=karaoke_1409 label=karaoke control=-30
<name> with the name of your audio device (e.g.
Note down the module number given as output from above command in case we want to remove it again (
pactl unload-module <nmber>). All modules are removed and default are reset with
control parameter gives a voice removal of
-30 dB here, higher values (i.e. less negative like
-10) for more vocals (but better music), lower values (i.e. more negative like
-60) for even less vocals but also more original music removal. Positive values are possible but they will lead to heavy distortions.
Choose this newly created audio output sink as output in your sound setting before you start playback of your music player.
Note that not all music recordings are suitable for this karaoke plugin, the more central the vocal stay the better. Mono recordings will not work.
The "Remove Vocals" option in most programs uses a clever trick. Usually when recording a song, the vocals are centered, meaning they are present at an equal volume in both the left and right channels. On the other hand, usually instruments are off-center, meaning they are louder in either the left or the right channel. Therefore, you can try to remove the vocals by "subtracting" the two channels. Since the vocals are the same in both, they disappear completely. Since the instruments are louder in one than the other, they are quieter, but still present.
This technique obviously does not work on mono files that do not have separate left and right tracks. Moreover, it more or less generates a mono output. Even for songs that were recorded with centered vocals and off-center instruments, it normally cannot remove the vocals completely.
While it is possible Virtual DJ used some secret or proprietary algorithm to achieve better performance, I find that unlikely, especially given the content of their FAQ on the subject. In fact, they even make a recommendation for an alternative program, which is incidentally the same one I was going to recommend regardless.