No internet connection
  1. Home
  2. Script Sharing

Ultimate Vocal Remover in Pro Tools

By Brandon Jiaconia @Brandon_Jiaconia
    2024-09-11 22:23:44.068Z

    This script uses a python package called audio-separator (https://pypi.org/project/audio-separator/) that can use UVR via the command line. Thanks to @Kitch and @Chris_Shaw for helping me figure out the interleaved section!

    sf.ui.proTools.appActivateMainWindow();
    
    // Set Pro Tools session to interleaved
    sf.app.proTools.setSessionInterleavedState({interleavedState:true});
    
    // Consolidate the selected clip in Pro Tools
    sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Consolidate Clip'], });
    
    // Wait for Modals
    sf.ui.proTools.waitForNoModals();
    
    // Invalidate PT API
    sf.app.proTools.invalidate();
    
    // Get the path of the selected file in Pro Tools
    var fullPath = sf.app.proTools.getFileLocation({
        fileFilters: ['SelectedClipsTimeline'],
    }).fileLocations[0].path;
    
    // Set Pro Tools session to interleaved state to false
    sf.app.proTools.setSessionInterleavedState({interleavedState:false});
    
    // Get the directory of the selected file
    var directoryPath = fullPath.substring(0, fullPath.lastIndexOf('/'));
    
    // Compile File Name
    var fileName = fullPath.substring(fullPath.lastIndexOf('/') + 1, fullPath.length - 4); // Assumes the file has a 3-character extension
    
    //Path To Processed file
    var pathToAudioFiles = `${directoryPath}/${fileName}_(Vocals)_UVR-MDX-NET-Inst_HQ_4.wav`;
    
    // Command line
    sf.system.exec({
        commandLine: `PATH=/opt/homebrew/bin:$PATH /opt/homebrew/bin/audio-separator "${fullPath}" --model_filename "UVR-MDX-NET-Inst_HQ_4.onnx" --output_dir "${directoryPath}" --output_format=WAV`
    });
    //Copy the file to the clipboard
    sf.file.copyToClipboard({ path: pathToAudioFiles });
    sf.ui.proTools.spotFileFromClipboard();
    

    My next step is to make this into a template and add all of the models.

    • 17 replies

    There are 17 replies. Estimated reading time: 54 minutes

    1. Kitch Membery @Kitch2024-09-11 22:41:16.648Z

      Awesome @Brandon_Jiaconia!

      It would be great to see this transformed into a package and shared on the SoundFlow Store after you have converted it into a Command Template.

      Great hangin' with you and the crew in the Zoom session this morning!

      1. D
        AK @DJAK
          2025-11-05 04:13:28.789Z

          Hey @Brandon_Jiaconia Can you let me know if this script still works and how exactly does it work? I use UVR daily so this would be a huge help. I tried your script but all it seems to do is consolidate the selected clip. Is there something I need to install or edit in the script? Also, how does it know if you want to make it an acapella or instrumental? Thanks!

          1. BBrandon Jiaconia @Brandon_Jiaconia
              2025-11-05 15:38:15.618Z

              Hey - Yes this still works. I use it often to extract a voice over or music from a clip in Pro Tools. The current script is set up to make an instrumental and vocal of the selected file in Pro Tools. It is a workaround of a workaround, so the setup is a little complicated.
              To start you need to install audio-separator on your computer. There are instructions on their site
              https://pypi.org/project/audio-separator/.
              For me this is done with a terminal command like 'pip install audio-separator'. Once it finishes, confirm in terminal with 'which audio-separator'. It will return a path like "/opt/homebrew/Caskroom/miniforge/base/bin/audio-separator" You will need this path in your script - Here is the updated script I use, you'll need to change a few things specific to where audio-separator gets installed on your computer:

              sf.ui.proTools.appActivateMainWindow();
              
              //Selection
              const selection = sf.ui.proTools.selectionGet();
              const timecodeIn = `${selection.selectionStart}`;
              
              // Set Pro Tools session to interleaved
              sf.app.proTools.setSessionInterleavedState({ interleavedState: true });
              
              // Consolidate the selected clip in Pro Tools
              sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Consolidate Clip'] });
              sf.ui.proTools.waitForNoModals();
              
              sf.app.proTools.invalidate();
              
              // Get the path of the selected file in Pro Tools
              var fullPath = sf.app.proTools.getFileLocation({
              	fileFilters: ['SelectedClipsTimeline'],
              }).fileLocations[0].path;
              
              
              // Build paths
              var directoryPath = fullPath.substring(0, fullPath.lastIndexOf('/'));
              var fileName = fullPath.substring(fullPath.lastIndexOf('/') + 1, fullPath.length - 4);
              fileName = fileName.replace(/\.L|\.R$/, '');
              
              // Disable interleaved again
              sf.app.proTools.setSessionInterleavedState({ interleavedState: false });
              
              
              // Output files expected by UVR naming
              var vocalFile = `${directoryPath}/${fileName}_(Vocals)_UVR-MDX-NET-Inst_HQ_4.wav`;
              var instrumentalFile = `${directoryPath}/${fileName}_(Instrumental)_UVR-MDX-NET-Inst_HQ_4.wav`;
              
              // command line
              sf.system.exec({
                  commandLine: `PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"; \
              /opt/homebrew/Caskroom/miniforge/base/bin/audio-separator \
              "${fullPath}" \
              --model_filename UVR-MDX-NET-Inst_HQ_4.onnx \
              --output_dir "${directoryPath}" \
              --output_format WAV`
              });
              
              //Destination Tracks
               sf.app.proTools.selectTracksByName({
                      trackNames: ["Dial 7"],
                  });
              
              // Copy the file to the clipboard
              sf.file.copyToClipboard({ path: vocalFile });
              sf.ui.proTools.spotFileFromClipboard();
              sf.ui.proTools.waitForNoModals();
              
               sf.app.proTools.selectTracksByName({
                      trackNames: ["Music_10"],
                  });
              
              // Copy the file to the clipboard
              sf.file.copyToClipboard({ path: instrumentalFile });
              sf.ui.proTools.spotFileFromClipboard();
              sf.ui.proTools.waitForNoModals();    
              

              Now in this section you need to change the script to work with your install location:

              // command line
              sf.system.exec({
                  commandLine: `PATH="/opt/homebrew/bin:/opt/homebrew/sbin:$PATH"; \
              /opt/homebrew/Caskroom/miniforge/base/bin/audio-separator \
              "${fullPath}" \
              --model_filename UVR-MDX-NET-Inst_HQ_4.onnx \
              --output_dir "${directoryPath}" \
              --output_format WAV`
              });
              

              You need to swap my install path "/opt/homebrew/Caskroom/miniforge/base/bin/audio-separator " with the install location that was returned when you entered 'which audio-separator' in terminal.

              I have this setup up to work with my template, so you will need to change the names of these destination tracks to something that works in your session, in my case here the tracks are named Dial 7 and Music_10, these both need to be stereo tracks!

              //Destination Tracks
               sf.app.proTools.selectTracksByName({
                      trackNames: ["Dial 7"],
                  });
              
              // Copy the file to the clipboard
              sf.file.copyToClipboard({ path: vocalFile });
              sf.ui.proTools.spotFileFromClipboard();
              sf.ui.proTools.waitForNoModals();
              
               sf.app.proTools.selectTracksByName({
                      trackNames: ["Music_10"],
                  });
              
            • D
              AK @DJAK
                2025-11-05 16:37:55.575Z

                Thanks for the break down. I'm not able to download audio separator for some reason. maybe it's my Mac OSX version or M1 processor or something. This is what i'm getting when trying to install:

                djak@DJ-AKs-MacBook-Pro ~ % pip install audio-separator
                DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
                ERROR: Could not find a version that satisfies the requirement audio-separator (from versions: none)
                ERROR: No matching distribution found for audio-separator
                djak@DJ-AKs-MacBook-Pro ~ % pip install "audio-separator[cpu]"
                DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
                ERROR: Could not find a version that satisfies the requirement audio-separator[cpu] (from versions: none)
                ERROR: No matching distribution found for audio-separator[cpu]
                djak@DJ-AKs-MacBook-Pro ~ % pip install audio-separator
                DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
                ERROR: Could not find a version that satisfies the requirement audio-separator (from versions: none)
                ERROR: No matching distribution found for audio-separator
                djak@DJ-AKs-MacBook-Pro ~ %

                tried both: pip install "audio-separator[cpu]" and pip install audio-separator

                I have the latest python installed as well 3.14

                Did I need to install anything else? I'm using Terminal.

                1. BBrandon Jiaconia @Brandon_Jiaconia
                    2025-11-05 16:53:18.422Z

                    Try directly using the updated python version in your terminal command
                    python3 -m pip install "audio-separator[cpu]"
                    or
                    pip3 install "audio-separator[cpu]"

                    When I first set this up I was using an M1, so should be all good

                  • D
                    AK @DJAK
                      2025-11-05 17:34:16.285Z

                      Was able to get Terminal to use python3 instead of the built in version but now stuck at this error:

                      Additionally, some packages in these conflicts have no matching distributions available for your environment:
                      onnxruntime
                      onnxruntime-silicon

                      To fix this you could try to:

                      1. loosen the range of package versions you've specified
                      2. remove package versions to allow pip to attempt to solve the dependency conflict

                      ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

                      I'm guessing this is preventing audio separator from installing, because when I enter "'which audio-separator'" I get this: zsh: command not found: which audio-separator

                      Would you be able to do a youtube or post on the forum (if its allowed) where you create a guide or show how to get everything setup? If you have the time of course.

                      But using UVR with pro-tools will be a huge game-changer for alot of us. Currently, I use a soundflow script to create a copy of the clip to my desktop. Then I open UVR, drag the file in, select vocals or instrumental and process it. Then I drag the processed file back into pro-tools and continue working.

                      1. BBrandon Jiaconia @Brandon_Jiaconia
                          2025-11-05 18:31:04.760Z

                          The problem is I'm not a python or terminal expert at all ! So I dont know if a video would actually be very helpful or accurate for everybody. I have set this up on a few computers, and it's always a little specific to that computer and python setup. On some I've had to create a virtual environment and install python/audio-sep fresh in that location. On others it was much easier by following the terminal steps I outlined above. I can look at expanding the script to include all the models and making this more user friendly
                          That said I think whats going on in your case is a mismatch between a newer version of python and an older version of onnxruntime, but again I'm not a python expert !

                          1. DAK @DJAK
                              2025-11-05 18:45:08.361Z

                              Yes, looking further, It seems the onnxruntime doesn't work past python V3.9 and I'm on the latest 3.14.

                              I installed 3.9 and attempted the reinstall via Terminal and this version threw tons of red errors lol. I will stop now before I mess something up in my system and not be able to work 😂

                              1. BBrandon Jiaconia @Brandon_Jiaconia
                                  2025-11-05 22:16:58.555Z

                                  Here is a reformatted script that incorporates all the MDX models.

                                  // Path To Audio Separator
                                  const separatorPath = "/Users/bj018/audio-sep-env/bin/audio-separator";
                                  
                                  // MDX model list
                                  var modelFiles = [
                                      "UVR-MDX-NET-Inst_HQ_1.onnx",
                                      "UVR-MDX-NET-Inst_HQ_2.onnx",
                                      "UVR-MDX-NET-Inst_HQ_3.onnx",
                                      "UVR-MDX-NET-Inst_HQ_4.onnx",
                                      "UVR-MDX-NET-Inst_HQ_5.onnx",
                                      "UVR_MDXNET_Main.onnx",
                                      "UVR-MDX-NET-Inst_Main.onnx",
                                      "UVR_MDXNET_1_9703.onnx",
                                      "UVR_MDXNET_2_9682.onnx",
                                      "UVR_MDXNET_3_9662.onnx",
                                      "UVR-MDX-NET-Inst_1.onnx",
                                      "UVR-MDX-NET-Inst_2.onnx",
                                      "UVR-MDX-NET-Inst_3.onnx",
                                      "UVR_MDXNET_KARA.onnx",
                                      "UVR_MDXNET_KARA_2.onnx",
                                      "UVR_MDXNET_9482.onnx",
                                      "UVR-MDX-NET-Voc_FT.onnx",
                                      "Kim_Vocal_1.onnx",
                                      "Kim_Vocal_2.onnx",
                                      "Kim_Inst.onnx",
                                      "Reverb_HQ_By_FoxJoy.onnx",
                                      "UVR-MDX-NET_Crowd_HQ_1.onnx",
                                      "kuielab_a_vocals.onnx",
                                      "kuielab_a_other.onnx",
                                      "kuielab_a_bass.onnx",
                                      "kuielab_a_drums.onnx",
                                      "kuielab_b_vocals.onnx",
                                      "kuielab_b_other.onnx",
                                      "kuielab_b_bass.onnx",
                                      "kuielab_b_drums.onnx",
                                      "UVR-MDX-NET_Main_340.onnx",
                                      "UVR-MDX-NET_Main_390.onnx",
                                      "UVR-MDX-NET_Main_406.onnx",
                                      "UVR-MDX-NET_Main_427.onnx",
                                      "UVR-MDX-NET_Main_438.onnx",
                                      "UVR-MDX-NET_Inst_82_beta.onnx",
                                      "UVR-MDX-NET_Inst_90_beta.onnx",
                                      "UVR-MDX-NET_Inst_187_beta.onnx",
                                      "UVR-MDX-NET-Inst_full_292.onnx"
                                  ];
                                  // Custom stem names for certain models
                                  const stemOverrides = {
                                      "Reverb_HQ_By_FoxJoy": ["(No Reverb)", "(Reverb)"],
                                      "UVR-MDX-NET_Crowd_HQ_1": ["(No Crowd)", "(Crowd)"],
                                      "kuielab_a_other": ["(No Other)", "(Other)"],
                                      "kuielab_a_bass": ["(No Bass)", "(Bass)"],
                                      "kuielab_a_drums": ["(No Drums)", "(Drums)"],
                                      "kuielab_b_other": ["(No Other)", "(Other)"],
                                      "kuielab_b_bass": ["(No Bass)", "(Bass)"],
                                      "kuielab_b_drums": ["(No Drums)", "(Drums)"]
                                  };
                                  
                                  
                                  // pop up[ search
                                  var modelChoice = sf.interaction.popupSearch({
                                      title: "Choose MDX Model",
                                      items: modelFiles.map(filename => ({
                                          name: filename.replace(/\.onnx$/, ''),
                                          value: filename      
                                      }))
                                  }).item;
                                  
                                  // Model Variables
                                  var selectedModelWithExt = modelChoice.value; 
                                  var modelNameNoExt = modelChoice.name;
                                  
                                  //Get the selections in & out points.
                                  const selection = sf.ui.proTools.selectionGet();
                                  
                                  // Set Pro Tools session to interleaved
                                  sf.app.proTools.setSessionInterleavedState({ interleavedState: true });
                                  
                                  // Consolidate the target clip in Pro Tools
                                  sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Consolidate Clip'] });
                                  sf.ui.proTools.waitForNoModals();
                                  
                                  // Invalidate PT API
                                  sf.app.proTools.invalidate();
                                  
                                  // Get the path of the target file in Pro Tools
                                  var fullPath = sf.app.proTools.getFileLocation({
                                      fileFilters: ['SelectedClipsTimeline'],
                                  }).fileLocations[0].path;
                                  
                                  // Set Pro Tools session to interleaved state to false
                                  sf.app.proTools.setSessionInterleavedState({ interleavedState: false });
                                  
                                  // Get the directory of the target file
                                  var directoryPath = fullPath.substring(0, fullPath.lastIndexOf('/'));
                                  
                                  // Compile File Name without .L or .R suffix
                                  var fileName = fullPath.substring(fullPath.lastIndexOf('/') + 1, fullPath.length - 4); // Assumes the file has a 3-character extension
                                  fileName = fileName.replace(/\.L|\.R$/, ''); // Remove .L or .R from the filename
                                  
                                  // Processed files
                                  const [stem1, stem2] = stemOverrides[modelNameNoExt] || ["(Vocals)", "(Instrumental)"];
                                  var vocalFile = `${directoryPath}/${fileName}_${stem1}_${modelNameNoExt}.wav`;
                                  var instrumentalFile = `${directoryPath}/${fileName}_${stem2}_${modelNameNoExt}.wav`;
                                  
                                  //command line
                                  sf.system.exec({
                                      commandLine: `${separatorPath} "${fullPath}" --model_filename "${selectedModelWithExt}" --output_dir "${directoryPath}" --output_format=WAV`
                                  });
                                     
                                  sf.app.proTools.importAudio({
                                      sourcePaths: [vocalFile, instrumentalFile],
                                      audioFileHandling: "ConvertAudio",
                                      location: "Selection",
                                      destination: "NewTrack"
                                  });
                                  

                                  Once you get audio-separator installed you only need to swap out the path to it at the top of the script

                                  // Path To Audio Separator
                                  const separatorPath = "/Users/bj018/audio-sep-env/bin/audio-separator";
                                  

                                  Looking on my work computer today, it looks like I had to also make new virtual environment when I set this one up awhile back.

                                  1. DAK @DJAK
                                      2025-11-06 04:22:51.038Z

                                      Hey Brandon! I played around and learned how to create virtual environments and so on with python. I ended up creating one for python 3.9 and was able to finally install audioseparator in there. Everything installed smoothly and I went ahead and checked the path of the install to add to your script.

                                      Upon running your script, it starts off by consolidating the selected audio (which in this case I'm using a 5 second selection to test), then the window pops up to select the uvr model to use. After I choose one, that window disappears and then nothing else happens.

                                      I tried to decipher your script to see where the processed file lands, but I don't see where it does. I also see where you set it up to be imported into a NEW TRACK once done, but none of this happens. Is there something else needs to be changed?

                                      Lastly, I use the MDX-Net model called MB-Reformer-Kim. Can this one also be added?

                                      1. BBrandon Jiaconia @Brandon_Jiaconia
                                          2025-11-06 16:03:52.095Z

                                          Nice, sounds like you're pretty much set up. Hopefully this gets you working, I made a mistake in my script yesterday, give this one a try.
                                          You should only need to replace the audio-separator path here

                                          const separatorPath = "/Users/bj018/audio-sep-env/bin/audio-separator";
                                          

                                          I did some tests with the MB-Reformer models. They work, but it will take me some time to incorporate them properly. I'll keep you posted!
                                          When you run the script, you will select the model, it will consolidate your clip and run the UVR model. If all goes well, it will import the new files to new tracks into your session.

                                          // Path To Audio Separator
                                          
                                          const separatorPath = "/Users/bj018/audio-sep-env/bin/audio-separator";
                                          const separatorDir = separatorPath.substring(0, separatorPath.lastIndexOf('/'));
                                          
                                          // MDX model list
                                          var modelFiles = [
                                              // --- MDX models ---
                                              "UVR-MDX-NET-Inst_HQ_1.onnx",
                                              "UVR-MDX-NET-Inst_HQ_2.onnx",
                                              "UVR-MDX-NET-Inst_HQ_3.onnx",
                                              "UVR-MDX-NET-Inst_HQ_4.onnx",
                                              "UVR-MDX-NET-Inst_HQ_5.onnx",
                                              "UVR_MDXNET_Main.onnx",
                                              "UVR-MDX-NET-Inst_Main.onnx",
                                              "UVR_MDXNET_1_9703.onnx",
                                              "UVR_MDXNET_2_9682.onnx",
                                              "UVR_MDXNET_3_9662.onnx",
                                              "UVR-MDX-NET-Inst_1.onnx",
                                              "UVR-MDX-NET-Inst_2.onnx",
                                              "UVR-MDX-NET-Inst_3.onnx",
                                              "UVR_MDXNET_KARA.onnx",
                                              "UVR_MDXNET_KARA_2.onnx",
                                              "UVR_MDXNET_9482.onnx",
                                              "UVR-MDX-NET-Voc_FT.onnx",
                                              "Kim_Vocal_1.onnx",
                                              "Kim_Vocal_2.onnx",
                                              "Kim_Inst.onnx",
                                              "Reverb_HQ_By_FoxJoy.onnx",
                                              "UVR-MDX-NET_Crowd_HQ_1.onnx",
                                              "kuielab_a_vocals.onnx",
                                              "kuielab_a_other.onnx",
                                              "kuielab_a_bass.onnx",
                                              "kuielab_a_drums.onnx",
                                              "kuielab_b_vocals.onnx",
                                              "kuielab_b_other.onnx",
                                              "kuielab_b_bass.onnx",
                                              "kuielab_b_drums.onnx",
                                              "UVR-MDX-NET_Main_340.onnx",
                                              "UVR-MDX-NET_Main_390.onnx",
                                              "UVR-MDX-NET_Main_406.onnx",
                                              "UVR-MDX-NET_Main_427.onnx",
                                              "UVR-MDX-NET_Main_438.onnx",
                                              "UVR-MDX-NET_Inst_82_beta.onnx",
                                              "UVR-MDX-NET_Inst_90_beta.onnx",
                                              "UVR-MDX-NET_Inst_187_beta.onnx",
                                              "UVR-MDX-NET-Inst_full_292.onnx",
                                          ];
                                          // Custom stem names for certain models
                                          const stemOverrides = {
                                              "Reverb_HQ_By_FoxJoy": ["(No Reverb)", "(Reverb)"],
                                              "UVR-MDX-NET_Crowd_HQ_1": ["(No Crowd)", "(Crowd)"],
                                              "kuielab_a_other": ["(No Other)", "(Other)"],
                                              "kuielab_a_bass": ["(No Bass)", "(Bass)"],
                                              "kuielab_a_drums": ["(No Drums)", "(Drums)"],
                                              "kuielab_b_other": ["(No Other)", "(Other)"],
                                              "kuielab_b_bass": ["(No Bass)", "(Bass)"],
                                              "kuielab_b_drums": ["(No Drums)", "(Drums)"]
                                          };
                                          
                                          
                                          // pop up[ search
                                          var modelChoice = sf.interaction.popupSearch({
                                              title: "Choose MDX Model",
                                              items: modelFiles.map(filename => ({
                                                  name: filename.replace(/\.onnx$/, ''),
                                                  value: filename      
                                              }))
                                          }).item;
                                          
                                          // Model Variables
                                          var selectedModelWithExt = modelChoice.value; 
                                          var modelNameNoExt = modelChoice.name;
                                          
                                          //Get the selections in & out points.
                                          const selection = sf.ui.proTools.selectionGet();
                                          
                                          // Set Pro Tools session to interleaved
                                          sf.app.proTools.setSessionInterleavedState({ interleavedState: true });
                                          
                                          // Consolidate the target clip in Pro Tools
                                          sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Consolidate Clip'] });
                                          sf.ui.proTools.waitForNoModals();
                                          
                                          // Invalidate PT API
                                          sf.app.proTools.invalidate();
                                          
                                          // Get the path of the target file in Pro Tools
                                          var fullPath = sf.app.proTools.getFileLocation({
                                              fileFilters: ['SelectedClipsTimeline'],
                                          }).fileLocations[0].path;
                                          
                                          // Set Pro Tools session to interleaved state to false
                                          sf.app.proTools.setSessionInterleavedState({ interleavedState: false });
                                          
                                          // Get the directory of the target file
                                          var directoryPath = fullPath.substring(0, fullPath.lastIndexOf('/'));
                                          
                                          // Compile File Name without .L or .R suffix
                                          var fileName = fullPath.substring(fullPath.lastIndexOf('/') + 1, fullPath.length - 4); 
                                          fileName = fileName.replace(/\.L|\.R$/, ''); // Remove .L or .R from the filename
                                          
                                          // Processed files
                                          const [stem1, stem2] = stemOverrides[modelNameNoExt] || ["(Vocals)", "(Instrumental)"];
                                          var vocalFile = `${directoryPath}/${fileName}_${stem1}_${modelNameNoExt}.wav`;
                                          var instrumentalFile = `${directoryPath}/${fileName}_${stem2}_${modelNameNoExt}.wav`;
                                          
                                          //command line
                                          const command = `PATH="/opt/homebrew/bin:/opt/homebrew/sbin:${separatorDir}:$PATH" \
                                          "${separatorPath}" "${fullPath}" \
                                          --model_filename "${selectedModelWithExt}" \
                                          --output_dir "${directoryPath}" \
                                          --output_format WAV`;
                                          
                                          sf.system.exec({ commandLine: command });
                                          
                                             
                                          sf.app.proTools.importAudio({
                                              sourcePaths: [vocalFile, instrumentalFile],
                                              audioFileHandling: "ConvertAudio",
                                              location: "Selection",
                                              destination: "NewTrack"
                                          });
                                          
                                          1. DAK @DJAK
                                              2025-11-06 16:45:58.155Z

                                              Still a no-go. The Models window opens, I select a model and nothing happens. It also doesn't show any errors or anything, so I'm not even sure where to go from here.

                                              Thanks for all your help tho, Brandon! It's a pretty neat Script idea!

                                              1. BBrandon Jiaconia @Brandon_Jiaconia
                                                  2025-11-07 13:59:51.753Z

                                                  It sounds to me like theres still something funny going on with the python library. What I tend to do when I'm testing this stuff is to run some test commands directly in terminal first to confirm the python library is working.

                                                  /opt/homebrew/Caskroom/miniforge/base/bin/audio-separator \
                                                  "~/Desktop/test_song.wav" \
                                                  --model_filename "UVR-MDX-NET-Inst_HQ_4.onnx" \
                                                  --output_dir "~/Desktop" \
                                                  --output_format WAV --force
                                                  

                                                  Swap out the path to audio-separator, and change the file path to a test file, then run it in terminal. Terminal will give you error information about why it isn't working. The installation guide has a couple useful sections https://pypi.org/project/audio-separator/ - Developing Locally is a good way to fresh install. The onnxruntime issue you ran into is in "Multiple CUDA library versions may be needed"

                                                  It took me awhile to get this installed at first (and this is the easy way), I know the feeling !

                                                  1. DAK @DJAK
                                                      2025-11-07 14:57:38.719Z

                                                      Just tested in terminal and I'm guessing it's something going on with the python installation but doesn't show or describe the error which makes it hard to resolve. But I'm assuming it's still something with onnx

                                                      djak@DJ-AKs-MacBook-Pro ~ % cd Documents
                                                      djak@DJ-AKs-MacBook-Pro Documents % cd audioseparator
                                                      djak@DJ-AKs-MacBook-Pro audioseparator % source bin/activate
                                                      (audioseparator) djak@DJ-AKs-MacBook-Pro audioseparator % which audio-separator
                                                      /Users/djak/Documents/audioseparator/bin/audio-separator
                                                      (audioseparator) djak@DJ-AKs-MacBook-Pro audioseparator % /Users/djak/Documents/audioseparator/bin/audio-separator
                                                      "~/Desktop/test.wav"
                                                      --model_filename "UVR-MDX-NET-Inst_HQ_4.onnx"
                                                      --output_dir "~/Desktop"
                                                      --output_format WAV --force
                                                      usage: audio-separator [-h] [-v] [--log_level LOG_LEVEL]
                                                      [--model_name MODEL_NAME]
                                                      [--model_file_dir MODEL_FILE_DIR]
                                                      [--output_dir OUTPUT_DIR] [--use_cuda] [--use_coreml]
                                                      [--output_format OUTPUT_FORMAT] [--denoise DENOISE]
                                                      [--normalize NORMALIZE] [--single_stem SINGLE_STEM]
                                                      [audio_file]
                                                      audio-separator: error: unrecognized arguments: --model_filename UVR-MDX-NET-Inst_HQ_4.onnx --force
                                                      (audioseparator) djak@DJ-AKs-MacBook-Pro audioseparator %

                                                      1. BBrandon Jiaconia @Brandon_Jiaconia
                                                          2025-11-07 15:16:06.408Z

                                                          It's saying --model_filename is incorrect, which could just be the older version of audio-sep, try switching model_filename to model_name and run it again

                                                          /Users/djak/Documents/audioseparator/bin/audio-separator \
                                                          "~/Desktop/test.wav" \
                                                          --model_name "UVR-MDX-NET-Inst_HQ_4.onnx" \
                                                          --output_dir "~/Desktop" \
                                                          --output_format WAV
                                                          
                                                          1. DAK @DJAK
                                                              2025-11-07 15:23:56.180Z

                                                              That change returned alot of codes and failed as well.

                                                              (audioseparator) djak@DJ-AKs-MacBook-Pro audioseparator % /Users/djak/Documents/audioseparator/bin/audio-separator
                                                              "~/Desktop/test.wav"
                                                              --model_name "UVR-MDX-NET-Inst_HQ_4.onnx"
                                                              --output_dir "~/Desktop"
                                                              --output_format WAV
                                                              2025-11-07 10:22:08.544 - INFO - cli - Separator beginning with input file: ~/Desktop/test.wav
                                                              Traceback (most recent call last):
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1342, in do_open
                                                              h.request(req.get_method(), req.selector, req.data, headers,
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request
                                                              self._send_request(method, url, body, headers, encode_chunked)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1301, in _send_request
                                                              self.endheaders(body, encode_chunked=encode_chunked)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1250, in endheaders
                                                              self._send_output(message_body, encode_chunked=encode_chunked)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1010, in _send_output
                                                              self.send(msg)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 950, in send
                                                              self.connect()
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1424, in connect
                                                              self.sock = self._context.wrap_socket(self.sock,
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 500, in wrap_socket
                                                              return self.sslsocket_class._create(
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1040, in _create
                                                              self.do_handshake()
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ssl.py", line 1309, in do_handshake
                                                              self._sslobj.do_handshake()
                                                              ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)

                                                              During handling of the above exception, another exception occurred:

                                                              Traceback (most recent call last):
                                                              File "/Users/djak/Documents/audioseparator/bin/audio-separator", line 7, in
                                                              sys.exit(main())
                                                              File "/Users/djak/Documents/audioseparator/lib/python3.9/site-packages/audio_separator/utils/cli.py", line 112, in main
                                                              output_files = separator.separate()
                                                              File "/Users/djak/Documents/audioseparator/lib/python3.9/site-packages/audio_separator/separator.py", line 158, in separate
                                                              wget.download(self.model_url, model_path)
                                                              File "/Users/djak/Documents/audioseparator/lib/python3.9/site-packages/wget.py", line 526, in download
                                                              (tmpfile, headers) = ulib.urlretrieve(binurl, tmpfile, callback)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 239, in urlretrieve
                                                              with contextlib.closing(urlopen(url, data)) as fp:
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
                                                              return opener.open(url, data, timeout)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
                                                              response = self._open(req, data)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
                                                              result = self._call_chain(self.handle_open, protocol, protocol +
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
                                                              result = func(*args)
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1385, in https_open
                                                              return self.do_open(http.client.HTTPSConnection, req,
                                                              File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1345, in do_open
                                                              raise URLError(err)
                                                              urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1122)>
                                                              (audioseparator) djak@DJ-AKs-MacBook-Pro audioseparator %

                                                              1. BBrandon Jiaconia @Brandon_Jiaconia
                                                                  2025-11-22 21:31:37.810Z

                                                                  @DJAK - try installing like this in terminal instead

                                                                  pip install "audio-separator[cpu]"
                                                                  

                                                                  I incorporated all of the models. Still two I couldn't get to work, I just commented them out of the model list.

                                                                  You need to enter the path to your audio-separator library in the script. Select a file in Pro Tools, run the script, it will prompt you to select a model, then if all goes well, it will import the stems to new tracks when complete.

                                                                  // Path To Audio Separator
                                                                  
                                                                  const separatorPath = "/your/audio-separator/path";
                                                                  
                                                                  const separatorDir = separatorPath.substring(0, separatorPath.lastIndexOf('/'));
                                                                  
                                                                  // MDX model list
                                                                  var modelFiles = [
                                                                      //MDX
                                                                      "UVR-MDX-NET-Inst_HQ_1.onnx",
                                                                      "UVR-MDX-NET-Inst_HQ_2.onnx",
                                                                      "UVR-MDX-NET-Inst_HQ_3.onnx",
                                                                      "UVR-MDX-NET-Inst_HQ_4.onnx",
                                                                      "UVR-MDX-NET-Inst_HQ_5.onnx",
                                                                      "UVR_MDXNET_Main.onnx",
                                                                      "UVR-MDX-NET-Inst_Main.onnx",
                                                                      "UVR_MDXNET_1_9703.onnx",
                                                                      "UVR_MDXNET_2_9682.onnx",
                                                                      "UVR_MDXNET_3_9662.onnx",
                                                                      "UVR-MDX-NET-Inst_1.onnx",
                                                                      "UVR-MDX-NET-Inst_2.onnx",
                                                                      "UVR-MDX-NET-Inst_3.onnx",
                                                                      "UVR_MDXNET_KARA.onnx",
                                                                      "UVR_MDXNET_KARA_2.onnx",
                                                                      "UVR_MDXNET_9482.onnx",
                                                                      "UVR-MDX-NET-Voc_FT.onnx",
                                                                      "Kim_Vocal_1.onnx",
                                                                      "Kim_Vocal_2.onnx",
                                                                      "Kim_Inst.onnx",
                                                                      "Reverb_HQ_By_FoxJoy.onnx",
                                                                      "UVR-MDX-NET_Crowd_HQ_1.onnx",
                                                                      "kuielab_a_vocals.onnx",
                                                                      "kuielab_a_other.onnx",
                                                                      "kuielab_a_bass.onnx",
                                                                      "kuielab_a_drums.onnx",
                                                                      "kuielab_b_vocals.onnx",
                                                                      "kuielab_b_other.onnx",
                                                                      "kuielab_b_bass.onnx",
                                                                      "kuielab_b_drums.onnx",
                                                                      "UVR-MDX-NET_Main_340.onnx",
                                                                      "UVR-MDX-NET_Main_390.onnx",
                                                                      "UVR-MDX-NET_Main_406.onnx",
                                                                      "UVR-MDX-NET_Main_427.onnx",
                                                                      "UVR-MDX-NET_Main_438.onnx",
                                                                      "UVR-MDX-NET_Inst_82_beta.onnx",
                                                                      "UVR-MDX-NET_Inst_90_beta.onnx",
                                                                      "UVR-MDX-NET_Inst_187_beta.onnx",
                                                                      "UVR-MDX-NET-Inst_full_292.onnx",
                                                                  
                                                                      // Melband Roformer
                                                                      "MDX23C-8KFFT-InstVoc_HQ.ckpt",
                                                                      "MDX23C-8KFFT-InstVoc_HQ_2.ckpt",
                                                                      "MDX23C_D1581.ckpt",
                                                                      "melband_roformer_inst_v1.ckpt",
                                                                      "melband_roformer_inst_v2.ckpt",
                                                                      "melband_roformer_inst_v1_plus.ckpt",
                                                                      "melband_roformer_inst_v1e.ckpt",
                                                                      "melband_roformer_inst_v1e_plus.ckpt",
                                                                      "mel_band_roformer_kim_ft_unwa.ckpt",
                                                                      "mel_band_roformer_kim_ft2_unwa.ckpt",
                                                                      "mel_band_roformer_kim_ft2_bleedless_unwa.ckpt",
                                                                      "mel_band_roformer_kim_ft3_unwa.ckpt",
                                                                      "MelBandRoformerSYHFT.ckpt",
                                                                      "MelBandRoformerSYHFTV2.ckpt",
                                                                      "MelBandRoformerSYHFTV2.5.ckpt",
                                                                      "MelBandRoformerSYHFTV3Epsilon.ckpt",
                                                                      // "MelBandRoformerBigSYHFTV1.ckpt",// Non Working
                                                                      "melband_roformer_big_beta4.ckpt",
                                                                      "melband_roformer_big_beta5e.ckpt",
                                                                      "melband_roformer_big_beta6.ckpt",
                                                                      "melband_roformer_big_beta6x.ckpt",
                                                                      // "MDX23C-DrumSep-aufr33-jarredou.ckpt", Not Importing Stems 
                                                                      
                                                                      // VR Arch
                                                                      "1_HP-UVR.pth",
                                                                      "2_HP-UVR.pth",
                                                                      "3_HP-Vocal-UVR.pth",
                                                                      "4_HP-Vocal-UVR.pth",
                                                                      "5_HP-Karaoke-UVR.pth",
                                                                      "6_HP-Karaoke-UVR.pth",
                                                                      "7_HP2-UVR.pth",
                                                                      "8_HP2-UVR.pth",
                                                                      "9_HP2-UVR.pth",
                                                                      "10_SP-UVR-2B-32000-1.pth",
                                                                      "11_SP-UVR-2B-32000-2.pth",
                                                                      "12_SP-UVR-3B-44100.pth",
                                                                      "13_SP-UVR-4B-44100-1.pth",
                                                                      "14_SP-UVR-4B-44100-2.pth",
                                                                      "15_SP-UVR-MID-44100-1.pth",
                                                                      "16_SP-UVR-MID-44100-2.pth",
                                                                      "17_HP-Wind_Inst-UVR.pth",
                                                                      "UVR-De-Echo-Aggressive.pth",
                                                                      "UVR-De-Echo-Normal.pth",
                                                                      "UVR-DeEcho-DeReverb.pth",
                                                                      "UVR-DeNoise-Lite.pth",
                                                                      "UVR-DeNoise.pth",
                                                                      "UVR-BVE-4B_SN-44100-1.pth",
                                                                      "MGM_HIGHEND_v4.pth",
                                                                      "MGM_LOWEND_A_v4.pth",
                                                                      "MGM_LOWEND_B_v4.pth",
                                                                      "MGM_MAIN_v4.pth",
                                                                      "UVR-De-Reverb-aufr33-jarredou.pth",
                                                                      "UVR-BVE-4B_SN-44100-2.pth",
                                                                      // Demucs models
                                                                      "htdemucs_ft.yaml",
                                                                      "htdemucs.yaml",
                                                                      "hdemucs_mmi.yaml",
                                                                  
                                                                  
                                                                  ];
                                                                  
                                                                  // stem overrides
                                                                  const stemOverrides = {
                                                                      //Onnx overrides
                                                                      "Reverb_HQ_By_FoxJoy": ["(No Reverb)", "(Reverb)"],
                                                                      "UVR-MDX-NET_Crowd_HQ_1": ["(No Crowd)", "(Crowd)"],
                                                                      "kuielab_a_other": ["(No Other)", "(Other)"],
                                                                      "kuielab_a_bass": ["(No Bass)", "(Bass)"],
                                                                      "kuielab_a_drums": ["(No Drums)", "(Drums)"],
                                                                      "kuielab_b_other": ["(No Other)", "(Other)"],
                                                                      "kuielab_b_bass": ["(No Bass)", "(Bass)"],
                                                                      "kuielab_b_drums": ["(No Drums)", "(Drums)"],
                                                                  
                                                                      // VR overrides
                                                                      "UVR-De-Echo-Aggressive": ["(No Echo)", "(Echo)"],
                                                                      "UVR-De-Echo-Normal": ["(No Echo)", "(Echo)"],
                                                                      "UVR-DeEcho-DeReverb": ["(No Reverb)", "(Reverb)"],
                                                                      "UVR-DeNoise-Lite": ["(No Noise)", "(Noise)"],
                                                                      "UVR-DeNoise": ["(No Noise)", "(Noise)"],
                                                                      "17_HP-Wind_Inst-UVR": ["(No Woodwinds)", "(Woodwinds)"],
                                                                      "UVR-De-Reverb-aufr33-jarredou": ["(Dry)", "(No Dry)"]
                                                                  };
                                                                  
                                                                  // ckpt overrides
                                                                  const ckptStemPatterns = {
                                                                      "melband_roformer_big_beta6x": ["(vocals)", "(other)"],
                                                                      "melband_roformer_big_beta6": ["(vocals)", "(other)"],
                                                                      "melband_roformer_big_beta5e": ["(vocals)", "(other)"],
                                                                      "melband_roformer_inst_v1e_plus": ["(vocals)", "(other)"],
                                                                      "melband_roformer_inst_v1e": ["(vocals)", "(other)"],
                                                                      "melband_roformer_inst_v2": ["(Vocals)", "(Instrumental)"],
                                                                      "melband_roformer_instvox_duality_v2": ["(Vocals)", "(Instrumental)"],
                                                                      "melband_roformer_instvox_duality_v1": ["(Vocals)", "(Instrumental)"],
                                                                      "MelBandRoformerSYHFTV3Epsilon": ["(vocals)", "(other)"],
                                                                      "MelBandRoformerSYHFTV2.5": ["(vocals)", "(other)"],
                                                                      "MelBandRoformerSYHFT": ["(vocals)", "(other)"],
                                                                      "mel_band_roformer_kim_ft_unwa": ["(Vocals)", "(Other)"],
                                                                      "mel_band_roformer_kim_ft2_unwa": ["(vocals)", "(other)"],
                                                                      "MDX23C-8KFFT-InstVoc_HQ": ["(Vocals)", "(Instrumental)"],
                                                                      "MDX23C-8KFFT-InstVoc_HQ_2": ["(Vocals)", "(Instrumental)"],
                                                                      "MDX23C_D1581": ["(Vocals)", "(Instrumental)"],
                                                                      // "MDX23C-DrumSep-aufr33-jarredou": ["(kick)", "(snare)", "(toms)", "(hh)", "(ride)", "(crash)"],//files come out lowercase but dont import other than kick/snare
                                                                  };
                                                                  // Model Selection Popup
                                                                  var modelChoice = sf.interaction.popupSearch({
                                                                      title: "Choose Model",
                                                                      items: modelFiles.map(filename => ({
                                                                          name: filename.replace(/\.(onnx|ckpt|pth|yaml)$/, ''),
                                                                          value: filename
                                                                      }))
                                                                  }).item;
                                                                  
                                                                  var selectedModelWithExt = modelChoice.value; 
                                                                  var modelNameNoExt = modelChoice.name;
                                                                  
                                                                  //Session Paths
                                                                  const selection = sf.ui.proTools.selectionGet();
                                                                  const sessionHFSPath = sf.app.proTools.getSessionPath().sessionPath;
                                                                  const sessionPOSIXPath = sessionHFSPath.replace(/^:/, '/').replace(/:/g, '/');
                                                                  const sessionDir = sessionPOSIXPath.split('/').slice(0, -1).join('/');
                                                                  const audioFilesFolder = `${sessionDir}/Audio Files`;
                                                                  
                                                                  // Interleaved State, Consolidate
                                                                  sf.app.proTools.setSessionInterleavedState({ interleavedState: true });
                                                                  sf.wait({ intervalMs: 250 });
                                                                  sf.app.proTools.consolidateClip();
                                                                  sf.ui.proTools.waitForNoModals();
                                                                  sf.app.proTools.setSessionInterleavedState({ interleavedState: false });
                                                                  sf.app.proTools.invalidate();
                                                                  
                                                                  //Fully Selected New Clip - Raphael Sepulveda
                                                                  //https://forum.soundflow.org/-3869#post-5
                                                                  function getSelectedClipInfo() {
                                                                      const selectionRange = sf.app.proTools.getTimelineSelection();
                                                                      const selectionInTime = Number(selectionRange.inTime);
                                                                      const selectionOutTime = Number(selectionRange.outTime);
                                                                  
                                                                      const allSelectedClips = sf.app.proTools.getSelectedClipInfo().clips;
                                                                  
                                                                      const fullySelectedClips = allSelectedClips.reduce((clips, clip) => {
                                                                          const clipStartTime = Number(clip.startTime);
                                                                          const clipEndTime = Number(clip.endTime);
                                                                  
                                                                          const isFullySelected =
                                                                              clipStartTime >= selectionInTime && clipEndTime <= selectionOutTime;
                                                                  
                                                                          const isFade = ["(fade in)", "(fade out)", "(cross fade)"].some(fade =>
                                                                              clip.clipName.toLowerCase().includes(fade)
                                                                          );
                                                                  
                                                                          if (isFullySelected && !isFade) {
                                                                              const clipName = clip.clipName.replace(/\.\w+$/, "");
                                                                              if (!clips.some(c => c.clipName === clipName)) {
                                                                                  clips.push({
                                                                                      clipName,
                                                                                      trackName: clip.trackName,
                                                                                      startTime: clipStartTime,
                                                                                      endTime: clipEndTime
                                                                                  });
                                                                              }
                                                                          }
                                                                  
                                                                          return clips;
                                                                      }, []);
                                                                  
                                                                      return {
                                                                          clips: fullySelectedClips,
                                                                          names: fullySelectedClips.map(c => c.clipName)
                                                                      };
                                                                  }
                                                                  
                                                                  // Selected Clip File Paths
                                                                  const selectedClipInfo = getSelectedClipInfo();
                                                                  const firstSelectedClipName = selectedClipInfo.names[0];
                                                                  const fullFilePath = `${audioFilesFolder}/${firstSelectedClipName}.wav`;
                                                                  
                                                                  // Check if file exists
                                                                  if (!sf.file.exists({ path: fullFilePath }).exists) {
                                                                      log("Could not find target file:", fullFilePath);
                                                                      throw 0;
                                                                  }
                                                                  
                                                                  //Stem setup
                                                                  let stem1, stem2;
                                                                  
                                                                  if (selectedModelWithExt.endsWith(".onnx")) {
                                                                      [stem1, stem2] = stemOverrides[modelNameNoExt] || ["(Vocals)", "(Instrumental)"];
                                                                  }
                                                                  else if (selectedModelWithExt.endsWith(".ckpt")) {
                                                                      [stem1, stem2] = ckptStemPatterns[modelNameNoExt] || ["(vocals)", "(other)"];
                                                                  }
                                                                  else if (selectedModelWithExt.endsWith(".pth")) {
                                                                      [stem1, stem2] = stemOverrides[modelNameNoExt] || ["(Vocals)", "(Instrumental)"];
                                                                  }
                                                                  else if (selectedModelWithExt.endsWith(".yaml")) {
                                                                      stem1 = ["(Vocals)", "(Drums)", "(Bass)", "(Other)"];
                                                                  }
                                                                  
                                                                  //Processed File Setup
                                                                  let outputFiles = [];
                                                                  
                                                                  if (Array.isArray(stem1)) {
                                                                      for (const stem of stem1) {
                                                                          outputFiles.push(`${audioFilesFolder}/${firstSelectedClipName}_${stem}_${modelNameNoExt}.wav`);
                                                                      }
                                                                  } else {
                                                                      outputFiles = [
                                                                          `${audioFilesFolder}/${firstSelectedClipName}_${stem1}_${modelNameNoExt}.wav`,
                                                                          `${audioFilesFolder}/${firstSelectedClipName}_${stem2}_${modelNameNoExt}.wav`
                                                                      ];
                                                                  }
                                                                  
                                                                  const commandLine = `PATH=${separatorDir}:$PATH ${separatorPath} "${fullFilePath}" --model_filename "${selectedModelWithExt}" --output_dir "${audioFilesFolder}" --output_format=WAV`;
                                                                  
                                                                  sf.system.exec({
                                                                      commandLine: commandLine
                                                                  });
                                                                  
                                                                  // Import
                                                                  sf.app.proTools.importAudio({
                                                                      sourcePaths: outputFiles,
                                                                      audioFileHandling: "Default",
                                                                      location: "Selection",
                                                                      destination: "NewTrack"
                                                                  });
                                                                  sf.ui.proTools.waitForNoModals();