Strip compressor/limiter DSP, add per-channel pre-fader gain, PFL/HP blend, LUFS metering from external port, MIDI gain binding
This commit is contained in:
@@ -186,6 +186,7 @@ class RadioPanelWindow(QMainWindow):
|
||||
|
||||
state = {
|
||||
'window_size': (self.width(), self.height()),
|
||||
'pfl_hp_blend': self.engine.mixer['master'].pfl_hp_blend,
|
||||
'channels': [],
|
||||
}
|
||||
|
||||
@@ -193,6 +194,7 @@ class RadioPanelWindow(QMainWindow):
|
||||
state['channels'].append({
|
||||
'name': ch.name,
|
||||
'volume': ch.volume,
|
||||
'gain': ch.gain,
|
||||
'muted': ch.muted,
|
||||
'pfl': ch.pfl,
|
||||
'mic_on': ch.mic_on,
|
||||
@@ -218,11 +220,16 @@ class RadioPanelWindow(QMainWindow):
|
||||
if ws:
|
||||
self.resize(ws[0], ws[1])
|
||||
|
||||
pfl_hp_blend = state.get('pfl_hp_blend')
|
||||
if pfl_hp_blend is not None:
|
||||
self.engine.mixer['master'].pfl_hp_blend = pfl_hp_blend
|
||||
|
||||
for i, ch_state in enumerate(state.get('channels', [])):
|
||||
if i < len(self.engine.mixer['channels']):
|
||||
ch = self.engine.mixer['channels'][i]
|
||||
ch.name = ch_state.get('name', ch.name)
|
||||
ch.volume = ch_state.get('volume', ch.volume)
|
||||
ch.gain = ch_state.get('gain', ch.gain)
|
||||
ch.muted = ch_state.get('muted', ch.muted)
|
||||
ch.solo = ch_state.get('solo', ch.solo)
|
||||
ch.pfl = ch_state.get('pfl', ch.pfl)
|
||||
@@ -242,6 +249,7 @@ class RadioPanelWindow(QMainWindow):
|
||||
self.midi.mixer_pfl.connect(self._on_midi_mixer_pfl)
|
||||
self.midi.mixer_mic_on.connect(self._on_midi_mixer_mic_on)
|
||||
self.midi.mixer_mic_on.connect(self._on_midi_mixer_mic_on)
|
||||
self.midi.mixer_gain.connect(self._on_midi_mixer_gain)
|
||||
self.midi.master_control.connect(self._on_midi_master_control)
|
||||
self.midi.master_volume.connect(self._on_midi_master_volume)
|
||||
self.midi.controller_connected.connect(self._on_midi_status)
|
||||
@@ -291,24 +299,12 @@ class RadioPanelWindow(QMainWindow):
|
||||
if channel < 2:
|
||||
self.engine.set_channel_mic_on(channel, on)
|
||||
|
||||
def _on_midi_mixer_gain(self, channel: int, gain: float):
|
||||
self.engine.set_channel_gain(channel, gain)
|
||||
|
||||
def _on_midi_master_control(self, knob: str, val: float):
|
||||
master = self.engine.mixer['master']
|
||||
attrs = {
|
||||
"threshold_db": (-60, 0),
|
||||
"ratio": (1, 20),
|
||||
"attack_ms": (0.1, 50),
|
||||
"release_ms": (10, 1000),
|
||||
"makeup_gain_db": (0, 24),
|
||||
"ceiling_db": (-10, 0),
|
||||
}
|
||||
if knob in attrs:
|
||||
lo, hi = attrs[knob]
|
||||
v = lo + val * (hi - lo)
|
||||
if knob == "ratio":
|
||||
v = round(max(1, v), 1)
|
||||
elif knob in ("threshold_db", "ceiling_db", "makeup_gain_db"):
|
||||
v = round(max(lo, min(hi, v)), 1)
|
||||
setattr(master.compressor if knob != "ceiling_db" else master.limiter, knob, v)
|
||||
if knob == "pfl_hp_blend":
|
||||
self.engine.mixer['master'].pfl_hp_blend = max(0.0, min(1.0, val))
|
||||
|
||||
def _on_midi_master_volume(self, val: float):
|
||||
self.engine.mixer['master'].volume = max(0.0, min(1.0, val))
|
||||
|
||||
Reference in New Issue
Block a user