Xkeys XKR-32 for Blackmagic ATEM TVS operation

I have posted some sample Windows PowerShell scripts for controlling the Blackmagic Design ATEM Television Studio (TVS) on GitHub.

The main thing I did with this sample is define the actions for each key in a JSON file. You can store any combination of PowerShell commands for a button or call a function.

The JSON file is loaded into the script and a hash table is created which holds just the key ID and string to evaluate as code.

function LoadXkeys(){
$xkFile = ConvertFrom-Json (get-content "documents\WindowsPowerShell\xkr32.json" -raw)
$Global:xkCommands = @{}
foreach($key in $xkFile.keys){

This means you can edit the JSON file and just re-run the LoadXKeys function to make changes on the fly.

I’ll probably change the format of the JSON file but for now it looks like this:

“keys”: [
“Type”: “Script”,
“KeyID”: 0,
“Command”: ” “,
“Script”: “$ActiveME.Program=1”,
“Caption”: “Prog 1”,
“Description”: “CUT”
“Type”: “Script”,
“KeyID”: 1,
“Command”: ” “,
“Script”: “if($Global:KeypadMode -eq \”\”){$ActiveME.Preview=1} else {keypad 1}”,
“Caption”: “Prev 1”,
“Description”: “ME1 Auto Transition”

You can find the full code here https://gist.github.com/imorrish/f8a2b6aba612e310169dc7b4da0ac9d9

The bottom row of buttons function as preview selection by default but if you select Macro or Color then the bottom row allows selecting a macro from 1-10 or one of 10 predefined colors (ROYGBIV, White, Grey, Black in that order).

If MP1 or MP2 is already on preview, selecting it again then lets you pick the slot from the media pool to load into the currently previewed media player.

I did get a few ideas from the new TVS HD panel so might make an expanded version of this with only preview selection and making 1-20 for data input.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s