boy1dr / SpleeterGui

Windows desktop front end for Spleeter - AI source separation
Apache License 2.0
2.36k stars 254 forks source link

Feature request: Mute certain tracks and output a guitarless/drumless audio file? #25

Closed peanutismint closed 4 years ago

peanutismint commented 4 years ago

Hope this is the right place to request features -

I'm very interested in using Spleeter to create guitarless/drumless versions of my favourite songs that I can play along to. It would be awesome if you could add the ability to simply mute the track we DON'T want to hear and then re-render an MP3 output file, especially if it could be done in batch to, say, make an entire album drumless, for example.

Would this be possible?

Thanks for your hard work! :-)

dankwartrustow commented 4 years ago

I’m not the dev but honestly I feel like the purpose of spleeter is to create stems as to make computational mixing decisions upon making it a sampled and reduced quality mp3. This takes very little time in Ableton Live Lite or any other simple mixing software, you can just keep the stems you want and delete the ones you don’t. Put them in Ableton or your favorite free DAW and just export to mp3 within 60 seconds of getting the stems.

Part of the reason for my response is that you’re asking for the dev to re-render information that was ouput from a cutting edge rendering algorithm released by Deezer, therefore making all sorts of mixing decisions computationally that will effect your final mix. Honestly, it will take very little time to mix your own master file, or even learn tiny bash or powershell script for you to do it automatically every time you run spleeter.

Alternatively, anyone can take the open source software and build out these features, but honestly I don’t think this particular one would benefit the community too much because it alters the sound quality of the stems too much.

peanutismint commented 4 years ago

Thanks for the comment. I'd be really interested in learning a bit of bash or whatever it might take to add this kind of functionality, but I wouldn't know where to begin. However I would relish the challenge!

As for your questions about altering the sound quality of the stems, I don't quite know if you understand what I'm trying to achieve. I'm not suggesting changing anything about how Spleeter or the algorithm actually works, just asking if it'd be possible to automate the resulting files a bit, to recombine 'DRUMS+BASS+GUITARS+VOCALS' into just 'BASS+GUITAR+VOCALS' or 'DRUMS+BASS+VOCALS' for example. Basically I'm hoping someone with a lot more knowledge than me can implement a feature in ~1hour of coding that would take a novice like me 2 weeks to put together :-) Does that make sense?

boy1dr commented 4 years ago

it's not a bad request really. I can see a feature like this being handy for someone wanting to make karaoke versions of all their songs. Or stripping out one of the stems from a bunch of tracks if they want to say take out the drums so they can practice. This GUI is just a front end for spleeter tho and i don't have a good grasp on the python language and ecosystem but i will check it out and see whats possible. i like a challenge :)

peanutismint commented 4 years ago

Thanks! I would really appreciate it. Right now I'm just pulling the stems through your frontend, loading them into a DAW and muting the one I want to remove, but I'd love to be able to further automate that process, given how many songs I'd like to strip the guitars from....! Imagine the day when we have the processing power to do it in realtime....

dankwartrustow commented 4 years ago

This is awesome. I have a few thoughts I want to share.

I think a challenge is spleeter models themselves are designed to capture information within a certain action space that includes a grouping of stems, and there isn't yet orchestration around deleting the stems you don't want. This means that if models are like glasses, the ones we have right now capture more information than you currently want to see.

One potential rework risk I just want to mention is possibility spleeter natively starts supporting selecting individual stem. This would occur by offering new models, or like offering new lenses. Because the project is designed to share lens-making technology, I think (hopefully) it continues to grow as a central project. Who knows though..

Regarding mp3 mixdown of groupings of files, I think ffmpeg might be a useful solution.

For the user, one thing you could do is use Windows Explorer search to run a search index through the folder your stem results are located in. Search for only the files you want to delete, and then it'll look a lot cleaner in the DAW when you want to drag them into a final mix.

bascurtiz commented 4 years ago

@boy1dr Yo! I'd love to see a GUI built-in option to merge/mix stems together, where the user pre-selects which ones to combine.

