Demucs + CentreCutCL - Stereo-to-5.1 Script v 0.2b

QuadraphonicQuad

Help Support QuadraphonicQuad:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

zcftr29

Well-known Member
Joined
Jun 18, 2012
Messages
100
I posted on this thread (Abbey Road De-Mix Technology Discussion) a new script I have been working on for up/remixing but realised that it was probably not the best place to do it, so thought I;d start a new thread here.
I have been working on this for quite a while (with a significant dose of help from Zeeround - many thanks!). There is a fair bit of crossover in software/techniques employed between this and Zeeround's SpecScript but this adds in the use of AI source separation tools - primarily Demucs, although it could be easily tweaked to work with others. I haven't documented it properly yet, but if anyone wants to give it a test drive, attached is a zip file with the script and all necessary support files (all programs used are free/open source). I have done quite a lot of test conversions (around 40 albums / 500 tracks) so I think I've ironed out most bugs, but it has not been tested out on multiple computers, so there may be some teething issues.

Use as follows:
  • Unzip to a location of your choice
  • Drag & Drop one or more stereo files onto the 'PrepForDemucs.bat' batch file. MP3, WAV & FLAC all work ok - in theory, it should work with any audio file format that SoX can read
  • Follow the dialogue box prompts to choose a destination and the script will then prepare a set of files ready for separation into stems - a box should pop up to give you instructions for this. I use the online tools at Online music/voice separator based on neural nets, but you can also use a local installation of Demucs/Spleeter if you prefer or you should also be able to use LALAL.AI, but I haven't tried this and the follow on script may need tweaking for this to work.
  • Once the separation into stems is complete, these should all be saved in the 'demucs' folder created in your chosen destination directory
  • Next, double click the 'PostDemucs.bat' file in the destination directory and the script will provide you with some options on how you would like your tracks to be upmixed.
  • Currently, the following options are available for each stem:
    • Mono to Centre - Sum to mono and place in the centre channel
    • Crossover Stereoize - Sum to mono, run lowpass and highpass filters at 150Hz, output lowpass to LF and highpass to LR
    • Stereo to Front - Place the stereo stem to LF and RF
    • Stereo to Rear - Place the stereo stem to Ls and Rs
    • 3.0 Sides to Front - Split to centre and sides using CentreCutCL. Centre to (C) and Sides to LF and RF
    • 3.0 Sides to Rear - Split to centre and sides using CentreCutCL. Centre to (C) and Sides to Ls and Rs
    • Upmix to 4.0 using CentreCutCL
    • Upmix to 4.0 using CentreCutCL and rotate all speakers 180 degrees
    • Upmix to 4.0 using CentreCutCL and rotate all speakers 90 degrees anti clockwise
    • Upmix to 4.0 using CentreCutCL and rotate all speakers 90 degrees clockwise
    • Upmix to 4.0 and mirror font to back - e.g. LF to Ls and RF to Rs
    • Upmix to 5.0 using CentreCutCL
  • Defaults are bass/drums/piano - Upmix to 4.0, vocals/other - Upmix to 5.0. An LFE channel will also be added using all stems with a lowpass filter.
  • The Script will then move, rename and neatly organise the files from the 'demucs' folder to a new subfolder called 'stems' and proceed to up/remix according to your selected preferences. There is an ini file in the bin folder in which you can change several default settings if you wish to tinker
  • Once the re/upmix is complete, the files are run through the same unlimited.vst mastering process used by Zeeround's SpecScript before being tagged. The mastering stage is done on a 'whole album' basis to preserve the dynamic relationship between tracks.
I've had some really good results using this process and have found that the quality of the final flac files is far better than my previous upmix methods, which used a combination of DTS Neural and Spleeter. I have especially found that sources that previously gave disappointing results came out very well by moving things around a little - for example, Massive Attack's 'Blue Lines' and 'Protection' have loads of reverb on the vocals but there was not much else going on in the rears using previous techniques, but by re/upmixing with bass/drums to '4.0', vocals to '5.0' and other to '4.0 mirrored' they sound great!

I think there is scope to add many more upmix options - perhaps incorporating some of the variations available in SpecScript. The number of combinations is virtually endless and the quality of the AI stem separation algorithms will only improve over time (they have come on massively in just the last couple of years). Whilst output is currently only 5.1 (that is all I have available on my setup), it could easily be expanded to 7.1/9.1 and overheads could also be added.

Any feedback would be most welcome...
 

Attachments

  • Demucs-CC-Stereo-to-5.1v0.2b.zip
    5.2 MB · Views: 0
Hello zcftr29.

