Become a Site Supporter and Never see Ads again!

Author Topic: VST plugins & mixing/mastering workflow in your DAWs  (Read 11675 times)

0 Members and 1 Guest are viewing this topic.

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #45 on: February 01, 2025, 08:48:55 AM »
So... I've tested the revised script on two soundboard/audience matrix recordings and I'm now pretty confident that it works. But it was a pretty frustrating experience overall.

I tried the two fixes/workarounds suggested in the github issue and neither of them worked. After that I tried it with the help of ChatGPT 4o and Claude and it was maddening, because the AI was so stupid. Some of the workarounds suggested by the AI drove my laptop to a memory usage of 100% (32 GiB).

Since neither the library nor the LLMs could reliably generate stereo files, I had the input files split into mono channels, which I then reassembled at the end. This works fine as long as one of the channels of the reference file does not contain only silence. I think most of the relevant cases are now covered by the Python script below.

Code: [Select]
import os
import sys
import argparse
import logging
from pydub import AudioSegment
from audalign import FingerprintRecognizer, align_files

class LoggerWriter:
    """Redirects stdout/stderr to logging system with timestamps"""
    def __init__(self, level):
        self.level = level
   
    def write(self, message):
        if message.strip():
            logging.log(self.level, message.strip())
   
    def flush(self):
        pass

def configure_logging(destination_dir):
    """Set up logging to both console and file with timestamps"""
    logger = logging.getLogger()
    logger.setLevel(logging.INFO)

    # Clear existing handlers
    for handler in logger.handlers[:]:
        logger.removeHandler(handler)

    # Create formatter with timestamps
    formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')

    # File handler (log to destination directory)
    log_file = os.path.join(destination_dir, 'alignment.log')
    file_handler = logging.FileHandler(log_file)
    file_handler.setFormatter(formatter)
    logger.addHandler(file_handler)

    # Console handler
    console_handler = logging.StreamHandler()
    console_handler.setFormatter(formatter)
    logger.addHandler(console_handler)

    # Redirect standard streams
    sys.stdout = LoggerWriter(logging.INFO)
    sys.stderr = LoggerWriter(logging.ERROR)

    logging.info(f"Logging system initialized. Full log at {log_file}")

def list_root_wav_files(directory):
    """List all .wav files in directory root"""
    try:
        return [
            os.path.join(directory, f)
            for f in os.listdir(directory)
            if os.path.isfile(os.path.join(directory, f)) and f.lower().endswith(".wav")
        ]
    except Exception as e:
        logging.error(f"File listing error: {e}")
        return []

def split_stereo_to_mono(input_file, temp_dir):
    """Split stereo file to mono channels with existing file check"""
    try:
        base_name = os.path.splitext(os.path.basename(input_file))[0]
        left_output = os.path.join(temp_dir, f"{base_name}_L.wav")
        right_output = os.path.join(temp_dir, f"{base_name}_R.wav")
       
        # Check if files already exist
        if os.path.exists(left_output) and os.path.exists(right_output):
            logging.info(f"Using existing split files for '{input_file}':")
            logging.info(f"  - Left channel: '{left_output}'")
            logging.info(f"  - Right channel: '{right_output}'")
            return left_output, right_output
           
        audio = AudioSegment.from_file(input_file)
        channels = audio.channels

        if channels == 1:
            # If mono, check if temp file exists
            mono_output = os.path.join(temp_dir, os.path.basename(input_file))
            if os.path.exists(mono_output):
                logging.info(f"Using existing mono file: {mono_output}")
                return mono_output, None
               
            # If not exists, create it
            audio.export(mono_output, format="wav")
            logging.info(f"Copied mono file '{input_file}' to '{mono_output}'.")
            return mono_output, None

        elif channels == 2:
            # Split stereo into left and right channels
            left_channel = audio.split_to_mono()[0]
            right_channel = audio.split_to_mono()[1]

            left_channel.export(left_output, format="wav")
            right_channel.export(right_output, format="wav")

            logging.info(f"Split stereo file '{input_file}' into:")
            logging.info(f"  - Left channel: '{left_output}'")
            logging.info(f"  - Right channel: '{right_output}'")

            return left_output, right_output

    except Exception as e:
        logging.error(f"Splitting error: {e}")
        return None, None

