implement {strip}.gate

This commit is contained in:
onyx-and-iris 2026-01-18 17:06:10 +00:00
parent e37dea38b3
commit cc58d1f081
2 changed files with 27 additions and 15 deletions

View File

@ -260,7 +260,7 @@ class CompressorSettings(NamedTuple):
attack_ms: float attack_ms: float
release_ms: float release_ms: float
n_knee: float n_knee: float
comprate: float ratio: float
threshold: float threshold: float
c_enabled: bool c_enabled: bool
makeup: bool makeup: bool
@ -268,9 +268,9 @@ class CompressorSettings(NamedTuple):
class GateSettings(NamedTuple): class GateSettings(NamedTuple):
dBThreshold_in: float threshold_in: float
dBDamping_max: float damping_max: float
BP_Sidechain: bool bp_sidechain: bool
attack_ms: float attack_ms: float
hold_ms: float hold_ms: float
release_ms: float release_ms: float
@ -473,7 +473,7 @@ class VbanVMParamStrip:
attack_ms=round(int.from_bytes(self._COMP_attack_ms, 'little') * 0.1, 2), attack_ms=round(int.from_bytes(self._COMP_attack_ms, 'little') * 0.1, 2),
release_ms=round(int.from_bytes(self._COMP_release_ms, 'little') * 0.1, 2), release_ms=round(int.from_bytes(self._COMP_release_ms, 'little') * 0.1, 2),
n_knee=round(int.from_bytes(self._COMP_n_knee, 'little') * 0.01, 2), n_knee=round(int.from_bytes(self._COMP_n_knee, 'little') * 0.01, 2),
comprate=round(int.from_bytes(self._COMP_comprate, 'little') * 0.01, 2), ratio=round(int.from_bytes(self._COMP_comprate, 'little') * 0.01, 2),
threshold=round( threshold=round(
int.from_bytes(self._COMP_threshold, 'little', signed=True) * 0.01, 2 int.from_bytes(self._COMP_threshold, 'little', signed=True) * 0.01, 2
), ),
@ -487,15 +487,15 @@ class VbanVMParamStrip:
@property @property
def gate(self) -> GateSettings: def gate(self) -> GateSettings:
return GateSettings( return GateSettings(
dBThreshold_in=round( threshold_in=round(
int.from_bytes(self._GATE_dBThreshold_in, 'little', signed=True) * 0.01, int.from_bytes(self._GATE_dBThreshold_in, 'little', signed=True) * 0.01,
2, 2,
), ),
dBDamping_max=round( damping_max=round(
int.from_bytes(self._GATE_dBDamping_max, 'little', signed=True) * 0.01, int.from_bytes(self._GATE_dBDamping_max, 'little', signed=True) * 0.01,
2, 2,
), ),
BP_Sidechain=round( bp_sidechain=round(
int.from_bytes(self._GATE_BP_Sidechain, 'little') * 0.1, 2 int.from_bytes(self._GATE_BP_Sidechain, 'little') * 0.1, 2
), ),
attack_ms=round(int.from_bytes(self._GATE_attack_ms, 'little') * 0.1, 2), attack_ms=round(int.from_bytes(self._GATE_attack_ms, 'little') * 0.1, 2),

View File

@ -115,7 +115,7 @@ class StripComp(IRemote):
def ratio(self) -> float: def ratio(self) -> float:
if self.public_packets[NBS.one] is None: if self.public_packets[NBS.one] is None:
return 0.0 return 0.0
return self.public_packets[NBS.one].strips[self.index].compressor.comprate return self.public_packets[NBS.one].strips[self.index].compressor.ratio
@ratio.setter @ratio.setter
def ratio(self, val: float): def ratio(self, val: float):
@ -199,7 +199,9 @@ class StripGate(IRemote):
@property @property
def threshold(self) -> float: def threshold(self) -> float:
return if self.public_packets[NBS.one] is None:
return 0.0
return self.public_packets[NBS.one].strips[self.index].gate.threshold_in
@threshold.setter @threshold.setter
def threshold(self, val: float): def threshold(self, val: float):
@ -207,7 +209,9 @@ class StripGate(IRemote):
@property @property
def damping(self) -> float: def damping(self) -> float:
return if self.public_packets[NBS.one] is None:
return 0.0
return self.public_packets[NBS.one].strips[self.index].gate.damping_max
@damping.setter @damping.setter
def damping(self, val: float): def damping(self, val: float):
@ -215,7 +219,9 @@ class StripGate(IRemote):
@property @property
def bpsidechain(self) -> int: def bpsidechain(self) -> int:
return if self.public_packets[NBS.one] is None:
return 0
return self.public_packets[NBS.one].strips[self.index].gate.bp_sidechain
@bpsidechain.setter @bpsidechain.setter
def bpsidechain(self, val: int): def bpsidechain(self, val: int):
@ -223,7 +229,9 @@ class StripGate(IRemote):
@property @property
def attack(self) -> float: def attack(self) -> float:
return if self.public_packets[NBS.one] is None:
return 0.0
return self.public_packets[NBS.one].strips[self.index].gate.attack_ms
@attack.setter @attack.setter
def attack(self, val: float): def attack(self, val: float):
@ -231,7 +239,9 @@ class StripGate(IRemote):
@property @property
def hold(self) -> float: def hold(self) -> float:
return if self.public_packets[NBS.one] is None:
return 0.0
return self.public_packets[NBS.one].strips[self.index].gate.hold_ms
@hold.setter @hold.setter
def hold(self, val: float): def hold(self, val: float):
@ -239,7 +249,9 @@ class StripGate(IRemote):
@property @property
def release(self) -> float: def release(self) -> float:
return if self.public_packets[NBS.one] is None:
return 0.0
return self.public_packets[NBS.one].strips[self.index].gate.release_ms
@release.setter @release.setter
def release(self, val: float): def release(self, val: float):