Page 2 of 3

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 12:34 am
by jh90s
Thanks for posting the instructions here! Btw: What did you do to get it working on xubuntu? I tried it and it keeps giving me a vague error which says:

Traceback (most recent call last):
File "separateLeadStereoParam.py", line 1195, in <module>
main()
File "separateLeadStereoParam.py", line 633, in main
window=sinebell(windowSizeInSamples), nfft=NFT)
File "separateLeadStereoParam.py", line 123, in stft
data = np.concatenate((np.zeros(lengthWindow / 2.0),data))
TypeError: 'float' object cannot be interpreted as an index

All i did was I installed pip, and the 3 dependencies and tried to run the script.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 1:02 am
by steve
jh90s wrote:What did you do to get it working on xubuntu?
pyton-matplotlib 1.5.1-1
python-scipy 0.17.0-1
python-numpy 1:1.11.0-1
(plus dependencies pulled in by the above)
separateLeadStereo-master from the zip file https://github.com/wslihgt/separateLead ... master.zip

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 1:11 am
by jh90s
EDIT: I got it to work. Man, it is unusually slow. It running on Windows seems to be much, much faster.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 10:13 am
by steve
I didn't attempt to time it, (just left it running while I did something else), but yes it is extremely slow.
Python is not generally recommended for heavy number crunching, but Scipy and Numpy do help a lot. I presume that the Windows version makes use of some optimisation(s) that are not available on Linux. Even a small optimisation can make a big difference if it is used a lot, and this algorithm is clearly 'looping' through the same or similar processes a lot.

I don't use Python very much, but I can give an example in Audacity's Nyquist language to illustrate how much difference in performance can be achieved through differences in implementation. Using the Nyquist Prompt effect on a mono track, three ways to find the peak level:

Code: Select all

;version 4
;; Slowest version
(let ((peak 0))
  (do ((val (snd-fetch *track*)(snd-fetch *track*)))
      ((not val) (linear-to-db peak))
    (setq peak (max (abs val) peak))))

Code: Select all

;version 4
;; Faster version
(linear-to-db (peak *track* ny:all))

Code: Select all

;version 4
;; Fastest version
(linear-to-db (get '*selection* 'peak))

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 1:26 pm
by steve
Here's the result of a test where I expected a reasonable amount of separation.
The files were originally 16-bit WAV, which I've converted to Ogg format to reduce the size so that I could upload to the forum.
I've converted all processed files to mono to reduce file size and normalized to -3 dB.

The "original" file remains as stereo.

The original extract:
Original.ogg
(342.7 KiB) Downloaded 34 times


Results of "separateLeadStereo" script, default settings. Processing time on my (fairly fast) Linux laptop was greater than 5 minutes.
I also tested with settings of

Code: Select all

--nb-iterations=50 --numFilters=20
but the results were not better. If anything, the isolated vocals sounded marginally worse, so I've left them out of this comparison.

Vocal Isolation:
gc_lead.ogg
(160.17 KiB) Downloaded 33 times
gc_lead_VUIMM.ogg
(159.06 KiB) Downloaded 34 times
Vocal Reduction:
gc_acc.ogg
(174.99 KiB) Downloaded 33 times
gc_acc_VUIMM.ogg
(177.28 KiB) Downloaded 28 times

Vocal isolation using Audacity's "Vocal Reduction and Isolation" effect.
Settings: "Isolate Vocals", 10, 200, 8000
Processing time: less than 2 seconds
audacity-isolation.ogg
(133.77 KiB) Downloaded 30 times

Vocal reduction using Audacity's "Vocl Remover" effect.
Settings: "Remove frequency band", 200, 7000
Processing time: Almost instant.
Audacity-Vocal-Remover-200-7000.ogg
(182.43 KiB) Downloaded 37 times

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 3:18 pm
by jh90s
I cannot help but mention I've tried that exact song before, and unsurprisingly it struggled greatly. You know what actually might improve the separation results a bit for the verses is if you were to change the minimum fundamental frequency number so it's lower, but for all I know Glen's voice is in the same range as the minimum number is. It seems that if the vocal harmonics aren't prominent in the spectrogram, or if you've got some heavy synths going, then it'll usually give a very.. interesting result. haha. That surprises me that your results weren't as good with the filters bumped up... I'll try the same part of the same song (I have it, but it's an Amazon MP3 and it sounds more muddy than yours). I personally suggest doing a small snippet of whatever song it is you'd like to separate and just tweak the parameters and see how (or if) it'll do any better, and hope for the best and do the full thing if you'd be up for it! That vocal removal file you attached at the end was extremely good for what it is! Sure, there's a fair bit of reverb left in, but the strings and other stuff drowns it out.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 3:50 pm
by steve
There is one aspect that I think I've underplayed in my "review" so far, and that is that "separateLeadStereo" can work with mono recordings, which neither the "Vocal Reduction and Isolation" or "Vocal Remover" effect can manage at all.

Do you have any examples where the "separateLeadStereo" effect excels? If so, perhaps you could post a short sample. I think it could be useful for others if they have a rough idea of what they can reasonably expect from different types of material with the various tools that are available.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 5:25 pm
by jh90s
Here's a sample of a stereo mix which worked so impressively that I uploaded the instrumental estimation over on YouTube (I linked it back on page 1. The only modifications I made is I added the instrumental portions to it so it goes between the original and the estimation). I added the VUIMM estimations as those are the "better "ones, so to speak.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 5:47 pm
by jh90s
As for a song which didn't yield anything which could be used, here's one which I tried just now. I truly wished this would've turned out great as no official instrumental exists, but I can't exactly fault the algorithms for not being able to track the vocals all that well, as this track has a lot of guitars and other stuff going on.

Re: Reduce voice not eliminate

Posted: Wed Apr 26, 2017 8:09 pm
by steve
That pretty well shows the range doesn't it :-)

Here's an Audacity version of Reptile:
reptiletest-reduced-vocals.ogg
(379.52 KiB) Downloaded 43 times
reptiletest-isolated-vocals.ogg
(207.94 KiB) Downloaded 38 times