def align_channels(ref_path, input_left, input_right, dest_dir, channel_mode, temp_dir):
    """Align channels with reference using specified mode"""
    try:
        recognizer = FingerprintRecognizer()
        ref_audio = AudioSegment.from_file(ref_path)
       
        # Handle reference channels
        ref_base = os.path.splitext(os.path.basename(ref_path))[0]
        ref_left = os.path.join(temp_dir, f"{ref_base}_L.wav")
        ref_right = os.path.join(temp_dir, f"{ref_base}_R.wav")
       
        if ref_audio.channels == 1:
            ref_left = ref_path
            ref_right = ref_path
            logging.info("Using mono reference for both channels")
        else:
            if channel_mode == 'L':
                ref_audio.split_to_mono()[0].export(ref_left, format="wav")
                ref_right = ref_left
                logging.info("Using left reference channel for all alignments")
            elif channel_mode == 'R':
                ref_audio.split_to_mono()[1].export(ref_right, format="wav")
                ref_left = ref_right
                logging.info("Using right reference channel for all alignments")
            else:
                ref_audio.split_to_mono()[0].export(ref_left, format="wav")
                ref_audio.split_to_mono()[1].export(ref_right, format="wav")
                logging.info("Using stereo reference channels independently")

        # Perform alignments
        if input_left:
            align_files(
                filename_a=str(ref_left),
                filename_b=str(input_left),
                destination_path=dest_dir,
                write_extension="_L_aligned.wav",
                write_multi_channel=False,
                recognizer=recognizer
            )
        if input_right:
            align_files(
                filename_a=str(ref_right),
                filename_b=str(input_right),
                destination_path=dest_dir,
                write_extension="_R_aligned.wav",
                write_multi_channel=False,
                recognizer=recognizer
            )

    except Exception as e:
        logging.error(f"Alignment failed: {e}")
        raise

def rename_aligned_files(destination_dir):
    """Renames aligned mono files to follow the desired naming convention."""
    try:
        for filename in os.listdir(destination_dir):
            if "_L._L_aligned.wav" in filename:
                new_name = filename.replace("_L._L_aligned", "_L_aligned")
                os.rename(
                    os.path.join(destination_dir, filename),
                    os.path.join(destination_dir, new_name),
                )
                logging.info(f"Renamed '{filename}' to '{new_name}'.")
            elif "_R._R_aligned.wav" in filename:
                new_name = filename.replace("_R._R_aligned", "_R_aligned")
                os.rename(
                    os.path.join(destination_dir, filename),
                    os.path.join(destination_dir, new_name),
                )
                logging.info(f"Renamed '{filename}' to '{new_name}'.")
    except Exception as e:
        logging.error(f"An error occurred during renaming: {e}")
        raise

def merge_aligned_channels(destination_dir):
    """Merges aligned left and right mono channels into stereo files."""
    try:
        aligned_files = [f for f in os.listdir(destination_dir) if f.endswith("_aligned.wav")]
       
        grouped_files = {}
        for f in aligned_files:
            base_name = f.split("_")[0]
            if base_name not in grouped_files:
                grouped_files[base_name] = {}
           
            if "_L_aligned" in f:
                grouped_files[base_name]["left"] = os.path.join(destination_dir, f)
            if "_R_aligned" in f:
                grouped_files[base_name]["right"] = os.path.join(destination_dir, f)

        for base_name, channels in grouped_files.items():
            if "left" in channels and "right" in channels:
                output_stereo = os.path.join(destination_dir, f"{base_name}_aligned_stereo.wav")
               
                left_audio = AudioSegment.from_file(channels["left"])
                right_audio = AudioSegment.from_file(channels["right"])
                stereo_audio = AudioSegment.from_mono_audiosegments(left_audio, right_audio)
                stereo_audio.export(output_stereo, format="wav")
               
                logging.info(f"Merged '{channels['left']}' and '{channels['right']}' into stereo file '{output_stereo}'.")
               
                os.remove(channels["left"])
                os.remove(channels["right"])
                logging.info(f"Deleted intermediate mono files")

    except Exception as e:
        logging.error(f"An error occurred during merging: {e}")
        raise

def process_workflow(input_dir, reference_basename, temp_dir, destination_dir, channel_mode='auto'):
    """Full workflow: Split -> Align -> Rename -> Merge"""
    os.makedirs(temp_dir, exist_ok=True)
    os.makedirs(destination_dir, exist_ok=True)
   
    ref_path = os.path.join(input_dir, reference_basename)
    wav_files = list_root_wav_files(input_dir)
   
    had_errors = False
   
    try:
        for wav_file in wav_files:
            if os.path.basename(wav_file) == reference_basename:
                continue
            try:
                input_left, input_right = split_stereo_to_mono(wav_file, temp_dir)
                if input_left is None and input_right is None:
                    had_errors = True
                    continue
                   
                align_channels(ref_path, input_left, input_right, destination_dir, channel_mode, temp_dir)
            except Exception as e:
                had_errors = True
                logging.error(f"Failed to process file {wav_file}: {e}")
                continue
           
        try:
            rename_aligned_files(destination_dir)
        except Exception as e:
            had_errors = True
            logging.error(f"Failed during renaming: {e}")
           
        try:
            merge_aligned_channels(destination_dir)
        except Exception as e:
            had_errors = True
            logging.error(f"Failed during merging: {e}")
           
        if had_errors:
            logging.warning("Processing completed with errors")
        else:
            logging.info("Processing completed successfully")
       
    except Exception as e:
        logging.critical(f"Workflow failed: {e}")
        raise