I tried to do some test with this script on windows 10

I dragged and dropped one file onto the 'PrepForDemucs.bat' batch file.

I followed the dialogue box prompts to choose a destination and the script prepared some files in the specified directory but after that, this dialog box closed and no more dialog box unlike you wrote in the instructions...

I have directories and files in the specified directory but I think someting is wrong but I don't know what...

Regards.
 
Hello zcftr29.

I tried to do some test with this script on windows 10

I dragged and dropped one file onto the 'PrepForDemucs.bat' batch file.

I followed the dialogue box prompts to choose a destination and the script prepared some files in the specified directory but after that, this dialog box closed and no more dialog box unlike you wrote in the instructions...

I have directories and files in the specified directory but I think someting is wrong but I don't know what...

Regards.
Hi Nnickspoiler,

It sounds like you've just done the first bit - i.e the 'prep'. You need to run the files in the 'ForDemucs' folder through Mvsep to split into stems, save the output to the 'Demucs' folder, and then run the postdemucs.bat script.
 
So super excited to try your script! I have worked with Z’s SpecScript for quite a while and have had good luck.

I downloaded your files and it seems like the script itself is not working. Any chance I could get a FaceTime tutorial?

Long story short, when I drag a file into “prep”, momentarily it opens a command prompt that I agree to to put destination files on the desktop, and it immediately command prompt windows closes and everything ceases. To see if the folder in that ‘prep” file I open it and instead it opens those 2 websites, and I then still/again have to search out the file I originally dragged into this folder and drag it into the separation demurcs and it works. After they are downloaded, they do not go to any specific destination folder but instead in just downloads. I then drag them myself into the Demucs sub folder, and then double click on the post demucs folder, which opens another command prompt window, but the first thing is it says is the file can’t be found and stops. Help!!
 
So super excited to try your script! I have worked with Z’s SpecScript for quite a while and have had good luck.

I downloaded your files and it seems like the script itself is not working. Any chance I could get a FaceTime tutorial?

Long story short, when I drag a file into “prep”, momentarily it opens a command prompt that I agree to to put destination files on the desktop, and it immediately command prompt windows closes and everything ceases. To see if the folder in that ‘prep” file I open it and instead it opens those 2 websites, and I then still/again have to search out the file I originally dragged into this folder and drag it into the separation demurcs and it works. After they are downloaded, they do not go to any specific destination folder but instead in just downloads. I then drag them myself into the Demucs sub folder, and then double click on the post demucs folder, which opens another command prompt window, but the first thing is it says is the file can’t be found and stops. Help!!
HI NIkomen,

It may be an issue with 'illegal' characters in the filename (i.e. "!" or "⁄"). What is the name of the file you are trying to convert?
 
I tried multiple songs. It's like the folders are there but nothing is being directed where it is supposed to go, so the script has nothing to find. The 3 songs I tried are: 1. Grand Funk - Sin's A Good Man's Brother, 2. Robin Trower - Bridge of Sighs, 3. Robin Trower - Day of the Eagle.

When you drag a file into the "Prep" bat file, is it supposed to trigger another window or script to run, because it doesn't, and then to get it started I have to open that bat file to get it to run. Is it supposed to be automatic? And then when the stems are done being created, and I hit download them, are they supposed to automatically go into that Demucs sub folder because they are not being directed there. They just go to my downloads and I have to drag them into that subfolder. And even when they are created, downloaded and dragged into the proper folder, double-clicking "post opens a command file window, but it says that the file can't be found.
 
New version 0.2c

Available here: Demucs+CC_Stereo_to_5.1v0.2c.zip as it is now too large to upload onto the forum

Updated as follows:
  • Incorporated 'fastini.exe' - (Many thanks to Zeeround who wrote this to speed up the ini reading process)
  • Added CrossoverFreq option to ini file and set default to 350Hz
  • Added 'Crossover Stereoize to Sides' upmix option
  • Added m4a support
  • Changed naming of 'ForDemucs' files to FileNo_X... in order to make renaming of separation output easier
I've done some testing, but not extensively - hopefully I haven't introduced any bugs...

I will write up some better instructions as some point, but hopefully it is fairly self explanitory.
 
I just tried my first file. It was a 24/96 FLAC file. I noticed that after all of the processes finished, the FLAC stems created in the .... Stems\FileNo_1\Demucs folder all play at a slower speed (roughly 10%) and have been resampled to 44,100 Hz with a track length of 2:53.389 while the WAV stems in the ...Stems\FileNo_1 folder play at regular speed with a track length of 2:39.301 and remained at 96,000 Hz.
 
