Automate Behringer X32 mixers from PowerShell using OSC

Here is a simple example using the OSC DLL with Windows PowerShell to control the Behringer X32 range of audio mixers.

I have tried this with the XR12 but will also work with any of the X Air XR16, XR18 and X32 models.

Sample script showing some basic settings:

# Connection Behringer X32
add-type -path ‘C:\Users\imorrish\OneDrive\PowerShell\OSC\SharpOSC.dll’
$sender = new-object SharpOSC.UDPSender “192.168.1.66”, 10024

#Mute channels 1 – 5
1..5 |% {$message = new-object SharpOSC.OscMessage “/ch/0$($_)/mix/on”, 0;$sender.Send$message)}

#Mute group 1
$message = new-object SharpOSC.OscMessage “/config/mute/1”, 0;
$sender.Send($message)

#Label channel name
$message = new-object SharpOSC.OscMessage “/ch/04/config/name”, “Lead Singer”
$sender.Send($message)

#fade up from 0 (0-1024 max)
1..200 | % {$message = new-object SharpOSC.OscMessage “/ch/04/mix/fader”, ($_ *4); sender.Send($message);Start-Sleep -Milliseconds 1}

It would be easy to use the faders on a midi device like my demo for controlling the ATEM audio levels.

See the following link for all OSC commands that are supported.
http://behringerwiki.music-group.com/index.php?title=OSC_Remote_Protocol#Client_initiated_messages_.28client_.E2.86.92_X32_console.29

And Channel specific controls http://behringerwiki.music-group.com/index.php?title=Channel_(/ch)_data

Snapshot ATEM Mixer settings with PowerShell

This is a work in progress and will be added to ISE as a standard menu to provide selective backup/restore of ATEM settings like the BMD Software Panel but using JSON format rather than XML.

Example snippet of code for the ME properties:

add-type -path ‘C:\Users\imorrish\Documents\WindowsPowerShell\SwitcherLib.dll’
$atem = New-Object SwitcherLib.Switcher(“192.168.1.8”)
$atem.Connect()
$ME = $atem.GetMEs()
$me1SnapShot = $me[0] |select-object -property * -ExcludeProperty “me” | ConvertTo-Json

Which produces the following:

{
    “Program”: 1,
    “Preview”: 1,
    “TransitionStyle”: “Mix”,
    “NextTransitionStyle”: “Mix”,
    “InTransition”: false,
    “TransitionFramesRemaining”: 25,
    “TransitionPosition”: 0,
    “FadeToBlackRate”: 25,
    “InFadeToBlack”: false,
    “FadeToBlackInTransition”: null,
    “FadeToBlackFullyBlack”: false,
    “PreviewLive”: false,
    “PreviewTransition”: false,
    “TransitionSelection”: 1,
    “MixRate”: 25,
    “WipeBorderSize”: 0,
    “WipeBorder”: 2001,
    “WipeReverse”: 0,
    “WipeFlipFlop”: 0,
    “WipeSoftness”: 0,
    “WipeSymmetry”: 0.5,
    “WipeHorizontalOffset”: 0.5,
    “WipeVerticalOffset”: 0.5,
    “TransitionWipePattern”: “DiamondIris”,
    “DVERate”: 25,
    “DVELogoRate”: 25,
    “DVEeReverse”: 0,
    “DVEFlipFlop”: 0,
    “DVETransitionStyle”: “PushRight”,
    “DVEInputFill”: 3010,
    “DVEInputCut”: 3011,
    “DVEEnableKey”: 1,
    “DVEClip”: 0.5,
    “DVEGain”: 0.7,
    “DIPRate”: 25,
    “DIPInput”: 2001,
    “index”: 1
}

I still have to sort out some inconsistencies with properties that should be Boolean and making the internal class private.

ATEM MultiView configuration options updated

Now that I have a Television Studio HD I feel like one of the big boys. I have added the ability to set VU options and routing of inputs to a window of the MultiView.