def main():
    parser = argparse.ArgumentParser(description="Audio alignment workflow")
    parser.add_argument("-i", "--input", required=True, help="Input directory with WAV files")
    parser.add_argument("-r", "--reference", required=True, help="Reference filename")
    parser.add_argument("-t", "--temp", required=True, help="Temporary directory path")
    parser.add_argument("-o", "--destination", required=True, help="Output directory")
    parser.add_argument("-c", "--channel", choices=['L','R','auto'], default='auto',
                      help="Reference channel selection")

    args = parser.parse_args()
   
    # Create directories and configure logging
    os.makedirs(args.destination, exist_ok=True)
    configure_logging(args.destination)

    try:
        process_workflow(args.input, args.reference, args.temp, args.destination, args.channel)
    except Exception as e:
        logging.critical(f"Fatal error in main workflow: {e}")
        sys.exit(1)

if __name__ == "__main__":
    main()

Parameters:

The script accepts four required command-line parameters:

Input Directory (-i, --input)
  • Path to the directory containing WAV files to be processed
  • Contains both the reference file and files to be aligned
  • Only processes WAV files in the root directory (subdirectories are ignored)

Reference File (-r, --reference)
  • Basename (filename) of the reference WAV file
  • This file serves as the timing reference for aligning other files
  • Must be located in the input directory
  • Can be either mono or stereo

Temporary Directory (-t, --temp)
  • Path where intermediate mono files are stored
  • Used for storing split channels from stereo files
  • Stores both reference and input file channels during processing
  • Files in this directory are reused if they already exist

Destination Directory (-o, --destination)
  • Path where the final aligned files are saved
  • Contains the alignment log file
  • Stores the final merged stereo files after alignment
  • Intermediate aligned mono files are created here before merging

Optional Channel Mode (-c, --channel)
  • Specifies which channel to use for alignment: 'L' (left), 'R' (right), or 'auto'
  • In 'auto' mode, left channels are aligned with left, right with right
  • When using 'L' or 'R', all channels are aligned against the specified reference channel
  • Particularly useful when one channel of the reference might be silent or corrupted

Example: I think 3 minutes for the automated Alignment of a SBD/AUD matrix aren't too bad. I think memory usage didn't exceed 7-8 GiB with this algorithm. Of course, all of this wouldn't have been necessary if the Audalign library supported stereo output out of the box.

Code: [Select]
/home/markus/.pyenv/versions/3.11.10/bin/python ./trackalign.py  -i bak/  -t temp/ -o destination -r