Last edited:
I just tried my first file. It was a 24/96 FLAC file. I noticed that after all of the processes finished, the FLAC stems created in the .... Stems\FileNo_1\Demucs folder all play at a slower speed (roughly 10%) and have been resampled to 44,100 Hz with a track length of 2:53.389 while the WAV stems in the ...Stems\FileNo_1 folder play at regular speed with a track length of 2:39.301 and remained at 96,000 Hz.
Hi,

That is by design. Demucs can only work at 44.1kHz, and will resample anything else during the separation process. To maximize quality of the 'final' stems, the 'ForDemucs' files are prepared and set to 44.1kHz, but source files of 48 or 96k are slowed down rather than resampled and then sped back up after separation. The final 'other' stem is derived from the 96k source to ensure that nothing is lost in the process.
 
New version 0.2d

Available here: Demucs+CC_Stereo_to_5.1v0.2d

Minor tweaks as follows:
  • Added [Upmix_Values] section to ini file and ini options for LFE_Crossover and LFE_Gain
  • Adjusted levels for 'Crossover Stereoize to Sides' upmix option to match loudness to source
 
Hello zcftr29.

I tried to do another test with the 2 last versions (c and d) of the script.

But it is like I wrote previously and like nikomen wrote : I tried again with one file but the first dialog box closes after the copy of prepared files in the specific directory. I had to open the'PrepForDemucs.bat' batch file to see the instructions because the web site Online music/voice separator based on neural nets does no open in my browser and to see the particular method you indicate to process the file and obtain the stems.

I success to obtain the stems with the method you indicate and copy them in the demucs directory like you wrote.

For the next step (postdemucs.bat script), I had to copy the bin directory of the initial unzip directory in the created directory for the treatement (for exeample the directory 220917152928) because when the first dialog box closes like I wrote previously, postdemucs.bat and the other needed software (sox ffmeg etc...) are not copied in the directory 220917152928 . Finally I copy postdemucs.bat in the root of 220917152928, otherwise no process and an error message like Nikomen wrote (the file can't be found etc...)
I manage to obtain an upmix but I think someting is wrong ...
I tried to upmix several file in the same time : the dialog closes after the treatment fo demucs of the first one...


It is very frustrating because I think your method is very promising but I can't use it on my PC...

Regards.
 
Hi Nnickspoiler,

I was chatting with Zeerounder about trying to work out what might be going wrong on your setup. Perhaps it is a language issue - I believe you are in France? It might be that some of the commands or the output from certain parts of the script (eg date/time etc) are different and therefore causing it to fail. Another possibility might be 'illegal' characters in the path to where either the source file or the script is saved. Perhaps you could try with both in the route directory of your harddrive? If you could give me some more info I might be able to solve the problem and if necessary tweak the script.

Below are some step-by-step instructions I sent Nikomen. By following these he did manage to get up and running and has successfully completed a few conversions - maybe they will help you too.

1) Drag your source file onto the "PrepForDemucs.bat" The following dialogue should pop up:

1662497106941.png


2) Click yes for desktop, no to choose another folder. If you click 'no' - you should see the following:

1662497228946.png


3) Browse to your desired destination ( In the above, I chose my "E" drive and clicked "make new folder" - called it PurpleRain) - then click "ok"

4) The Command window should look something like this while it prepares the files:

1662497589457.png


5) When complete, you should get this box, and the two web pages will open in your default browser:

1662497668702.png


6) Click ok to close the above dialogue box and go to the browser

7) On MVSEP, Click "Add Audio File" and browse to the "ForDemucs" folder. For larger files, the prep script will have split the file into chunks of less than 100MB due to MVSEP file size limit (as per below).

1662497777403.png

8) Choose the options options below and click Separate. If there are multiple parts, or you have prepared more than one file, convert all files in the "ForDemucs" folder with the same settings.

1662497912998.png

9) Once separation is complete, download Drums/Bass/Other and Vocals and save/move to the "Demucs" Folder

1662498309769.png


10) The "Demucs" Folder should now look something like the example below (In this case, I have 8 files as the source file was split in to two parts):

1662498539654.png


11) Now double click on the "PostDemucs.bat" Script and you should see the dialogue box as below. The screen shot is from a previous version of the script, it will continue after 5 seconds, or you can click 'ok':

1662498636367.png


12) Another dialogue as below. Click yes to accept defaults, or no to choose other options & follow the prompts

1662498669949.png


13) The command prompt will look like this for a few minutes...

1662498713359.png

...and then...
1662498758368.png


14) Click ok (or just wait 30 seconds)

1662498793102.png


