Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I get the instrumentals only from a file and remove the vocals?

I understand this is called karaoke.

share|improve this question
1  
you will never be able to completely remove vocals - not unless those vocals are physically on a separate track. The best you can do is reduce the effect. MP3 format is irrelevant here - you can convert the format to something else like a .wav - remove the vocals and then convert back again. –  fossfreedom May 26 at 18:20
1  
@Parto: it is absolutely, firmly, physically impossible to do. Existing systems use a variety of tricks which include inverting the phase of a stereo channel so that any signal that's panned hard center (including but not limited to vocals) cancels out and applying equalization so that the frequency spectrum of the human voice gets attenuated. All these systems are not and cannot be perfect (they are what they are - tricks) and produce a variety of artifacts. HOWEVER, multitrack (=~studio) files with separate instruments and vocals are available for some songs (not always legally, though). –  Tobia Tesan Aug 2 at 18:39
    
Would converting to MIDI be an acceptable answer? –  Akiva Aug 8 at 1:37
    
Try this with Audacity, hope it helps: How To Remove Vocals From Music Tracks Using Audacity –  Somogyi László Aug 9 at 8:32

3 Answers 3

A software that can do this is called sox Install sox

It has an option for karaoke:

oops

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 Install 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).

share|improve this answer
1  
This doesn't work with MP3 even after installing the libsox-fmt-mp3 package. The output has vocals within it when using MP3. –  Parto Apr 27 at 17:16

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 Install 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

pacmd list-sinks

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

Replace <name> with the name of your audio device (e.g. alsa_output.pci-0000_00_14.2.analog-stereo).

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 pulseaudio -k.

The 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.

enter image description here

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.

share|improve this answer

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.

Try out Audacity. You can find it in the Ubuntu Repositories. To remove vocals, follow the steps on this page.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.