20160117_CHVE_44.1Khz-16bit.wav -c auto
2025-02-01 14:17:24,761 - INFO - Logging system initialized. Full log at destination/alignment.log
2025-02-01 14:17:52,828 - INFO - Split stereo file 'bak/AUD.wav' into:
2025-02-01 14:17:52,828 - INFO -   - Left channel: 'temp/AUD_L.wav'
2025-02-01 14:17:52,828 - INFO -   - Right channel: 'temp/AUD_R.wav'
2025-02-01 14:17:54,119 - INFO - Using stereo reference channels independently
2025-02-01 14:17:54,484 - INFO - Fingerprinting 20160117_CHVE_44.1Khz-16bit_L.wav
2025-02-01 14:17:55,574 - INFO - Fingerprinting AUD_L.wav
2025-02-01 14:18:56,511 - INFO - Finished fingerprinting AUD_L.wav
2025-02-01 14:19:01,108 - INFO - Finished fingerprinting 20160117_CHVE_44.1Khz-16bit_L.wav
2025-02-01 14:19:01,635 - INFO - 20160117_CHVE_44.1Khz-16bit_L.wav: Finding Matches...
2025-02-01 14:19:01,844 - INFO - Aligning matches
2025-02-01 14:19:01,929 - INFO - AUD_L.wav: Finding Matches...
2025-02-01 14:19:02,041 - INFO - Aligning matches
2025-02-01 14:19:03,873 - INFO - Writing destination/20160117_CHVE_44.1Khz-16bit_L._L_aligned.wav
2025-02-01 14:19:03,954 - INFO - Writing destination/AUD_L._L_aligned.wav
2025-02-01 14:19:04,802 - INFO - Writing destination/total._L_aligned.wav
2025-02-01 14:19:04,891 - INFO - 2 out of 2 found and aligned
2025-02-01 14:19:04,891 - INFO - Total fingerprints: 949603
2025-02-01 14:19:05,282 - INFO - Fingerprinting 20160117_CHVE_44.1Khz-16bit_R.wav
2025-02-01 14:19:06,359 - INFO - Fingerprinting AUD_R.wav
2025-02-01 14:20:07,225 - INFO - Finished fingerprinting AUD_R.wav
2025-02-01 14:20:12,142 - INFO - Finished fingerprinting 20160117_CHVE_44.1Khz-16bit_R.wav
2025-02-01 14:20:12,699 - INFO - 20160117_CHVE_44.1Khz-16bit_R.wav: Finding Matches...
2025-02-01 14:20:12,820 - INFO - Aligning matches
2025-02-01 14:20:12,896 - INFO - AUD_R.wav: Finding Matches...
2025-02-01 14:20:13,145 - INFO - Aligning matches
2025-02-01 14:20:14,859 - INFO - Writing destination/20160117_CHVE_44.1Khz-16bit_R._R_aligned.wav
2025-02-01 14:20:14,943 - INFO - Writing destination/AUD_R._R_aligned.wav
2025-02-01 14:20:15,797 - INFO - Writing destination/total._R_aligned.wav
2025-02-01 14:20:15,881 - INFO - 2 out of 2 found and aligned
2025-02-01 14:20:15,881 - INFO - Total fingerprints: 1898676
2025-02-01 14:20:15,983 - INFO - Renamed 'AUD_R._R_aligned.wav' to 'AUD_R_aligned.wav'.
2025-02-01 14:20:15,983 - INFO - Renamed '20160117_CHVE_44.1Khz-16bit_L._L_aligned.wav' to '20160117_CHVE_44.1Khz-16bit_L_aligned.wav'.
2025-02-01 14:20:15,983 - INFO - Renamed '20160117_CHVE_44.1Khz-16bit_R._R_aligned.wav' to '20160117_CHVE_44.1Khz-16bit_R_aligned.wav'.
2025-02-01 14:20:15,983 - INFO - Renamed 'AUD_L._L_aligned.wav' to 'AUD_L_aligned.wav'.
2025-02-01 14:20:16,859 - INFO - Merged 'destination/20160117_CHVE_44.1Khz-16bit_L_aligned.wav' and 'destination/20160117_CHVE_44.1Khz-16bit_R_aligned.wav' into stereo file 'destination/20160117_aligned_stereo.wav'.
2025-02-01 14:20:16,906 - INFO - Deleted intermediate mono files
2025-02-01 14:20:17,889 - INFO - Merged 'destination/AUD_L_aligned.wav' and 'destination/AUD_R_aligned.wav' into stereo file 'destination/AUD_aligned_stereo.wav'.
2025-02-01 14:20:17,932 - INFO - Deleted intermediate mono files
2025-02-01 14:20:18,804 - INFO - Merged 'destination/total._L_aligned.wav' and 'destination/total._R_aligned.wav' into stereo file 'destination/total._aligned_stereo.wav'.
2025-02-01 14:20:18,853 - INFO - Deleted intermediate mono files
2025-02-01 14:20:18,855 - INFO - Processing completed successfully

« Last Edit: February 01, 2025, 08:51:44 AM by if_then_else »

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #46 on: February 07, 2025, 12:23:59 AM »
I've created a stand-alone Windows version of my command-line tool for the track alignment. (I had to compile it from Python to C++ and into an *.exe file. So there is some performance overhead compared to the original Python script and the file size is also quite big. About 50 MB. Sorry, there was no other way. I had to download GBs worth of dependencies amd C++ compilers to compile it on Windows in the first place.)

EDIT: I uploaded the binary stand-alone version to GitHub releases:

https://github.com/mmathis76/TrackAlign/releases/tag/v1.0.0

The docs and the Python code are also available on Github:

https://github.com/mmathis76/TrackAlign
« Last Edit: February 08, 2025, 08:10:28 AM by if_then_else »

Offline phil_er_up

  • Trade Count: (9)
  • Taperssection All-Star
  • ****
  • Posts: 1326
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #47 on: February 08, 2025, 12:35:25 PM »
I've created a stand-alone Windows version of my command-line tool for the track alignment. (I had to compile it from Python to C++ and into an *.exe file. So there is some performance overhead compared to the original Python script and the file size is also quite big. About 50 MB. Sorry, there was no other way. I had to download GBs worth of dependencies amd C++ compilers to compile it on Windows in the first place.)