15) More Command prompt processing... After a few minutes you should get a confirmation pop-up that all is finished:

1662499296782.png


16) Once complete, your conversion folder should look something like this, with the 'final' flac file in a folder called "Final_[bass_4.0,drums_4.0,piano_4.0,vocals_5.0,other_5.0]" - the selected options will be in the [brackets]:
1662499317052.png

17) And here is the result:

1662499386419.png


I hope you can get it working!
 
Hello zcftr29.
Yes I am in France.

The 3 first steps are ok.

4) The Command window should look something like this while it prepares the files:

1662497589457.png
After the process the windows of the 4th step closes and nothing more appens : I don't have the box of the 5 th point below and no web pages open in my default browser....
5) When complete, you should get this box, and the two web pages will open in your default browser:

1662497668702.png


6) Click ok to close the above dialogue box and go to the browser
This the list of directories in the destination directory :
1663674496782.png


and in the bin directory :


1663674606245.png


If it could help....

7) On MVSEP, Click "Add Audio File" and browse to the "ForDemucs" folder. For larger files, the prep script will have split the file into chunks of less than 100MB due to MVSEP file size limit (as per below).

1662497777403.png

8) Choose the options options below and click Separate. If there are multiple parts, or you have prepared more than one file, convert all files in the "ForDemucs" folder with the same settings.

1662497912998.png

9) Once separation is complete, download Drums/Bass/Other and Vocals and save/move to the "Demucs" Folder

1662498309769.png


10) The "Demucs" Folder should now look something like the example below (In this case, I have 8 files as the source file was split in to two parts):

1662498539654.png

I can do the next steps (11 to 16) by copying the bin directory like I wrote it in my previous message....

I tried with both directories in the route directory of my harddrive but no change...

Regards




 
Hello zcftr29.
Yes I am in France.

The 3 first steps are ok.


After the process the windows of the 4th step closes and nothing more appens : I don't have the box of the 5 th point below and no web pages open in my default browser....

This the list of directories in the destination directory :
View attachment 83718

and in the bin directory :


View attachment 83719

If it could help....



I can do the next steps (11 to 16) by copying the bin directory like I wrote it in my previous message....

I tried with both directories in the route directory of my harddrive but no change...

Regards

Are you getting files created in the "ForDemucs" and "Source-6dB" folders? I'm trying to work out at which point it fails. I still think it might be a language issue, but I'm not sure what command might be failing as a result.
 
Are you getting files created in the "ForDemucs" and "Source-6dB" folders? I'm trying to work out at which point it fails. I still think it might be a language issue, but I'm not sure what command might be failing as a result.
Yes : FileNo_1_48000.flac in "ForDemucs" and FileNo_1_-6dB.flac in "Source-6dB".
 
I tried multiple songs. It's like the folders are there but nothing is being directed where it is supposed to go, so the script has nothing to find. The 3 songs I tried are: 1. Grand Funk - Sin's A Good Man's Brother, 2. Robin Trower - Bridge of Sighs, 3. Robin Trower - Day of the Eagle.
I've got the stems separated for Sin's A Good Man's Brother but haven't gotten around to tearing it apart and mixing. It should make a very interesting MC mix given how certain elements move around in stereo. I recently completed Paranoid. It's a very paranoid mix. ;)

All these home grown Windows-based processing programs are pushing me towards actually getting PC. (I dwell in an all Mac world.)
 
Yes : FileNo_1_48000.flac in "ForDemucs" and FileNo_1_-6dB.flac in "Source-6dB".
That's good news... at least we know it gets most of the way through. Attached is a version of the "PrepForDemucs.bat" with Echo turned off and a few 'pause' commands which will hopefully identify which command is failing. It is saved as a txt file as 'bat' files cannot be attached on the forum - just save it to the script folder and rename it to "PrepForDemucs(Debug).bat". Run as normal and there should be a lot more text in the command console. It will ask you to "press any key" at each pause. Please can you let me know if/where it stops or if the cmd window closes. I suspect it will be one of the FOR or IF commands, as these can cause the console window to close unexpectedly.
 

Attachments

  • PrepForDemucs(Debug).txt
    13.4 KB · Views: 0
I've got the stems separated for Sin's A Good Man's Brother but haven't gotten around to tearing it apart and mixing. It should make a very interesting MC mix given how certain elements move around in stereo. I recently completed Paranoid. It's a very paranoid mix. ;)

All these home grown Windows-based processing programs are pushing me towards actually getting PC. (I dwell in an all Mac world.)
Have you tried running the script in parallels or Bootcamp?
 
Back
Top