Compare commits

..

5 Commits

Author SHA1 Message Date
Onyx and Iris
66baab1a7a set dual_stream key according to bus enum 2026-01-12 17:27:02 +00:00
Onyx and Iris
0218579ba8 upd bus enum 2026-01-12 17:26:36 +00:00
Onyx and Iris
775455e618 upd bus labels 2026-01-12 15:27:48 +00:00
Onyx and Iris
ebe9af8e56 update outputs for inputs 2026-01-12 15:24:07 +00:00
Onyx and Iris
530fa2ff34 implement gain staging configurations 2026-01-12 15:23:33 +00:00
5 changed files with 63 additions and 42 deletions

View File

@ -39,8 +39,8 @@ label = "Onyx Pc"
A1 = false
A2 = false
A3 = false
A4 = false
A5 = true
A4 = true
A5 = false
B1 = false
B2 = false
B3 = false
@ -57,8 +57,8 @@ label = "Iris Pc"
A1 = false
A2 = false
A3 = false
A4 = false
A5 = true
A4 = true
A5 = false
B1 = false
B2 = false
B3 = false
@ -90,8 +90,8 @@ gate.knob = 0
[strip-5]
label = "System"
A1 = false
A2 = true
A1 = true
A2 = false
A3 = false
A4 = false
A5 = false
@ -107,8 +107,8 @@ limit = 0
[strip-6]
label = "Comms"
A1 = false
A2 = false
A3 = true
A2 = true
A3 = false
A4 = false
A5 = false
B1 = false
@ -125,8 +125,8 @@ k = 0
label = "Pretzel"
A1 = false
A2 = false
A3 = false
A4 = true
A3 = true
A4 = false
A5 = false
B1 = false
B2 = false
@ -138,14 +138,6 @@ gain = 0.0
limit = 0
[bus-0]
label = "MR18"
mono = false
eq.on = false
mute = false
gain = 0.0
mode = "normal"
[bus-1]
label = "System"
mono = false
eq.on = false
@ -153,7 +145,7 @@ mute = false
gain = 0.0
mode = "normal"
[bus-2]
[bus-1]
label = "Comms"
mono = false
eq.on = false
@ -161,7 +153,7 @@ mute = false
gain = 0.0
mode = "normal"
[bus-3]
[bus-2]
label = "Pretzel"
mono = false
eq.on = false
@ -169,7 +161,7 @@ mute = false
gain = 0.0
mode = "normal"
[bus-4]
[bus-3]
label = "GAME PCs"
mono = false
eq.on = false
@ -177,6 +169,14 @@ mute = false
gain = 0.0
mode = "normal"
[bus-4]
label = ""
mono = false
eq.on = false
mute = false
gain = 0.0
mode = "normal"
[bus-5]
label = "Onyx Mic"
mono = false

View File

