mirror of
https://github.com/onyx-and-iris/duckypad-twitch.git
synced 2026-03-03 11:29:10 +00:00
Compare commits
No commits in common. "66baab1a7a7f37fc8d28a498bdd69625ba74ec2c" and "5992e25c7971385fb9771b1c05d27588d4c6305c" have entirely different histories.
66baab1a7a
...
5992e25c79
@ -39,8 +39,8 @@ label = "Onyx Pc"
|
||||
A1 = false
|
||||
A2 = false
|
||||
A3 = false
|
||||
A4 = true
|
||||
A5 = false
|
||||
A4 = false
|
||||
A5 = true
|
||||
B1 = false
|
||||
B2 = false
|
||||
B3 = false
|
||||
@ -57,8 +57,8 @@ label = "Iris Pc"
|
||||
A1 = false
|
||||
A2 = false
|
||||
A3 = false
|
||||
A4 = true
|
||||
A5 = false
|
||||
A4 = false
|
||||
A5 = true
|
||||
B1 = false
|
||||
B2 = false
|
||||
B3 = false
|
||||
@ -90,8 +90,8 @@ gate.knob = 0
|
||||
|
||||
[strip-5]
|
||||
label = "System"
|
||||
A1 = true
|
||||
A2 = false
|
||||
A1 = false
|
||||
A2 = true
|
||||
A3 = false
|
||||
A4 = false
|
||||
A5 = false
|
||||
@ -107,8 +107,8 @@ limit = 0
|
||||
[strip-6]
|
||||
label = "Comms"
|
||||
A1 = false
|
||||
A2 = true
|
||||
A3 = false
|
||||
A2 = false
|
||||
A3 = true
|
||||
A4 = false
|
||||
A5 = false
|
||||
B1 = false
|
||||
@ -125,8 +125,8 @@ k = 0
|
||||
label = "Pretzel"
|
||||
A1 = false
|
||||
A2 = false
|
||||
A3 = true
|
||||
A4 = false
|
||||
A3 = false
|
||||
A4 = true
|
||||
A5 = false
|
||||
B1 = false
|
||||
B2 = false
|
||||
@ -138,7 +138,7 @@ gain = 0.0
|
||||
limit = 0
|
||||
|
||||
[bus-0]
|
||||
label = "System"
|
||||
label = "MR18"
|
||||
mono = false
|
||||
eq.on = false
|
||||
mute = false
|
||||
@ -146,7 +146,7 @@ gain = 0.0
|
||||
mode = "normal"
|
||||
|
||||
[bus-1]
|
||||
label = "Comms"
|
||||
label = "System"
|
||||
mono = false
|
||||
eq.on = false
|
||||
mute = false
|
||||
@ -154,7 +154,7 @@ gain = 0.0
|
||||
mode = "normal"
|
||||
|
||||
[bus-2]
|
||||
label = "Pretzel"
|
||||
label = "Comms"
|
||||
mono = false
|
||||
eq.on = false
|
||||
mute = false
|
||||
@ -162,7 +162,7 @@ gain = 0.0
|
||||
mode = "normal"
|
||||
|
||||
[bus-3]
|
||||
label = "GAME PCs"
|
||||
label = "Pretzel"
|
||||
mono = false
|
||||
eq.on = false
|
||||
mute = false
|
||||
@ -170,7 +170,7 @@ gain = 0.0
|
||||
mode = "normal"
|
||||
|
||||
[bus-4]
|
||||
label = ""
|
||||
label = "GAME PCs"
|
||||
mono = false
|
||||
eq.on = false
|
||||
mute = false
|
||||
|
||||
@ -15,6 +15,9 @@ 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():
|
||||
@ -183,51 +186,37 @@ class Audio(ILayer):
|
||||
|
||||
@ensure_mixer_fadeout
|
||||
def stage_onyx_mic(self):
|
||||
"""Gain stage onyx mic"""
|
||||
config = configuration.mic('onyx')
|
||||
|
||||
self.mixer.headamp[XAirStrips.onyx_mic].phantom = config['phantom']
|
||||
for i in range(config['gain'] + 1):
|
||||
"""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):
|
||||
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 iris mic"""
|
||||
config = configuration.mic('iris')
|
||||
|
||||
self.mixer.headamp[XAirStrips.iris_mic].phantom = config['phantom']
|
||||
for i in range(config['gain'] + 1):
|
||||
"""Gain stage TLM102 with phantom power"""
|
||||
self.mixer.headamp[XAirStrips.iris_mic].phantom = True
|
||||
for i in range(Audio.TLM102_MAX_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 onyx mic, if phantom power was enabled, disable it"""
|
||||
config = configuration.mic('onyx')
|
||||
|
||||
for i in reversed(range(config['gain'] + 1)):
|
||||
"""Unstage SE Electronics DCM8 and disable phantom power"""
|
||||
for i in reversed(range(Audio.DCM8_MAX_GAIN + 1)):
|
||||
self.mixer.headamp[XAirStrips.onyx_mic].gain = i
|
||||
time.sleep(0.1)
|
||||
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 iris mic, if phantom power was enabled, disable it"""
|
||||
config = configuration.mic('iris')
|
||||
|
||||
for i in reversed(range(config['gain'] + 1)):
|
||||
"""Unstage TLM102 and disable phantom power"""
|
||||
for i in reversed(range(Audio.TLM102_MAX_GAIN + 1)):
|
||||
self.mixer.headamp[XAirStrips.iris_mic].gain = i
|
||||
time.sleep(0.1)
|
||||
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
|
||||
|
||||
@ -18,14 +18,3 @@ 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
|
||||
|
||||
@ -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 output_5 onyx_mic iris_mic both_mics', start=0)
|
||||
VMBuses = IntEnum('Buses', 'system comms pretzel game_pcs onyx_mic iris_mic both_mics', start=1)
|
||||
|
||||
# VBAN Channels
|
||||
VBANChannels = IntEnum('VBANChannels', 'onyx_mic iris_mic comms workstation', start=0)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
from .enums import VMBuses, VMStrips
|
||||
from .enums import VMStrips
|
||||
from .layer import ILayer
|
||||
from .states import SceneState
|
||||
|
||||
@ -40,7 +40,8 @@ class Scene(ILayer):
|
||||
def dual_stream(self):
|
||||
ENABLE_PC = {
|
||||
'mute': False,
|
||||
f'A{VMBuses.game_pcs + 1}': True, # Voicemeeter A output is 1-indexed
|
||||
'A5': True,
|
||||
'gain': 0,
|
||||
}
|
||||
self.vm.strip[VMStrips.onyx_pc].apply(ENABLE_PC)
|
||||
self.vm.strip[VMStrips.iris_pc].apply(ENABLE_PC)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user