Sync current OBS scene to channel mute state of a Behringer XAir Mixer
Go to file
Onyx and Iris 8d20af2e2c
Add CLI options (#8)
* add cli args --config, --debug and --verbose

load_config() will search for a relevant config file in several dirs

add separate handler methods for mute,unmute and toggle

mapping.toml removed, everything merged into config.toml

* add cli options subsection

* rename event variable to make it clear we're waiting for a stop event (and not some other obs event)

* fix argparse description

* add return None (for type checker)

* fix example in top level docstring

* add shorthand `-c` cli option
2025-01-13 19:00:06 +01:00
.vscode Add CLI options (#8) 2025-01-13 19:00:06 +01:00
__main__.py Add CLI options (#8) 2025-01-13 19:00:06 +01:00
.gitignore Add CLI options (#8) 2025-01-13 19:00:06 +01:00
config.toml Add CLI options (#8) 2025-01-13 19:00:06 +01:00
LICENSE update for websocket v5, obs 28 2022-09-27 09:25:25 +01:00
README.md Add CLI options (#8) 2025-01-13 19:00:06 +01:00
setup.py Add CLI options (#8) 2025-01-13 19:00:06 +01:00

OBS-to-XAir

This is a small script that mutes, unmutes and toggles groups of channels on Behringer XAir Mixers depending on the current scene.

Requirements

Installation

  • First install latest version of Python.

    • Ensure you tick Add Python 3.x to PATH during setup.
  • Download the repository files with git or the green Code button. Then in command prompt:

cd OBS-to-XAir
pip install .

Configuration

  • Configure websocket settings within OBS->Tools->obs-websocket Settings

  • Open the included config.toml, use it to:

    • Set the obs connection info host, port and password

    • Set the mixer's kind_id and ip.

      • Mixer kind_id may be any one of (XR12, XR16, XR18, MR18, X32)
    • Set the scene to channel mapping.

Usage

Simply run the script, there will be confirmation of mixer connection and OBS connection if everything is successful. Switch between the defined scenes.

Closing OBS will stop the script.

CLI options

  • --config: may be a full path to a config file or just a config name.
    • If only a config name is passed the script will look in the following locations, returning the first config found:
      • Current working directory (may be different from script location depending on how you launch the script)
      • In the directory the script is located.
      • user home directory / .config / xair-obs
  • --debug, --verbose: separate logging levels. Debug will produce a lot of logging output.

Further notes

Since this script relies upon two interfaces, obsws-python and xair-api this code can be readily modified to interact with any OBS events and set any xair parameters. Check the README files for each interface for further details.

Compatibility

This script was developed and tested with:

  • OBS 31.0.0
  • obs-websocket 5.5.4
  • A Midas MR18 and an X32 emulator.

Special Thanks

  • Lebaston for the initial implementation of this script.
  • OBS team and the obs-websocket developers.
  • Behringer/Midas for making their mixers programmable!
  • Adem for contributions towards the obsws-python clients.
  • Onyx-and-Iris for contributions towards the obsws-python and xair-api interfaces.