Keep the Love Alive

Preliminaries

!pip install git+https://github.com/ws-choi/LASAFT-Net-v2.git/ --quiet
import soundfile as sf
import lasaft
from IPython.display import display, Audio
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning) 

Sample 5: Feel this breeze - (Prod. JoeSwan) - HyungWoo & Sunmin

1. Download the original

!wget https://github.com/lasaft/lasaft.github.io/raw/master/audios/kyul.wav --quiet
mixture, _ = sf.read('kyul.wav')

2. Compare the results

from IPython.display import Audio, display
from lasaft.pretrained import get_v2_large_709

model = get_v2_large_709()
result = model.separate_tracks(mixture, ['vocals', 'drums', 'bass', 'other'], batch_size=4)

v1_url="https://github.com/lasaft/lasaft.github.io/raw/master/audios"
track="kyul"

print('original')
display(Audio(url="{}/{}.wav".format(v1_url, track)))


for source in ["vocals", "drums", "bass", "other"]:
    print('{} (v1)'.format(source))
    display(Audio(url="{}/{}-{}.wav".format(v1_url, track, source)))
    print('{} (v2)'.format(source))
    display(Audio(result[source].T, rate=44100))
checkpoint is loaded 
/home/wschoi/exit/envs/tutorial-environment/lib/python3.9/site-packages/torch/functional.py:545: UserWarning: istft will require a complex-valued input tensor in a future PyTorch release. Matching the output from stft with return_complex=True.  (Triggered internally at  /pytorch/aten/src/ATen/native/SpectralOps.cpp:817.)
  return _VF.istft(input, n_fft, hop_length, win_length, window, center,  # type: ignore[attr-defined]
original
vocals (v1)
vocals (v2)
drums (v1)
drums (v2)
bass (v1)
bass (v2)
other (v1)
other (v2)