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 !