@ -15,9 +15,6 @@ logger = logging.getLogger(__name__)
class Audio(ILayer):
"""Audio concrete class"""
DCM8_MAX_GAIN = 20 # SE Electronics DCM8 max gain
TLM102_MAX_GAIN = 30 # Neumann TLM102 max gain
def __init__(self, duckypad, **kwargs):
super().__init__(duckypad)
for attr, val in kwargs.items():
@ -186,37 +183,51 @@ class Audio(ILayer):
@ensure_mixer_fadeout
def stage_onyx_mic(self):
"""Gain stage SE Electronics DCM8 with phantom power"""
self.mixer.headamp[XAirStrips.onyx_mic].phantom = True
for i in range(Audio.DCM8_MAX_GAIN + 1):
"""Gain stage onyx mic"""
config = configuration.mic('onyx')
self.mixer.headamp[XAirStrips.onyx_mic].phantom = config['phantom']
for i in range(config['gain'] + 1):
self.mixer.headamp[XAirStrips.onyx_mic].gain = i
time.sleep(0.1)
self.logger.info('Onyx Mic Staged with Phantom Power')
@ensure_mixer_fadeout
def stage_iris_mic(self):
"""Gain stage TLM102 with phantom power"""
self.mixer.headamp[XAirStrips.iris_mic].phantom = True
for i in range(Audio.TLM102_MAX_GAIN + 1):
"""Gain stage iris mic"""
config = configuration.mic('iris')
self.mixer.headamp[XAirStrips.iris_mic].phantom = config['phantom']
for i in range(config['gain'] + 1):
self.mixer.headamp[XAirStrips.iris_mic].gain = i
time.sleep(0.1)
self.logger.info('Iris Mic Staged with Phantom Power')
def unstage_onyx_mic(self):
"""Unstage SE Electronics DCM8 and disable phantom power"""
for i in reversed(range(Audio.DCM8_MAX_GAIN + 1)):
"""Unstage onyx mic, if phantom power was enabled, disable it"""
config = configuration.mic('onyx')
for i in reversed(range(config['gain'] + 1)):
self.mixer.headamp[XAirStrips.onyx_mic].gain = i
time.sleep(0.1)
self.mixer.headamp[XAirStrips.onyx_mic].phantom = False
self.logger.info('Onyx Mic Unstaged and Phantom Power Disabled')
if config['phantom']:
self.mixer.headamp[XAirStrips.onyx_mic].phantom = False
self.logger.info('Onyx Mic Unstaged and Phantom Power Disabled')
else:
self.logger.info('Onyx Mic Unstaged')
def unstage_iris_mic(self):
"""Unstage TLM102 and disable phantom power"""
for i in reversed(range(Audio.TLM102_MAX_GAIN + 1)):
"""Unstage iris mic, if phantom power was enabled, disable it"""
config = configuration.mic('iris')
for i in reversed(range(config['gain'] + 1)):
self.mixer.headamp[XAirStrips.iris_mic].gain = i
time.sleep(0.1)
self.mixer.headamp[XAirStrips.iris_mic].phantom = False
self.logger.info('Iris Mic Unstaged and Phantom Power Disabled')
if config['phantom']:
self.mixer.headamp[XAirStrips.iris_mic].phantom = False
self.logger.info('Iris Mic Unstaged and Phantom Power Disabled')
else:
self.logger.info('Iris Mic Unstaged')
def patch_onyx(self):
self.state.patch_onyx = not self.state.patch_onyx

View File

@ -18,3 +18,14 @@ with open(configpath, 'rb') as f:
def get(name):
if name in configuration:
return configuration[name]
def mic(name):
assert 'microphones' in configuration, 'No microphones defined in configuration'
try:
mic_key = configuration['microphones'][name]
mic_cfg = configuration['microphone'][mic_key]
return mic_cfg
except KeyError as e:
raise KeyError(f'Microphone configuration for "{name}" not found') from e

View File

@ -6,7 +6,7 @@ Buttons = IntEnum(
# Voicemeeter Channels
VMStrips = IntEnum('Strips', 'onyx_mic iris_mic onyx_pc iris_pc st_input_5 system comms pretzel', start=0)
VMBuses = IntEnum('Buses', 'system comms pretzel game_pcs onyx_mic iris_mic both_mics', start=1)
VMBuses = IntEnum('Buses', 'system comms pretzel game_pcs output_5 onyx_mic iris_mic both_mics', start=0)
# VBAN Channels
VBANChannels = IntEnum('VBANChannels', 'onyx_mic iris_mic comms workstation', start=0)

View File

@ -1,6 +1,6 @@
import logging
from .enums import VMStrips
from .enums import VMBuses, VMStrips
from .layer import ILayer
from .states import SceneState
@ -40,8 +40,7 @@ class Scene(ILayer):
def dual_stream(self):
ENABLE_PC = {
'mute': False,
'A5': True,
'gain': 0,
f'A{VMBuses.game_pcs + 1}': True, # Voicemeeter A output is 1-indexed
}
self.vm.strip[VMStrips.onyx_pc].apply(ENABLE_PC)
self.vm.strip[VMStrips.iris_pc].apply(ENABLE_PC)