Package: xair-api
Xair APIThis package offers a python interface for theBehringer XAir,Midas MRseries 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:CHANGELOGPrerequisitesPython 3.10 or greaterInstallationpip install xair-apiUsageConnectionA toml file named config.toml, placed into the current working directory of your code may be used to configure the mixers ip. A validconfig.tomlmay resemble:[connection]ip="<ip address>"Alternatively you may pass it as a keyword argument.Exampleimportxair_apidefmain():kind_id="XR18"ip="<ip address>"withxair_api.connect(kind_id,ip=ip)asmixer:mixer.strip[8].config.name="sm7b"mixer.strip[8].mix.on=Trueprint(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:MR18XR18XR16XR12TheX32is partially supported. However, this document covers specifically theXAirseries.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.APIXAirRemote class (higher level)mixer.lrA class representing Main LR channelmixer.stripA Strip tuple containing a class for each input strip channelmixer.busA Bus tuple containing a class for each output bus channelmixer.dcaA DCA tuple containing a class for each DCA groupmixer.fxAn FX tuple containing a class for each FX channelmixer.fxsendAn FXSend tuple containing a class for each FX Send channelmixer.fxreturnAn FXReturn tuple containing a class for each FX Return channelmixer.auxreturnA class representing auxreturn channelmixer.configA class representing the main config settingsLRContains the subclasses:
(Config,Dyn,Insert,EQ,Mix)StripContains the subclasses:
(Config,Preamp,Gate,Dyn,Insert,GEQ,EQ,Mix,Group,Automix,Send)BusContains the subclasses:
(Config,Dyn,Insert,EQ,Mix,Group)FXSendContains the subclasses:
(Config,Mix,Group)FXRtnContains the subclasses:
(Config,Preamp,EQ,Mix,Group,Send)AuxRtnContains the subclasses:
(Config,Preamp,EQ,Mix,Group,Send)SubclassesFor each subclass the corresponding properties are available.Configname: stringcolor: int, from 0, 16inputsource: intusbreturn: intPreampon: boolusbtrim: float, from -18.0 to 18.0usbinput: boolinvert: boolhighpasson: boolhighpassfilter: int, from 20 to 400Gateon: 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 20000Dynon: 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 20000Inserton: boolsel: intGEQThe following method names preceded byslider_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.0for example:slider_20,slider_6k3etc..EQon: boolmode: str, one of ('peq', 'geq', 'teq')For the subclasses:low,low2,lomid,himid,high2,highthe 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.0for example:eq.low2.typeMixon: boolfader: float, -inf, to 10.0lr: boolGroupdca: int, from 0 to 15mute: int, from 0 to 15Automixgroup: int, from 0 to 2weight: float, from -12.0 to 12.0DCAon: boolname: strcolor: int, from 0 to 15ConfigThe following method names preceded bychlink1_2,3_4,5_6,7_8,9_10,11_12,13_14,15_16The following method names preceded bybuslink1_2,3_4,5_6for example:chlink1_2,buslink5_6etc..link_eq: boollink_dyn: boollink_fader_mute: boolamixenable: boolamixlock: boolFor the subclassmonitorthe following properties are availablelevel: 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: boolfor example:config.monitor.chmodemute_grouptuple containing a class for each mute groupon: bool, from 0 to 3for example:config.mute_group[0].on = TrueSendlevel: float, -inf to 10.0for example:mixer.strip[10].send[3].level = -16.5XAirRemote class (lower level)Send an OSC command directly to the mixersend(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"))Errorserrors.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.TestsUnplug any expensive equipment before running tests.
Save your current settings to a snapshot first.First make sure you installed thedevelopment dependenciesTo run all tests:pytest -v.LicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsDocumentationXAir OSC CommandsX32 OSC CommandsSpecial ThanksPeter Dikantfor writing the base class