Any experienced hands here knows of a "Audio Channel Script"?

Steve_Rhoden wrote on 10/3/2023, 8:23 AM

A script that simply changes the Channel of a selected audio event to say : "Combine, Both, Right Only, Left Only or Swap?

Comments

rraud wrote on 10/3/2023, 9:47 AM

I am aware of the fast/easy right-click audio event and channel switches commands, but not a script to change multiples.

jetdv wrote on 10/3/2023, 9:52 AM

That can be done. My tutorials show how to access that information. It really is very easy to just right-click and choose "Channels", though. What, exactly, are you looking for?

Steve_Rhoden wrote on 10/3/2023, 10:20 AM

@jetdv @rraud I know the right clicking and scrolling method..... But my specific request is due to how i have my personal workflow in Vegas set up when doing face paced edits when working simultaneously on TV & Radio Spots, Audio Edits + Mastering etc.... Scripting is just so much more streamlined to work with, with a simple click that allows me to complete my edits a tad bit faster for waiting clients..... Man, tried creating one myself earlier but no darn luck.lol.....Was even trying to create one where when you press the script, it easily toggles between "Combine, Both, Right Only, Left Only and Swap", that was even a greater failure lol.

jetdv wrote on 10/3/2023, 2:53 PM

You might try this as your base:
 

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            Vegas myVegas = vegas;

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                foreach(TrackEvent evnt in myTrack.Events)
                {
                    if (evnt.Selected && evnt.IsAudio())
                    {
                        AudioEvent aevnt = (AudioEvent)evnt;

                        aevnt.Channels = ChannelRemapping.DisableLeft;
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    //public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

Here's the various remapping options:

And see here to see how I toggled between the four different rotation options. You can do something similar to toggle through the remapping options.

Steve_Rhoden wrote on 10/3/2023, 4:30 PM

@jetdv Thank you so much again Edward.... Exactly what i was looking for. 👍

Steve_Rhoden wrote on 10/4/2023, 6:59 AM

@jetdv Only thing, i cant get it to toggle or cycle thru the options.... But otherwise, excellent !

jetdv wrote on 10/4/2023, 8:37 AM

@Steve_Rhoden change the middle part to this:
 

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    if (evnt.Selected && evnt.IsAudio())
                    {
                        AudioEvent aevnt = (AudioEvent)evnt;

                        ChannelRemapping rm = aevnt.Channels;

                        if (rm == ChannelRemapping.None)
                            aevnt.Channels = ChannelRemapping.DisableLeft;
                        else if (rm == ChannelRemapping.DisableLeft)
                            aevnt.Channels = ChannelRemapping.DisableRight;
                        else if (rm == ChannelRemapping.DisableRight)
                            aevnt.Channels = ChannelRemapping.Mono;
                        else if (rm == ChannelRemapping.Mono)
                            aevnt.Channels = ChannelRemapping.MuteLeft;
                        else if (rm == ChannelRemapping.MuteLeft)
                            aevnt.Channels = ChannelRemapping.MuteRight;
                        else if (rm == ChannelRemapping.MuteRight)
                            aevnt.Channels = ChannelRemapping.Swap;
                    }
                }
            }

 

Steve_Rhoden wrote on 10/4/2023, 9:47 AM

@jetdv You're an excellent Guru in this field and a massive support in this Vegas Pro realm 🙌 ..... Thank you !

 

Gid wrote on 5/27/2025, 10:09 PM

@jetdv Excellent, thankyou once again,

I have a bunch of clips made in 2022 with my old phone, the microphone was failing & recording poorly on one channel. I've had this problem for yrs, my machines tend to kill phone microphones, that's not something I'm looking to solve, it is what it is. The easiest fix for this I right click - Combine, this 'balances' the audio, I don't need true stereo & as it renders in stereo my viewers still get an even audio level on the headphones etc. So the rendering out part is irrelevant.

I changed the option to Mono on your first script above as you showed, this one below for anyone interested changes all selected from Both to Combine. That's all I need, thanks again 👍

 

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            Vegas myVegas = vegas;

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                foreach(TrackEvent evnt in myTrack.Events)
                {
                    if (evnt.Selected && evnt.IsAudio())
                    {
                        AudioEvent aevnt = (AudioEvent)evnt;

                        aevnt.Channels = ChannelRemapping.Mono;
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    //public void FromVegas(Vegas vegas, String scriptFile, XmlDocument scriptSettings, ScriptArgs args)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

Last changed by Gid on 5/27/2025, 10:13 PM, changed a total of 1 times.

Vegas Pro 18 - 22
Vegas Pro/Post 19
Boris Continuum & Sapphire, 
Silhouette Standalone + Plugin, 
Mocha Pro Standalone + Plugin, 
Boris Optics,
NewBlue TotalFX
Desktop PC Microsoft Windows 10 Pro - 64-Bit
ASUS PRO WS WRX80E-SAGE SE WIFI AMD Motherboard
AMD Ryzen Threadripper PRO 3975WX 3.5GHz 32 Core
Corsair iCUE H150i RGB PRO XT 360mm All-in-One Liquid CPU Cooler
RAM 256GB ( 8x Micron 32GB (1x 32GB) 2666MHz DDR4 RAM )
2x Western Digital Black SN850 2TB M.2-2280 SSD, 7000MB/s Read, 5100MB/s Write
(programs on one, project files on the other)
Graphics MSI GeForce RTX 3090 SUPRIM X 24GB OC GPU
ASUS ROG Thor 1200W Semi-Modular 80+ Platinum PSU 
Fractal Design Define 7 XL Dark TG Case with 3 Fans
Dell SE3223Q 31.5 Inch 4K UHD (3840x2160) Monitor, 60Hz, & an Acer 24" monitor.

At the moment my filming is done with a Samsung Galaxy S23 Ultra 5G & a GoPro Hero11 Black

I've been a Joiner/Carpenter for 40yrs, apprentice trained time served, I don't have an apprentice of my own so to share my knowledge I put videos on YouTube.

YouTube videos - https://www.youtube.com/c/Gidjoiner