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.

    • 1 replies
    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!