I found this: https://trac.ffmpeg.org/wiki/AudioChannelManipulation I believe we need the 2x stereo to stereo in this case.

to combine for ex. bass + others out of the 4 stems example:

ffmpeg -i bass.wav -i others.wav -filter_complex "[0:a][1:a]amerge=inputs=2,pan=stereo|c0<c0+c2|c1<c1+c3[a]" -map "[a]" bass_others_combined.mp3

or

ffmpeg -i bass.wav -i others.wav -filter_complex "[0:a][1:a]amerge=inputs=2[a]" -map "[a]" -ac 2 bass_others_combined.mp3

peanutismint commented 4 years ago

That's exaclty what I'm looking for! Here's hoping someone smarter than me can add it to a future update for SpleeterGui..... 🤞

bascurtiz commented 4 years ago

@peanutismint If you can't wait for the desired update, I managed to to do this batch-mode using ffmpeg itself. Make sure to install ffmpeg using this (only 1st 5 mins will do) tutorial for example: https://www.youtube.com/watch?v=qjtmgCb8NcE And add ffmpeg to the path environment as shown in the vid.

Go to the root folder where all the subfolders are located using command prompt (cmd). then enter:

for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -filter_complex "[0:a][1:a]amerge=inputs=2,pan=stereo|c0<c0+c2|c1<c1+c3[a]" -map "[a]" "%~A\bass_other_combined.wav" -y

Replace bass.wav / other.wav with the ones u want to combine and rename bass_other_combined.wav to whatever u want.

Let me know if that works for ya!

image

@boy1dr This might be helpful for u too when trying to integrate.

boy1dr commented 4 years ago

Thanks for all your inputs, i'm wrapping up version 2.6 to release for the weekend and it has this feature. I am amazed at how well it works. Chuck 30 mp3's at it and drop the drums...win :)

I'll pop a message in here when it's uploaded!

peanutismint commented 4 years ago

That’s awesome news! Thanks so much, I’m excited to take it for a spin!

On Wed, Jul 1, 2020 at 20:29 Chris Mitchell notifications@github.com wrote:

Thanks for all your inputs, i'm wrapping up version 2.6 to release for the weekend and it has this feature. I am a amazed at how well it works. Chuck 30 mp3's at it and drop the drums...win :)

I'll pop a message in here when it's uploaded!

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/boy1dr/SpleeterGui/issues/25#issuecomment-652760485, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJNL3PMTEH3MIZXKKXPRZDRZP5LHANCNFSM4NFOKP6A .

bascurtiz commented 4 years ago

@boy1dr Awesome! Prolly u already figured it out, but to combine 3 stems, I used: for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -i "%~A\vocals.wav" -filter_complex "[0:a:0][1:a:0][2:a:0]amerge=inputs=3[a]" -map "[a]" -ac 2 "%~A\nodrums.wav" -y

peanutismint commented 4 years ago

That’s useful too, thanks. I’m assuming I can just omit ‘other.wav’ in favour of ‘drums.wav’ to create a guitar-less backing track?

On Thu, Jul 2, 2020 at 01:10 bascurtiz notifications@github.com wrote:

@boy1dr https://github.com/boy1dr Awesome! Prolly u already figured it out, but to combine 3 stems, I used: for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -i "%~A\vocals.wav" -filter_complex "[0:a:0][1:a:0][2:a:0]amerge=inputs=3[a]" -map "[a]" -ac 2 "%~A\nodrums.wav" -y

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/boy1dr/SpleeterGui/issues/25#issuecomment-652856665, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJNL3IYX2EJ5F4HMKIK3LTRZQ6GBANCNFSM4NFOKP6A .

bascurtiz commented 4 years ago

@peanutismint Yep!

boy1dr commented 4 years ago

@peanutismint yes you can. the "recombine" option lets you specify what parts you want mixed back together. Normally spleeter puts the separated files in a sub folder of your output folder but i figured it would be better if they save to the output directory. that way if you drop a bunch of music files on SpleeterGUI you don't need to go in to each output folder and copy the music out. Here's the new interface spleeter_2 6

