Xair API
This package offers a python interface for the Behringer XAir, Midas MR series of digital rack mixers. I only have access to an MR18 for testing so if there is an error in the kind maps feel free to raise an issue or PR.
For an outline of past/future changes refer to: CHANGELOG
Prerequisites
- Python 3.10 or greater
Installation
pip install xair-api
Usage
Connection
A toml file named config.toml, placed into the current working directory of your code may be used to configure the mixers ip. A valid config.toml may resemble:
[connection]
ip = "<ip address>"
Alternatively you may pass it as a keyword argument.
Example
import xair_api
def main():
kind_id = 'XR18'
ip = '<ip address>'
with xair_api.connect(kind_id, ip=ip) as mixer:
mixer.strip[8].config.name = 'sm7b'
mixer.strip[8].mix.on = True
print(
f'strip 09 ({mixer.strip[8].config.name}) on has been set to {mixer.strip[8].mix.on}'
)
if __name__ == '__main__':
main()
xair_api.connect(kind_id, ip=ip, delay=0.02, connect_timeout=2)
Currently the following devices are supported:
MR18XR18XR16XR12
The X32 is partially supported. However, this document covers specifically the XAir series.
The following keyword arguments may be passed:
ip: ip address of the mixerport: mixer port, defaults to 10023 for x32 and 10024 for xairdelay: a delay between each command (applies to the getters). Defaults to 20ms.- a note about delay, stability may rely on network connection. For wired connections the delay can be safely reduced.
connect_timeout: amount of time to wait for a validated connection. Defaults to 2s.
API
XAirRemote class (higher level)
mixer.lr
A class representing Main LR channel
mixer.strip
A Strip tuple containing a class for each input strip channel
mixer.bus
A Bus tuple containing a class for each output bus channel
mixer.dca
A DCA tuple containing a class for each DCA group
mixer.fx
An FX tuple containing a class for each FX channel
mixer.fxsend
An FXSend tuple containing a class for each FX Send channel
mixer.fxreturn
An FXReturn tuple containing a class for each FX Return channel
mixer.auxreturn
A class representing auxreturn channel
mixer.config
A class representing the main config settings
mixer.headamp
A class representing the channel preamps (phantom power/gain).
LR
Contains the subclasses:
(Config, Dyn, Insert, EQ, Mix)
Strip
Contains the subclasses:
(Config, Preamp, Gate, Dyn, Insert, GEQ, EQ, Mix, Group, Automix, Send)
Bus
Contains the subclasses:
(Config, Dyn, Insert, EQ, Mix, Group)
FXSend
Contains the subclasses:
(Config, Mix, Group)
FXRtn
Contains the subclasses:
(Config, Preamp, EQ, Mix, Group, Send)
AuxRtn
Contains the subclasses:
(Config, Preamp, EQ, Mix, Group, Send)
HeadAmp
The following properties are available:
gain: float, from -12.0 to 60.0phantom: bool
Subclasses
For each subclass the corresponding properties are available.
Config
name: stringcolor: int, from 0, 16inputsource: intusbreturn: int
Preamp
on: boolusbtrim: float, from -18.0 to 18.0usbinput: boolinvert: boolhighpasson: boolhighpassfilter: int, from 20 to 400
Gate
on: boolmode: str, one of ('gate', 'exp2', 'exp3', 'exp4', 'duck')threshold: float, from -80.0 to 0.0range: int, from 3 to 60attack: int, from 0 to 120hold: float, from 0.02 to 2000release: int, from 5 to 4000keysource, from 0 to 22filteron: boolfiltertype: int, from 0 to 8filterfreq: float, from 20 to 20000
Dyn
on: boolmode: str, one of ('comp', 'exp')det: str, one of ('peak', 'rms')env: str, one of ('lin', 'log')threshold: float, from -60.0 to 0.0ratio: int, from 0 to 11knee: int, from 0 to 5mgain: float, from 0.0 to 24.0attack: int, from 0 to 120hold: float, from 0.02 to 2000release: int, from 5 to 4000mix: int, from 0 to 100keysource: int, from 0 to 22auto: boolfilteron: boolfiltertype: int, from 0 to 8filterfreq: float, from 20 to 20000
Insert
on: boolsel: int
GEQ
The following method names preceded by slider_
20,25,31_5,40,50,63,80,100,125,160,200,250,315,400,500,630,800,1k,1k25,1k6,2k,2k5,3k15,4k,5k,6k3,8k,10k,12k5,16k,20k: float, from -15.0 to 15.0
for example: slider_20, slider_6k3 etc..
EQ
on: boolmode: str, one of ('peq', 'geq', 'teq')
For the subclasses: low, low2, lomid, himid, high2, high the following properties are available:
type: int, from 0 to 5frequency: float, from 20.0 to 20000.0gain: float, -15.0 to 15.0quality: float, from 0.3 to 10.0
for example: eq.low2.type
Mix
on: boolfader: float, -inf, to 10.0lr: bool
Group
dca: int, from 0 to 15mute: int, from 0 to 15
Automix
group: int, from 0 to 2weight: float, from -12.0 to 12.0
DCA
on: boolname: strcolor: int, from 0 to 15
Config
The following method names preceded by chlink
1_2,3_4,5_6,7_8,9_10,11_12,13_14,15_16
The following method names preceded by buslink
1_2,3_4,5_6
for example: chlink1_2, buslink5_6 etc..
link_eq: boollink_dyn: boollink_fader_mute: boolamixenable: boolamixlock: bool
For the subclass monitor the following properties are available
level: float, -inf to 10.0source: int, from 0 to 14sourcetrim: float, from -18.0 to 18.0chmode: boolbusmode: booldim: booldimgain: float, from -40.0 to 0.0mono: boolmute: booldimfpl: bool
for example: config.monitor.chmode
mute_group
tuple containing a class for each mute group
on: bool, from 0 to 3
for example: config.mute_group[0].on = True
Send
level: float, -inf to 10.0
for example: mixer.strip[10].send[3].level = -16.5
XAirRemote class (lower level)
Send an OSC command directly to the mixer
send(osc command, value)
for example:
mixer.send('/ch/01/mix/on', 1)
mixer.send('/bus/2/config/name', 'somename')
Query the value of a command:
query(osc command)
for example:
print(mixer.query('/ch/01/mix/on'))
Errors
errors.XAirRemoteError: Base error class for XAIR Remote.errors.XAirRemoteConnectionTimeoutError:Exception raised when a connection attempt times out.- The following attributes are available:
ip: IP of the mixer.port: Port of the mixer.
- The following attributes are available:
Tests
Install poetry and then:
poetry poe test-xair
poetry poe test-x32
Unplug any expensive equipment and save your current settings to a snapshot first.
License
This project is licensed under the MIT License - see the LICENSE file for details
Documentation
Special Thanks
Peter Dikant for writing the base class
Metadata
Release files for xair-api 2.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xair_api-2.4.3.tar.gz | 16.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xair_api-2.4.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.2 kB
Release files / xair_api-2.4.3.tar.gz
| Download URL | xair_api-2.4.3.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a02c8edb989d767624d99297e7c3e696186026afb992b33e238794e6303dd531
|
|
BLAKE2b-256 checksum How to use checksums |
dfbd03084013b4df6a555065d0118e1c3d20a85046047894ecdaeb15f694f87f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 4, 2026.
Transparency logRelease files / xair_api-2.4.3-py3-none-any.whl
| Download URL | xair_api-2.4.3-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
123df43a5c8d30a810442c8c97c6075ad54675db1aaa9e3547bf3fa5b23cae18
|
|
BLAKE2b-256 checksum How to use checksums |
c112584a6d1acc4e62370d539979b5cdb0b16c5b4e6d2da9fa752a82803b3efa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 4, 2026.
Transparency logSecurity for xair-api 2.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for xair_api-2.4.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.