This means you could in theory do VU follow window via X-Keys. I often have more than 8 inputs to preview so I can assign 2 or more of the windows to toggle between different inputs and enable/disable the VU meters depending on whether they are relevant for the input or not.

$mv=$atem.GetMultiViews()

$mv[0].Layout = “Top”

$mv[0].CanRouteInputs

$mv[0].WindowCount

$mv[0].CanToggleSafeArea

$mv[0].SupportsProgramPreviewSwapp

$mv[0].SafeAreaEnabled=1

$mv[0].ProgramPreviewSwapped=1

$mv[0].VuMeterOpacity=.7

$mv[0].SetVuMeterEnabled(7,2)

$mv[0].SetWindowInput(9,3020) #MP2 in last window

If you have a 2 M/E then $mv[1] would also exist

I have added a GetSwitcherLibVersion method so I can start adding a “requires” function to my scripts and modules.

$atem.GetSwitcherLibVersion() needs to be 2.9.6.0 for the sample above to work.

There is still some inconsistency in the way I have implemented the properties. Some values are bool and some are int 0 or 1 for enabled or disabled settings. Haven’t decided which way I’ll go. The ATEM API is a bit strange, documented properties that are Bool in the API actually output as Int32 in C#

Headset adapter for the TVS HD

The Blackmagic Television Studio HD provide a talkback option but via an aviation standard jack which is 2.06″ rather than the 1/4″ jack used for headphones.
I have 4 or 5 pin XLR headsets so ordered ths adapter from eBay (China).

Update: It arrived. quality is good but headset jack is mono only. From the picture it is hard to tell which is the smaller (microsophone) jack which I thought was the one on the right.

ATEM SuperSource support in PowerShell

I have not been able to test this except for a brief confirmation that the object is returned. I ran out of time while I had access to a 2 M/E so have implemented all the SuperSource methods and properties as per the API.

I should be able to test this and fix any issues next weekend.
Update: GetSuperSourceBox causes a memory error, requires some more work…

#Get the SuperSource (only one - at the moment)
$Supersources = $atem.GetSuperSource()
$Supersource[0] #this will show all properties and methods of SuperShource

$Supersources[0].InputCut = 3011 # MediaPlayer1 Cut
$Supersources[0].InputFill = 3010 #MediaPlayer1 Fill

#Get the SuperSource boxes
$SSBox = $Supersources[0].GetSuperSourceBox()
$SSBox[0] #this will show all methods and properties of the first box

$SSBox[0].InputSource=2
$SSBox[1].InputSource=3
$SSBox[0].Enabled=1
$SSBox[1].Enabled=1 

This dll is called SwitcherLib7b.dll and is available here https://1drv.ms/u/s!ApGpqMMpRLhijpFWeq6R5qMDjb5nXQ
I’m looking forward to creating some demos that show how to move the SuperSource boxes around while they are live

Control ATEM headphone levels from PowerShell

I have been working on a completely new version of the ATEM Switcher Library for PowerShell which supports multiple ATEM’s but that is taking a long time.

The current SwitcherLib has been working fine for me (and others) but with my new TVS HD, I now wanted to be able to control the headphone monitoring and talkback levels from a midi device.

This update requires the 7.0 ATEM software and switcher firmware to be installed.

All values are in DB’s from -66 to + 6. You can get or set the values as shown in the sample code below:


add-type -path '.documents\WindowsPowerShell\SwitcherLib.dll'
$Global:atem = New-Object SwitcherLib.Switcher("192.168.1.8")
$atem.Connect()
#headphone levels
$headphones = $atem.GetHeadphoneOutputs()
$headphone1 = $headphones[0]
$headphone1.HeadphoneGain = -6
$headphone1.HeadphoneProgramOutGain = 0
$headphone1.HeadphoneSidetoneGain
$headphone1.HeadphoneTalkbackGain</span>

Download SwitcherLib7.dll from SwitcherLib7.dll