VideoHelp Forum




+ Reply to Thread
Results 1 to 1 of 1
  1. SurroundUpmix - Free Stereo to 5.1 / 7.1 Surround Upmixer (PowerShell)

    Version 2.2.0 | Windows 10/11 | Free & offline | No cloud

    I tried to create a surround upmix workflow that actually makes sense - one that uses AI stem separation to produce a proper surround mix rather than just spreading the stereo image wider.

    Most upmix tools work by duplicating or phase-shifting the stereo signal. The result sounds okay on paper but all the instruments end up bleeding into every speaker. This approach is different. It uses Demucs-GUI - a free AI tool - to split the audio into its individual components first (bass, drums, vocals, instruments), and then places each one where it belongs in the surround field.

    The result is a genuine multichannel mix where vocals sit in the center channel, bass and drums fill the front, and ambient and harmonic content spreads to the rear and sides. The subwoofer channel is derived from the real low-frequency content of the full mix.

    The whole thing runs locally on your machine with free tools and produces a 24-bit FLAC file in either 5.1 or 7.1 that you can mux into an MKV or use directly in any media player that supports multichannel audio.

    What it does
    1. You run Demucs-GUI on your stereo audio - it uses AI to separate the track into 4 stems: bass, drums, vocals, other
    2. You point SurroundUpmix at the stems folder
    3. The script processes the stems through a 3-stage phase analysis (using CenterCutCL) to identify center vs. side content in each stem
    4. Each stem gets placed into the correct speakers based on what it contains
    5. A subwoofer (LFE) channel is built from the low frequencies of the full mix
    6. Everything is combined and saved as a 24-bit FLAC

    Processing a 46-minute episode takes around 10-15 minutes on a modern machine. No cloud, no subscription, no re-encoding of video.

    What You Need (all free)

    1. Demucs-GUI - separates your audio into stems using AI
    https://github.com/CarlGao4/Demucs-Gui/releases

    Choose the right version:
    • cuda_mkl version - for NVIDIA GPU (GTX 700 series or newer) or Intel Arc / Intel Xe GPU - much faster
    • cpu version - works on any machine, slower

    In Demucs-GUI: add your file, select model htdemucs_ft, click Start. Output will be a folder with bass.flac, drums.flac, vocals.flac, other.flac.

    2. SoX - Sound eXchange - audio channel processing
    https://sourceforge.net/projects/sox/files/sox/
    Download version 14.4.2 for Windows. Place sox.exe in: SurroundUpmix\bin\SoX\sox.exe

    3. CenterCutCL - phase-based center/side separation (core of the upmix)
    http://www.moitah.net/download/latest/Center_Cut_GUI.zip
    Extract and place CenterCutCL.exe in: SurroundUpmix\bin\CenterCutCL.exe
    (Last updated 2010 but works perfectly on modern Windows)

    4. ffmpeg - optional, only needed for loudness matching
    https://www.gyan.dev/ffmpeg/builds/
    Download ffmpeg-release-full.7z, extract ffmpeg.exe and place in: SurroundUpmix\bin\ffmpeg\ffmpeg.exe

    Folder Structure

    Code:
    SurroundUpmix\
    |
    |-- SurroundUpmix.ps1       <- the script
    |
    +-- bin\
        |-- CenterCutCL.exe
        |-- SoX\
        |   +-- sox.exe
        +-- ffmpeg\
            +-- ffmpeg.exe
    The script always looks for its tools in the bin folder next to itself.

    How to Run

    Open PowerShell by right-clicking inside the SurroundUpmix folder and selecting "Open in Terminal".

    Single track:
    Code:
    .\SurroundUpmix.ps1 "D:\Audio\Stems\MySong"
    7.1 output:
    Code:
    .\SurroundUpmix.ps1 "D:\Audio\Stems\MySong" -OutputFormat 7.1
    With loudness matching (recommended):
    Code:
    .\SurroundUpmix.ps1 "D:\Audio\Stems\MySong" -LoudnessMatch
    Match loudness to original MKV:
    Code:
    .\SurroundUpmix.ps1 "D:\Audio\Stems\MySong" -LoudnessMatch -SourceFile "D:\Audio\MySong.mkv"
    Batch - process an entire folder of tracks:
    Code:
    .\SurroundUpmix.ps1 "D:\Audio\Stems" -Batch
    Interactive mode (no typing needed - dialogs will ask everything):
    Code:
    .\SurroundUpmix.ps1
    Output location

    Code:
    D:\Audio\Stems\MySong\           <- your stems are here
    D:\Audio\Stems\Final_5.1\        <- output goes here automatically
        MySong_5.1.flac
    For 7.1 the folder is called Final_7.1. You can override with -OutputPath if you want it somewhere else.

    All Options

    Code:
    -OutputFormat 7.1         Create 7.1 instead of 5.1 (default: 5.1)
    -LoudnessMatch            Match output volume to original via EBU R128
    -SourceFile "file.mkv"    Use original file as loudness reference
    -AudioTrack 1             Which audio track in source file (0 = first)
    -Batch                    Process all stem subfolders in a parent folder
    -CleanTemp                Delete old temp files before starting
    -KeepTemp                 Keep temp files after finishing
    -DebugMode                Show every command the script runs
    -UpmixBass 4.0            How to place bass (4.0 / 5.0 / mono / front / rear)
    -UpmixDrums 4.0           How to place drums
    -UpmixVocals 5.0          How to place vocals
    -UpmixOther 5.0           How to place other instruments
    Routing values explained:
    • 4.0 - front left/right + surround left/right, no discrete center
    • 5.0 - same as 4.0 plus a dedicated center channel (best for vocals)
    • mono - everything in center only
    • front - everything in front left/right only
    • rear - everything in rear/surround only

    What it looks like while running

    Code:
    Tool check  (script v2.2.0)
      SoX    : SoX v14.4.2
      CC     : Center Cut CL v1.6.1
      ffmpeg : ffmpeg version 2026-03-15-git-...
    
    Step 1: Pre-combining stems by upmix method...
      4.0  <- bass, drums  [combining]
        [SOX] [########################################] 100.0%
    
    Step 2: Upmixing...
      Upmixing -> 5.0  [Combined_vocals_other.wav]
        [SOX] [########################################] 100.0%
        [CC ] v 8.3 s
    
    Step 5: Normalizing and encoding to FLAC...
      Source : -23.4 LUFS
      Upmix  : -23.4 LUFS
      Gain   : +0.0 dB
        [SOX] [########################################] 100.0%
    
      Done!
      Output: D:\Audio\Stems\Final_5.1\MySong_5.1.flac
      Clipping  : none
    Troubleshooting

    "Required binary not found"
    A tool is missing from the bin folder. Check the folder structure shown above.

    "No stems found"
    The folder does not contain bass.flac, drums.flac etc. Make sure Demucs-GUI finished and you are pointing to the correct subfolder.

    "execution of scripts is disabled"
    Open PowerShell as Administrator and run:
    Code:
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    Output too quiet or too loud
    Use -LoudnessMatch to automatically match the volume to the original.

    System Requirements
    • Windows 10 or Windows 11
    • PowerShell 5.1 or newer (already included in Windows 10/11)
    • For GPU acceleration in Demucs-GUI: NVIDIA GTX 700 series or newer, or Intel Arc / Intel Xe

    Quick Start Checklist
    • Download and install Demucs-GUI
    • Run Demucs-GUI on your audio file using the htdemucs_ft model
    • Download SoX and place sox.exe in bin\SoX\
    • Download CenterCutCL and place CenterCutCL.exe in bin\
    • Optionally download ffmpeg and place ffmpeg.exe in bin\ffmpeg\
    • Place SurroundUpmix.ps1 in the SurroundUpmix folder
    • Open PowerShell in that folder and run the script
    • Add -OutputFormat 7.1 if you want 7.1 (default is 5.1)

    Getting the Script

    The script is attached to this post as SurroundUpmix.txt.
    1. Download the attached SurroundUpmix.txt file
    2. Rename it to SurroundUpmix.ps1 (just change the extension from .txt to .ps1)
    3. Place it inside your SurroundUpmix folder next to the bin subfolder

    Windows may hide file extensions. If you cannot see the .txt part of the filename:
    1. Open any Explorer window
    2. Click View at the top
    3. Tick File name extensions
    4. Now you can rename the file correctly

    Before running - allow PowerShell scripts (one time only):
    1. Press the Windows key, type PowerShell
    2. Right-click it and choose Run as Administrator
    3. Run this command:

    Code:
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    Type Y and press Enter. You only need to do this once on your machine.

    Then to run it:
    1. Open the SurroundUpmix folder in Explorer
    2. Hold Shift and right-click an empty spot in the folder
    3. Choose Open PowerShell window here (or "Open in Terminal")
    4. Type and press Enter:

    Code:
    .\SurroundUpmix.ps1
    A dialog will open and guide you from there.
    Image Attached Files
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!