EDIT: I uploaded the binary stand-alone version to GitHub releases:

https://github.com/mmathis76/TrackAlign/releases/tag/v1.0.0

The docs and the Python code are also available on Github:

https://github.com/mmathis76/TrackAlign
Thank you for this. It is appreciated. Will take a look at it.

Tried to get one of the other "align" tools on github and could not get it to work. See what you mean by tricky to install.
Everyday is a gift. Enjoy each one!
Forward motion bring positive results.

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #48 on: February 08, 2025, 01:27:42 PM »
Running the exe file I had created is straightforward. That was the very reason I created it.

If you wanted to run the original Python script (e.g. because it's more memory efficient or because you prefer one of the other supported alignment algorithms) things are a bit different.

I can post the specific installation steps to get it working here, but it was even more complicated on Windows than on Linux: To install one of the optional components of Audalign you would need a C++ compiler to compile the code. Linux comes with gcc. On Windows you would have to Install the free C++ compilers from Visual studio and Clang. In other words, several GB worth of dependencies.

The exe file I uploaded to github is quite big but it comes with all of the dependencies out of the box. Because all of the dependencies are included there's also an overhead in terms of memory consumption. 16GB of RAM recommended. 8 GB would be suffient for the original Python version.

I figured out that the Audalign library on which it is based could produce multichannel output. But it is a bit useless because it would be a multichannel file composed of mono tracks of all input files. My wrapper script preserves proper stereo output by splitting the input files to mono and merging them again after the alignment has taken place.
« Last Edit: February 08, 2025, 01:29:15 PM by if_then_else »

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #49 on: February 09, 2025, 03:16:57 AM »
Added the full installation procedure (on Windows 11) for the original Python script here:

https://github.com/mmathis76/TrackAlign/blob/main/README.md

If you don't want/need Python installed, feel free to use the compiled *.exe file from https://github.com/mmathis76/TrackAlign/releases/.

Again, the Windows *.exe will probably need twice the RAM compared to the Python script at run-time.

Recommendations: 8 GB of RAM for the Python script. 16 GB of RAM for the exe version.

(This is largely due to the fingerprinting and cross-correlation algorithms used by the Audalign package.
They appear to be precise but at the same time very demanding in terms of memory. 

Offline phil_er_up

  • Trade Count: (9)
  • Taperssection All-Star
  • ****
  • Posts: 1326
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #50 on: February 09, 2025, 07:23:25 AM »
Added the full installation procedure (on Windows 11) for the original Python script here:

https://github.com/mmathis76/TrackAlign/blob/main/README.md

If you don't want/need Python installed, feel free to use the compiled *.exe file from https://github.com/mmathis76/TrackAlign/releases/.

Again, the Windows *.exe will probably need twice the RAM compared to the Python script at run-time.

Recommendations: 8 GB of RAM for the Python script. 16 GB of RAM for the exe version.

(This is largely due to the fingerprinting and cross-correlation algorithms used by the Audalign package.
They appear to be precise but at the same time very demanding in terms of memory.

Tried to run the .exe and received the following message:

==============================================

From webroot: Threat: trackalign.exe - infection - win.Trojan.Gen

Webroot deleted the file.
==============================================
 DL'ed it again and webroot says this time:

Malware Group:
Win32.LocalInfect.2

Location:
To my local drive c:\....
===============================================

Not sure how to proceed now...
« Last Edit: February 09, 2025, 07:25:42 AM by phil_er_up »
Everyday is a gift. Enjoy each one!
Forward motion bring positive results.

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #51 on: February 09, 2025, 08:17:31 AM »
I've scanned my original file with ClamTK on Linux and MS Defender on Windows and no Trojan was found.

The MD5 sum is

Algorithm       Hash                                                                   Path
---------       ----                                                                   ----
MD5             E9FE34B6E5EA791655E1D203D33073D7

Check if your's is identical or if the file has been tempered with.

Otherwise, the heuristics of your anti virus tool might have jumped on the exe version because of the way Nuitka had compiled the dependencies.

If that's an issue, you can still install the Python script and its dependencies based on the how-to.

I'm definitely not distributing any Trojan code.

Offline phil_er_up

  • Trade Count: (9)
  • Taperssection All-Star
  • ****
  • Posts: 1326
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #52 on: February 09, 2025, 09:30:37 AM »
Was not accusing you of building  a .exe with a trojan virus just wanted to let you know what happened when I tried to run it.

Tried again to DL the file and webroot will not let me now. Can not run a md5 to see if they are the same as what you posted.

============================================================================================

Must be a hassle to do work, document it, put it out there and first person who runs it get a potential virus. Really sorry about this.

Want to thank you for all you have done with this thread and informing us about the ever changing world of audio VST plugins.

« Last Edit: February 09, 2025, 09:32:33 AM by phil_er_up »
Everyday is a gift. Enjoy each one!
Forward motion bring positive results.

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #53 on: February 09, 2025, 09:36:18 AM »
No worries. A friend of mine wanted to try it on some of his own matrix recordings. I'll have him beta-test it.

I can only tell you it took me hours to figure out the installation steps on Windows and to script it in the first place. If it helps others: the better.

I just don't understand why the Audalign package doesn't support proper stereo output in the first place. Otherwise, it looks like a great and useful tool.
« Last Edit: February 09, 2025, 10:15:00 AM by if_then_else »

Offline phil_er_up

  • Trade Count: (9)
  • Taperssection All-Star
  • ****
  • Posts: 1326
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #54 on: February 09, 2025, 10:08:04 AM »

I can only tell you it took me hours to figure out the installation steps on Windows and to script it in the first place. If it helps others: the better.

Use to program myself and know how much work goes into creating software. Did not really want to tell you do to I imagine your heart just sank when you saw my post about potential virus.

I know you put a lot of work into this and want to thank you for it.
Everyday is a gift. Enjoy each one!
Forward motion bring positive results.

Offline TheJez

  • Trade Count: (0)
  • Taperssection Regular
  • **
  • Posts: 203
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #55 on: February 10, 2025, 11:55:05 AM »
Hi if_then_else,
Thanks for your work on this tool! It is much appreciated...
I tried the *.exe over the weekend on a gig from 2017 of which I had the mixing desk recording and an audience recording. Unfortunately the program reported an error at the end, when merging the mono tracks to a stereo wav file for the mixing desk recording. However, the mono-tracks were still there in the output folder, so I still had high hopes. After loading the stereo output audience recording and the two mono output mixing desk tracks into Audition, I noticed they were not very well in sync. The original input files were ~20s out of sync, the mono 'alligned files' were still ~120ms and ~50ms out of sync. Of course it was very nice that it more or less alligned them, but the remaining mismatch is too much to be usable. Any idea what the issue here is? Are the recordings too different for the algorithm to do a more accurate allignment?

I'll add a screenshot of the result and the logging... Thanks again!
Quote
.\trackalign.exe -i in -r aud.wav -t temp -o out

2025-02-08 16:10:41,809 - INFO - Logging system initialized. Full log at out\alignment.log
2025-02-08 16:13:26,608 - INFO - Split stereo file 'in\aud.WAV' into:
2025-02-08 16:13:26,608 - INFO -   - Left channel: 'temp\aud_L.wav'
2025-02-08 16:13:26,608 - INFO -   - Right channel: 'temp\aud_R.wav'
2025-02-08 16:15:51,392 - INFO - Using stereo reference channels independently
2025-02-08 16:21:42,813 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:21:42,813 - INFO - Aligning matches
2025-02-08 16:21:42,813 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:21:42,813 - INFO - Aligning matches
2025-02-08 16:21:42,814 - INFO - No matches detected
2025-02-08 16:21:42,814 - INFO - 0 out of 1 found and aligned
2025-02-08 16:26:28,959 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:26:28,968 - INFO - Aligning matches
2025-02-08 16:26:28,968 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:26:28,968 - INFO - Aligning matches
2025-02-08 16:26:28,969 - INFO - No matches detected
2025-02-08 16:26:28,969 - INFO - 0 out of 1 found and aligned
2025-02-08 16:29:00,523 - INFO - Split stereo file 'in\mx.WAV' into:
2025-02-08 16:29:00,523 - INFO -   - Left channel: 'temp\mx_L.wav'
2025-02-08 16:29:00,523 - INFO -   - Right channel: 'temp\mx_R.wav'
2025-02-08 16:31:30,948 - INFO - Using stereo reference channels independently
2025-02-08 16:37:49,428 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:37:50,860 - INFO - Aligning matches
2025-02-08 16:37:51,429 - INFO - mx_L.wav: Finding Matches...
2025-02-08 16:37:52,353 - INFO - Aligning matches
2025-02-08 16:38:05,107 - INFO - Writing out\aud_L._L_aligned.wav
2025-02-08 16:38:05,527 - INFO - Writing out\mx_L._L_aligned.wav
2025-02-08 16:38:10,992 - INFO - Writing out\total._L_aligned.wav
2025-02-08 16:38:11,459 - INFO - 2 out of 2 found and aligned
2025-02-08 16:38:11,459 - INFO - Total fingerprints: 4171050
2025-02-08 16:43:15,120 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:43:16,153 - INFO - Aligning matches
2025-02-08 16:43:16,684 - INFO - mx_R.wav: Finding Matches...
2025-02-08 16:43:18,160 - INFO - Aligning matches
2025-02-08 16:43:30,448 - INFO - Writing out\aud_R._R_aligned.wav
2025-02-08 16:43:30,873 - INFO - Writing out\mx_R._R_aligned.wav
2025-02-08 16:43:36,293 - INFO - Writing out\total._R_aligned.wav
2025-02-08 16:43:36,761 - INFO - 2 out of 2 found and aligned
2025-02-08 16:43:36,762 - INFO - Total fingerprints: 8284363
2025-02-08 16:43:37,565 - INFO - Renamed 'aud_L._L_aligned.wav' to 'aud_L_aligned.wav'.
2025-02-08 16:43:37,565 - INFO - Renamed 'aud_R._R_aligned.wav' to 'aud_R_aligned.wav'.
2025-02-08 16:43:37,566 - INFO - Renamed 'mx_L._L_aligned.wav' to 'mx_L_aligned.wav'.
2025-02-08 16:43:37,566 - INFO - Renamed 'mx_R._R_aligned.wav' to 'mx_R_aligned.wav'.
2025-02-08 16:43:41,200 - INFO - Merged 'out\aud_L_aligned.wav' and 'out\aud_R_aligned.wav' into stereo file 'out\aud_aligned_stereo.wav'.
2025-02-08 16:43:41,257 - INFO - Deleted intermediate mono files
2025-02-08 16:43:42,250 - ERROR - An error occurred during merging: attempt to assign array of size 259154417 to extended slice of size 259158513
2025-02-08 16:43:42,250 - ERROR - Failed during merging: attempt to assign array of size 259154417 to extended slice of size 259158513
2025-02-08 16:43:42,340 - WARNING - Processing completed with errors

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #56 on: February 10, 2025, 12:22:10 PM »
Hi if_then_else,
Thanks for your work on this tool! It is much appreciated...
I tried the *.exe over the weekend on a gig from 2017 of which I had the mixing desk recording and an audience recording. Unfortunately the program reported an error at the end, when merging the mono tracks to a stereo wav file for the mixing desk recording. However, the mono-tracks were still there in the output folder, so I still had high hopes. After loading the stereo output audience recording and the two mono output mixing desk tracks into Audition, I noticed they were not very well in sync. The original input files were ~20s out of sync, the mono 'alligned files' were still ~120ms and ~50ms out of sync. Of course it was very nice that it more or less alligned them, but the remaining mismatch is too much to be usable. Any idea what the issue here is? Are the recordings too different for the algorithm to do a more accurate allignment?

I'll add a screenshot of the result and the logging... Thanks again!
Quote
.\trackalign.exe -i in -r aud.wav -t temp -o out

2025-02-08 16:10:41,809 - INFO - Logging system initialized. Full log at out\alignment.log
2025-02-08 16:13:26,608 - INFO - Split stereo file 'in\aud.WAV' into:
2025-02-08 16:13:26,608 - INFO -   - Left channel: 'temp\aud_L.wav'
2025-02-08 16:13:26,608 - INFO -   - Right channel: 'temp\aud_R.wav'
2025-02-08 16:15:51,392 - INFO - Using stereo reference channels independently
2025-02-08 16:21:42,813 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:21:42,813 - INFO - Aligning matches
2025-02-08 16:21:42,813 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:21:42,813 - INFO - Aligning matches
2025-02-08 16:21:42,814 - INFO - No matches detected
2025-02-08 16:21:42,814 - INFO - 0 out of 1 found and aligned
2025-02-08 16:26:28,959 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:26:28,968 - INFO - Aligning matches
2025-02-08 16:26:28,968 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:26:28,968 - INFO - Aligning matches
2025-02-08 16:26:28,969 - INFO - No matches detected
2025-02-08 16:26:28,969 - INFO - 0 out of 1 found and aligned
2025-02-08 16:29:00,523 - INFO - Split stereo file 'in\mx.WAV' into:
2025-02-08 16:29:00,523 - INFO -   - Left channel: 'temp\mx_L.wav'
2025-02-08 16:29:00,523 - INFO -   - Right channel: 'temp\mx_R.wav'
2025-02-08 16:31:30,948 - INFO - Using stereo reference channels independently
2025-02-08 16:37:49,428 - INFO - aud_L.wav: Finding Matches...
2025-02-08 16:37:50,860 - INFO - Aligning matches
2025-02-08 16:37:51,429 - INFO - mx_L.wav: Finding Matches...
2025-02-08 16:37:52,353 - INFO - Aligning matches
2025-02-08 16:38:05,107 - INFO - Writing out\aud_L._L_aligned.wav
2025-02-08 16:38:05,527 - INFO - Writing out\mx_L._L_aligned.wav
2025-02-08 16:38:10,992 - INFO - Writing out\total._L_aligned.wav
2025-02-08 16:38:11,459 - INFO - 2 out of 2 found and aligned
2025-02-08 16:38:11,459 - INFO - Total fingerprints: 4171050
2025-02-08 16:43:15,120 - INFO - aud_R.wav: Finding Matches...
2025-02-08 16:43:16,153 - INFO - Aligning matches
2025-02-08 16:43:16,684 - INFO - mx_R.wav: Finding Matches...
2025-02-08 16:43:18,160 - INFO - Aligning matches
2025-02-08 16:43:30,448 - INFO - Writing out\aud_R._R_aligned.wav
2025-02-08 16:43:30,873 - INFO - Writing out\mx_R._R_aligned.wav
2025-02-08 16:43:36,293 - INFO - Writing out\total._R_aligned.wav
2025-02-08 16:43:36,761 - INFO - 2 out of 2 found and aligned
2025-02-08 16:43:36,762 - INFO - Total fingerprints: 8284363
2025-02-08 16:43:37,565 - INFO - Renamed 'aud_L._L_aligned.wav' to 'aud_L_aligned.wav'.
2025-02-08 16:43:37,565 - INFO - Renamed 'aud_R._R_aligned.wav' to 'aud_R_aligned.wav'.
2025-02-08 16:43:37,566 - INFO - Renamed 'mx_L._L_aligned.wav' to 'mx_L_aligned.wav'.
2025-02-08 16:43:37,566 - INFO - Renamed 'mx_R._R_aligned.wav' to 'mx_R_aligned.wav'.
2025-02-08 16:43:41,200 - INFO - Merged 'out\aud_L_aligned.wav' and 'out\aud_R_aligned.wav' into stereo file 'out\aud_aligned_stereo.wav'.
2025-02-08 16:43:41,257 - INFO - Deleted intermediate mono files
2025-02-08 16:43:42,250 - ERROR - An error occurred during merging: attempt to assign array of size 259154417 to extended slice of size 259158513
2025-02-08 16:43:42,250 - ERROR - Failed during merging: attempt to assign array of size 259154417 to extended slice of size 259158513
2025-02-08 16:43:42,340 - WARNING - Processing completed with errors

It's difficult to tell without access to the original source files. I know that Audalign supports multiple algorithms. I used "fingerprinting" because it was working fine with the sources I had tried it on. I think "cross-correlation" is more accurate.

I might make the algorithms configurable in a forthcoming version, so that you could chose the one that would work best with your sources.

Would it be possible to share e.g. 5-10 minutes long clips of the original source files to see what might have gone wrong here? (Obviously, the split and aligned mono files were of different lengths, so they couldn't be joint anymore.)

If it's OK for you, let's take it to PM.

Offline TheJez

  • Trade Count: (0)
  • Taperssection Regular
  • **
  • Posts: 203
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #57 on: February 11, 2025, 02:17:31 AM »
If it's OK for you, let's take it to PM.
Will do, thanks...

Offline if_then_else

  • Trade Count: (0)
  • Taperssection Member
  • ***
  • Posts: 497
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #58 on: February 12, 2025, 12:41:57 AM »
I fixed the issue with the missing samples. Will double-check and try out several of the other supported algorithms before posting an updated version after work.

The pydub library appears to have an implicit dependency on ffmpeg or avconv installed locally. I hadn't noticed that as ffmpeg was installed by default on Linux.

Offline TheJez

  • Trade Count: (0)
  • Taperssection Regular
  • **
  • Posts: 203
Re: VST plugins & mixing/mastering workflow in your DAWs
« Reply #59 on: February 12, 2025, 09:53:46 AM »
I fixed the issue with the missing samples. Will double-check and try out several of the other supported algorithms before posting an updated version after work.

The pydub library appears to have an implicit dependency on ffmpeg or avconv installed locally. I hadn't noticed that as ffmpeg was installed by default on Linux.

Thanks... Indeed I had to install an ffmpeg executable along with the tool to make it work. I used the most recent version of ffmpeg for that. Would that be ok? Or will the next executable contain an ffmpeg (or avconv) executable in it?
Maybe the align tool deserves a thread of its own, doesn't it?

 

RSS | Mobile
Page created in 0.055 seconds with 38 queries.
© 2002-2025 Taperssection.com
Powered by SMF