4 Commits

Author SHA1 Message Date
714d2fc972 pass channel + cell indices to each class
update identifier properties to reflect changes.
2025-06-15 20:03:11 +01:00
c797912458 set cell count to 6 (0 up to 5) 2025-06-15 20:02:08 +01:00
William Young
f702b4feb3 Got rid of error with channels and cells not being subscriptable, but now getting -3 error trying to set eq.channel[0].cell[0].on 2025-06-15 11:48:17 -05:00
William Young
f8f10e358f Initial setup adding classes for channels and cells 2025-06-15 10:43:50 -05:00
4 changed files with 136 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
## About
The purpose of this script is to demonstratehow to utilize the channels and cells that are available as part of the EQ. It should take audio playing in the second virtual strip and then apply a LGF on the first physical at 500 Hz.
## Use
Configured for banana version.
Make sure you are playing audio into the second virtual strip and out of the first physical bus, both channels are unmuted and that you aren't monitoring another mixbus. Then run the script.

View File

@@ -0,0 +1,21 @@
import time
import voicemeeterlib
def main():
KIND_ID = 'banana'
with voicemeeterlib.api(KIND_ID) as vm:
vm.bus[0].eq.on = True
vm.bus[0].eq.channel[0].cell[0].on = True
vm.bus[0].eq.channel[0].cell[0].f = 500
vm.bus[0].eq.channel[0].cell[0].type = 3 # Should correspond to LPF
time.sleep(3)
vm.bus[0].eq.on = False
vm.bus[0].eq.channel[0].cell[0].on = False
vm.bus[0].eq.channel[0].cell[0].f = 50
vm.bus[0].eq.channel[0].cell[0].type = 0
if __name__ == '__main__':
main()

View File

@@ -88,6 +88,24 @@ class Bus(IRemote):
class BusEQ(IRemote): class BusEQ(IRemote):
@classmethod
def make(cls, remote, i):
"""
Factory method for BusEQ.
Returns a BusEQ class.
"""
kls = (cls,)
return type(
'BusEQ',
kls,
{
'channel': tuple(
BusEQCh.make(remote, i, j) for j in range(remote.kind.channels)
)
},
)
@property @property
def identifier(self) -> str: def identifier(self) -> str:
return f'Bus[{self.index}].eq' return f'Bus[{self.index}].eq'
@@ -109,6 +127,85 @@ class BusEQ(IRemote):
self.setter('ab', 1 if val else 0) self.setter('ab', 1 if val else 0)
class BusEQCh(IRemote):
@classmethod
def make(cls, remote, i, j):
"""
Factory method for Bus EQ channel.
Returns a BusEQCh class.
"""
kls = (cls,)
return type(
'BusEQCh',
kls,
{
'cell': tuple(
BusEQChCell(remote, i, j, k) for k in range(remote.kind.cells)
)
},
)
def __init__(self, remote, i, j):
super().__init__(remote, i)
self.channel_index = j
@property
def identifier(self) -> str:
return f'Bus[{self.index}].eq.channel[{self.channel_index}]'
class BusEQChCell(IRemote):
def __init__(self, remote, i, j, k):
super().__init__(remote, i)
self.channel_index = j
self.cell_index = k
@property
def identifier(self) -> str:
return f'Bus[{self.index}].eq.channel[{self.channel_index}].cell[{self.cell_index}]'
@property
def on(self) -> bool:
return self.getter('on') == 1
@on.setter
def on(self, val: bool):
self.setter('on', 1 if val else 0)
@property
def type(self) -> int:
return int(self.getter('type'))
@type.setter
def type(self, val: int):
self.setter('type', val)
@property
def f(self) -> float:
return round(self.getter('f'), 1)
@f.setter
def f(self, val: float):
self.setter('f', val)
@property
def gain(self) -> float:
return round(self.getter('gain'), 1)
@gain.setter
def gain(self, val: float):
self.setter('gain', val)
@property
def q(self) -> float:
return round(self.getter('q'), 1)
@q.setter
def q(self, val: float):
self.setter('q', val)
class PhysicalBus(Bus): class PhysicalBus(Bus):
@classmethod @classmethod
def make(cls, remote, i, kind): def make(cls, remote, i, kind):
@@ -321,7 +418,7 @@ def bus_factory(is_phys_bus, remote, i) -> Union[PhysicalBus, VirtualBus]:
{ {
'levels': BusLevel(remote, i), 'levels': BusLevel(remote, i),
'mode': BUSMODEMIXIN_cls(remote, i), 'mode': BUSMODEMIXIN_cls(remote, i),
'eq': BusEQ(remote, i), 'eq': BusEQ.make(remote, i),
}, },
)(remote, i) )(remote, i)

View File

@@ -31,6 +31,8 @@ class KindMapClass(metaclass=SingletonType):
asio: tuple asio: tuple
insert: int insert: int
composite: int composite: int
channels: int
cells: int
@property @property
def phys_in(self) -> int: def phys_in(self) -> int:
@@ -76,6 +78,8 @@ class BasicMap(KindMapClass):
asio: tuple = (0, 0) asio: tuple = (0, 0)
insert: int = 0 insert: int = 0
composite: int = 0 composite: int = 0
channels: int = 0
cells: int = 0
@dataclass(frozen=True) @dataclass(frozen=True)
@@ -86,6 +90,8 @@ class BananaMap(KindMapClass):
asio: tuple = (6, 8) asio: tuple = (6, 8)
insert: int = 22 insert: int = 22
composite: int = 8 composite: int = 8
channels: int = 9
cells: int = 6
@dataclass(frozen=True) @dataclass(frozen=True)
@@ -96,6 +102,8 @@ class PotatoMap(KindMapClass):
asio: tuple = (10, 8) asio: tuple = (10, 8)
insert: int = 34 insert: int = 34
composite: int = 8 composite: int = 8
channels: int = 9
cells: int = 6
def kind_factory(kind_id): def kind_factory(kind_id):