@bascurtiz i followed the ffmpeg website's recommendation for merging audio files together, which was ffmpeg.exe -i vocals.wav -i bass.wav -i drums.wav -filter_complex amix=inputs=3:duration=longest c:\output\songname_recombined.wav

This seems to work great on all of the tracks i've thrown at it so far. I will give it some challenging audio to mix together and see how it performs before releasing the new version. Let me know if there's reason for the [0:a:0][1:a:0][2:a:0] part of your command. i haven't explored all of the options and since it's a pain in the a to do releases I'd rather get the command right :) I could make a test version available if either of you would like to test it before release

boy1dr commented 4 years ago

@bascurtiz there appears to be some volume normalization going on with the recombined audio. If i drop the drum track then add the drums back in with audacity i'm getting some pretty weird results, even with that command of yours. I'll need to do a bunch more reading and testing to see if i can get true levels in the output...it's exactly the sort of thing that will start an avalanche of support requests for me ^sigh^

bascurtiz commented 4 years ago

@boy1dr You're right. And your syntax is cleaner.

To fix the normalize function, specify the amount of inputs before amix filter.

for 4 stems combined:

for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -i "%~A\vocals.wav" -i "%~A\drums.wav" -filter_complex "[0]volume=4[a];[1]volume=4[b];[2]volume=4[c];[3]volume=4[d];[a][b][c][d]amix=inputs=4:duration=longest" "%~A\combined_all.wav" -y

for 3 stems:

for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -i "%~A\vocals.wav" -filter_complex "[0]volume=3[a];[1]volume=3[b];[2]volume=3[c];[a][b][c]amix=inputs=3:duration=longest" "%~A\nodrums_combined.wav" -y

for 2 stems:

for /d %A in ("*") do ffmpeg -i "%~A\bass.wav" -i "%~A\other.wav" -filter_complex "[0]volume=2[a];[1]volume=2[b];[a][b]amix=inputs=2:duration=longest" "%~A\bass_other_combined.wav" -y

Made an example-pack so u can easily check for urself incl. stems output + the combined ones + source of 15 secs. Drop them in Audacity and mute/solo tracks to compare. example.zip

peanutismint commented 4 years ago

This looks great! Would be more than happy to trial a test version :-)

boy1dr commented 4 years ago

@bascurtiz wow thankyou very much for that it works great. after mixing down the recombined audio and the missing stem there is no obvious difference in the mix volume!

boy1dr commented 4 years ago

Here's the latest version for testing https://makenweb.com/Spleeter2.6_beta.zip Just unzip it to your desktop, it should run as long as you have SpleeterGUI 2.5 installed. I will likely publish this new version tomorrow (30 hours from now) providing we don't find bugs or additional features to add hehe :)

peanutismint commented 4 years ago
It works great Chris!  As for additional features, the only ones I can think of right now would be a couple of ‘housekeeping’ actions, for example A) an option for Spleeter to delete the ‘working’ folder of the track (I.e. only keeping the resulting recombined audio file) and B) the option to output as MP3 instead of WAV, though I assume adding encoding options might not be an ‘easy’ feature to implement...!  Let me know what you think, but this is already going to totally speed up my workflow as is so thank you very much.    Sent from Mail for Windows 10 From: Chris MitchellSent: 02 July 2020 15:15To: boy1dr/SpleeterGuiCc: peanutismint; MentionSubject: Re: [boy1dr/SpleeterGui] Feature request: Mute certain tracks and output a guitarless/drumless audio file? (#25) Here's the latest version for testing https://makenweb.com/Spleeter2.6_beta.zipJust unzip it to your desktop, it should run as long as you have SpleeterGUI 2.5 installed.I will likely publish this new version tomorrow (30 hours from now) providing we don't find bugs or additional features to add hehe :)—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe. 
boy1dr commented 4 years ago

New version 2.6 released includes recombine and multiple languages https://makenweb.com/spleeter2.php