vban-cmd


Namevban-cmd JSON
Version 2.5.2 PyPI version JSON
download
home_pageNone
SummaryPython interface for the VBAN RT Packet Service (Sendtext)
upload_time2025-01-25 02:06:50
maintainerNone
docs_urlNone
authorOnyx and Iris
requires_python>=3.10
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/vban-cmd.svg)](https://badge.fury.io/py/vban-cmd)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/vban-cmd-python/blob/dev/LICENSE)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![Tests Status](./tests/basic.svg?dummy=8484744)
![Tests Status](./tests/banana.svg?dummy=8484744)
![Tests Status](./tests/potato.svg?dummy=8484744)

# VBAN CMD

This python interface allows you to transmit Voicemeeter parameters over a network.

It may be used standalone or to extend the [Voicemeeter Remote Python API](https://github.com/onyx-and-iris/voicemeeter-api-python)

There is no support for audio transfer in this package, only parameters.

For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)

## Tested against

-   Basic 1.0.8.8
-   Banana 2.0.6.8
-   Potato 3.0.2.8

## Requirements

-   [Voicemeeter](https://voicemeeter.com/)
-   Python 3.10 or greater

## Installation

`pip install vban-cmd`

## `Use`

#### Connection

Load VBAN connection info from toml config. A valid `vban.toml` might look like this:

```toml
[connection]
ip = "gamepc.local"
port = 6980
streamname = "Command1"
```

It should be placed in \<user home directory\> / "Documents" / "Voicemeeter" / "configs"

Alternatively you may pass `ip`, `port`, `streamname` as keyword arguments.

#### `__main__.py`

Simplest use case, use a context manager to request a VbanCmd class of a kind.

Login and logout are handled for you in this scenario.

```python
import vban_cmd


class ManyThings:
    def __init__(self, vban):
        self.vban = vban

    def things(self):
        self.vban.strip[0].label = 'podmic'
        self.vban.strip[0].mute = True
        print(
            f'strip 0 ({self.vban.strip[0].label}) mute has been set to {self.vban.strip[0].mute}'
        )

    def other_things(self):
        self.vban.bus[3].gain = -6.3
        self.vban.bus[4].eq = True
        info = (
            f'bus 3 gain has been set to {self.vban.bus[3].gain}',
            f'bus 4 eq has been set to {self.vban.bus[4].eq}',
        )
        print('\n'.join(info))


def main():
    KIND_ID = 'banana'

    with vban_cmd.api(
        KIND_ID, ip='gamepc.local', port=6980, streamname='Command1'
    ) as vban:
        do = ManyThings(vban)
        do.things()
        do.other_things()

        # set many parameters at once
        vban.apply(
            {
                'strip-2': {'A1': True, 'B1': True, 'gain': -6.0},
                'bus-2': {'mute': True},
                'vban-in-0': {'on': True},
            }
        )


if __name__ == '__main__':
    main()
```

Otherwise you must remember to call `vban.login()`, `vban.logout()` at the start/end of your code.

## `KIND_ID`

Pass the kind of Voicemeeter as an argument. KIND_ID may be:

-   `basic`
-   `banana`
-   `potato`

## `Available commands`

### Strip

The following properties are available.

-   `mono`: boolean
-   `solo`: boolean
-   `mute`: boolean
-   `label`: string
-   `gain`: float, -60 to 12
-   `A1 - A5`, `B1 - B3`: boolean
-   `limit`: int, from -40 to 12

example:

```python
vban.strip[3].gain = 3.7
print(vban.strip[0].label)
```

The following methods are available.

-   `appgain(name, value)`: string, float, from 0.0 to 1.0

Set the gain in db by value for the app matching name.

-   `appmute(name, value)`: string, bool

Set mute state as value for the app matching name.

example:

```python
vban.strip[5].appmute('Spotify', True)
vban.strip[5].appgain('Spotify', 0.5)
```

##### Strip.Comp

The following properties are available.

-   `knob`: float, from 0.0 to 10.0
-   `gainin`: float, from -24.0 to 24.0
-   `ratio`: float, from 1.0 to 8.0
-   `threshold`: float, from -40.0 to -3.0
-   `attack`: float, from 0.0 to 200.0
-   `release`: float, from 0.0 to 5000.0
-   `knee`: float, from 0.0 to 1.0
-   `gainout`: float, from -24.0 to 24.0
-   `makeup`: boolean

example:

```python
print(vban.strip[4].comp.knob)
```

Strip Comp properties are defined as write only.

`knob` defined for all versions, all other parameters potato only.

##### Strip.Gate

The following properties are available.

-   `knob`: float, from 0.0 to 10.0
-   `threshold`: float, from -60.0 to -10.0
-   `damping`: float, from -60.0 to -10.0
-   `bpsidechain`: int, from 100 to 4000
-   `attack`: float, from 0.0 to 1000.0
-   `hold`: float, from 0.0 to 5000.0
-   `release`: float, from 0.0 to 5000.0

example:

```python
vban.strip[2].gate.attack = 300.8
```

Strip Gate properties are defined as write only, potato version only.

`knob` defined for all versions, all other parameters potato only.

##### Strip.Denoiser

The following properties are available.

-   `knob`: float, from 0.0 to 10.0

strip.denoiser properties are defined as write only, potato version only.

##### Strip.EQ

The following properties are available.

-   `on`: boolean
-   `ab`: boolean

Strip EQ properties are defined as write only, potato version only.

##### Gainlayers

-   `gain`: float, from -60.0 to 12.0

example:

```python
vban.strip[3].gainlayer[3].gain = 3.7
```

Gainlayers are defined for potato version only.

##### Levels

The following properties are available.

-   `prefader`

example:

```python
print(vban.strip[3].levels.prefader)
```

Level properties will return -200.0 if no audio detected.

### Bus

The following properties are available.

-   `mono`: boolean
-   `mute`: boolean
-   `label`: string
-   `gain`: float, -60 to 12

example:

```python
print(vban.bus[0].label)
```

##### Bus.EQ

The following properties are available.

-   `on`: boolean
-   `ab`: boolean

```python
vban.bus[4].eq.on = true
```

##### Modes

The following properties are available.

-   `normal`: boolean
-   `amix`: boolean
-   `bmix`: boolean
-   `composite`: boolean
-   `tvmix`: boolean
-   `upmix21`: boolean
-   `upmix41`: boolean
-   `upmix61`: boolean
-   `centeronly`: boolean
-   `lfeonly`: boolean
-   `rearonly`: boolean

The following methods are available.

-   `get()`: Returns the current bus mode

example:

```python
vban.bus[4].mode.amix = True

print(vban.bus[2].mode.get())
```

##### Levels

The following properties are available.

-   `all`

example:

```python
print(vban.bus[0].levels.all)
```

`levels.all` will return -200.0 if no audio detected.

### Strip | Bus

The following methods are available.

-   `fadeto(amount, time)`: float, int
-   `fadeby(amount, time)`: float, int

Modify gain to or by the selected amount in db over a time interval in ms.

example:

```python
vban.strip[0].fadeto(-10.3, 1000)
vban.bus[3].fadeby(-5.6, 500)
```

### Command

Certain 'special' commands are defined by the API as performing actions rather than setting values. The following methods are available:

-   `show()` : Bring Voiceemeter GUI to the front
-   `shutdown()` : Shuts down the GUI
-   `restart()` : Restart the audio engine
-   `reset()`: Applies the `reset` config. (phys strip B1, virt strip A1, gains, comp, gate 0.0, mute, mono, solo, eq false)

The following properties are write only and accept boolean values.

-   `showvbanchat`: boolean
-   `lock`: boolean

example:

```python
vban.command.restart()
vban.command.showvbanchat = true
```

### Multiple parameters

-   `apply`
    Set many strip/bus parameters at once, for example:

```python
vban.apply(
    {
        'strip-0': {'A1': True, 'B1': True, 'gain': -6.0},
        'bus-1': {'mute': True, 'mode': 'composite'},
        'bus-2': {'eq': {'on': True}},
        'vban-in-0': {'on': True},
    }
)
```

Or for each class you may do:

```python
vban.strip[0].apply({'mute': True, 'gain': 3.2, 'A1': True})
vban.vban.outstream[0].apply({'on': True, 'name': 'streamname', 'bit': 24})
```

## Config Files

`vban.apply_config(<configname>)`

You may load config files in TOML format.
Three example configs have been included with the package. Remember to save
current settings before loading a user config. To load one you may do:

```python
import vban_cmd
with vban_cmd.api('banana') as vban:
    vban.apply_config('example')
```

will load a config file at configs/banana/example.toml for Voicemeeter Banana.

Your configs may be located in one of the following paths:
-   \<current working directory\> / "configs" / kind_id
-   \<user home directory\> / ".config" / "vban-cmd" / kind_id
-   \<user home directory\> / "Documents" / "Voicemeeter" / "configs" / kind_id

If a config with the same name is located in multiple locations, only the first one found is loaded into memory, in the above order.

#### `config extends`

You may also load a config that extends another config with overrides or additional parameters.

You just need to define a key `extends` in the config TOML, that names the config to be extended.

Three example 'extender' configs are included with the repo. You may load them with:

```python
import voicemeeterlib
with voicemeeterlib.api('banana') as vm:
    vm.apply_config('extender')
```

## Events

Level updates are considered high volume, by default they are NOT listened for. Use `subs` keyword arg to initialize event updates.

example:

```python
import vban_cmd

opts = {
    'ip': '<ip address>',
    'streamname': 'Command1',
    'port': 6980,
}
with vban_cmd.api('banana', ldirty=True, **opts) as vban:
    ...
```

#### `vban.subject`

Use the Subject class to register an app as event observer.

The following methods are available:

-   `add`: registers an app as an event observer
-   `remove`: deregisters an app as an event observer

example:

```python
# register an app to receive updates
class App():
    def __init__(self, vban):
        vban.subject.add(self)
        ...
```

#### `vban.event`

Use the event class to toggle updates as necessary.

The following properties are available:

-   `pdirty`: boolean
-   `ldirty`: boolean

example:

```python
vban.event.ldirty = True

vban.event.pdirty = False
```

Or add, remove a list of events.

The following methods are available:

-   `add()`
-   `remove()`
-   `get()`

example:

```python
vban.event.remove(['pdirty', 'ldirty'])

# get a list of currently subscribed
print(vban.event.get())
```

## VbanCmd class

`vban_cmd.api(kind_id: str, **opts)`

You may pass the following optional keyword arguments:

-   `ip`: str='localhost', ip or hostname of remote machine
-   `port`: int=6980, vban udp port of remote machine.
-   `streamname`: str='Command1', name of the stream to connect to.
-   `bps`: int=256000, bps rate of the stream.
-   `channel`: int=0, channel on which to send the UDP requests.
-   `pdirty`: boolean=False, parameter updates
-   `ldirty`: boolean=False, level updates
-   `timeout`: int=5, amount of time (seconds) to wait for an incoming RT data packet (parameter states).
-   `outbound`: boolean=False, set `True` if you are only interested in sending commands. (no rt packets will be received)

#### `vban.pdirty`

True iff a parameter has been changed.

#### `vban.ldirty`

True iff a level value has been changed.

#### `vban.sendtext(script)`

Sends a script block as a string request, for example:

```python
vban.sendtext('Strip[0].Mute=1;Bus[0].Mono=1')
```

## Errors

-   `errors.VBANCMDError`: Base VBANCMD Exception class.
-   `errors.VBANCMDConnectionError`: Exception raised when connection/timeout errors occur.

## Logging

It's possible to see the messages sent by the interface's setters and getters, may be useful for debugging.

example:
```python
import vban_cmd

logging.basicConfig(level=logging.DEBUG)

opts = {'ip': 'ip.local', 'port': 6980, 'streamname': 'Command1'}
with vban_cmd.api('banana', **opts) as vban:
    ...
```

## Tests

First make sure you installed the [development dependencies](https://github.com/onyx-and-iris/vban-cmd-python#installation)

Then from tests directory:

`pytest -v`

## Resources

-   [Voicemeeter VBAN TEXT](https://vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf#page=19)

-   [Voicemeeter RT Packet Service](https://vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf#page=27)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vban-cmd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Onyx and Iris",
    "author_email": "code@onyxandiris.online",
    "download_url": "https://files.pythonhosted.org/packages/50/74/0055a71657c19e77333a18f514f57ad9952c721c9e85a2796190f22a5234/vban_cmd-2.5.2.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/vban-cmd.svg)](https://badge.fury.io/py/vban-cmd)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/vban-cmd-python/blob/dev/LICENSE)\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n![Tests Status](./tests/basic.svg?dummy=8484744)\n![Tests Status](./tests/banana.svg?dummy=8484744)\n![Tests Status](./tests/potato.svg?dummy=8484744)\n\n# VBAN CMD\n\nThis python interface allows you to transmit Voicemeeter parameters over a network.\n\nIt may be used standalone or to extend the [Voicemeeter Remote Python API](https://github.com/onyx-and-iris/voicemeeter-api-python)\n\nThere is no support for audio transfer in this package, only parameters.\n\nFor an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)\n\n## Tested against\n\n-   Basic 1.0.8.8\n-   Banana 2.0.6.8\n-   Potato 3.0.2.8\n\n## Requirements\n\n-   [Voicemeeter](https://voicemeeter.com/)\n-   Python 3.10 or greater\n\n## Installation\n\n`pip install vban-cmd`\n\n## `Use`\n\n#### Connection\n\nLoad VBAN connection info from toml config. A valid `vban.toml` might look like this:\n\n```toml\n[connection]\nip = \"gamepc.local\"\nport = 6980\nstreamname = \"Command1\"\n```\n\nIt should be placed in \\<user home directory\\> / \"Documents\" / \"Voicemeeter\" / \"configs\"\n\nAlternatively you may pass `ip`, `port`, `streamname` as keyword arguments.\n\n#### `__main__.py`\n\nSimplest use case, use a context manager to request a VbanCmd class of a kind.\n\nLogin and logout are handled for you in this scenario.\n\n```python\nimport vban_cmd\n\n\nclass ManyThings:\n    def __init__(self, vban):\n        self.vban = vban\n\n    def things(self):\n        self.vban.strip[0].label = 'podmic'\n        self.vban.strip[0].mute = True\n        print(\n            f'strip 0 ({self.vban.strip[0].label}) mute has been set to {self.vban.strip[0].mute}'\n        )\n\n    def other_things(self):\n        self.vban.bus[3].gain = -6.3\n        self.vban.bus[4].eq = True\n        info = (\n            f'bus 3 gain has been set to {self.vban.bus[3].gain}',\n            f'bus 4 eq has been set to {self.vban.bus[4].eq}',\n        )\n        print('\\n'.join(info))\n\n\ndef main():\n    KIND_ID = 'banana'\n\n    with vban_cmd.api(\n        KIND_ID, ip='gamepc.local', port=6980, streamname='Command1'\n    ) as vban:\n        do = ManyThings(vban)\n        do.things()\n        do.other_things()\n\n        # set many parameters at once\n        vban.apply(\n            {\n                'strip-2': {'A1': True, 'B1': True, 'gain': -6.0},\n                'bus-2': {'mute': True},\n                'vban-in-0': {'on': True},\n            }\n        )\n\n\nif __name__ == '__main__':\n    main()\n```\n\nOtherwise you must remember to call `vban.login()`, `vban.logout()` at the start/end of your code.\n\n## `KIND_ID`\n\nPass the kind of Voicemeeter as an argument. KIND_ID may be:\n\n-   `basic`\n-   `banana`\n-   `potato`\n\n## `Available commands`\n\n### Strip\n\nThe following properties are available.\n\n-   `mono`: boolean\n-   `solo`: boolean\n-   `mute`: boolean\n-   `label`: string\n-   `gain`: float, -60 to 12\n-   `A1 - A5`, `B1 - B3`: boolean\n-   `limit`: int, from -40 to 12\n\nexample:\n\n```python\nvban.strip[3].gain = 3.7\nprint(vban.strip[0].label)\n```\n\nThe following methods are available.\n\n-   `appgain(name, value)`: string, float, from 0.0 to 1.0\n\nSet the gain in db by value for the app matching name.\n\n-   `appmute(name, value)`: string, bool\n\nSet mute state as value for the app matching name.\n\nexample:\n\n```python\nvban.strip[5].appmute('Spotify', True)\nvban.strip[5].appgain('Spotify', 0.5)\n```\n\n##### Strip.Comp\n\nThe following properties are available.\n\n-   `knob`: float, from 0.0 to 10.0\n-   `gainin`: float, from -24.0 to 24.0\n-   `ratio`: float, from 1.0 to 8.0\n-   `threshold`: float, from -40.0 to -3.0\n-   `attack`: float, from 0.0 to 200.0\n-   `release`: float, from 0.0 to 5000.0\n-   `knee`: float, from 0.0 to 1.0\n-   `gainout`: float, from -24.0 to 24.0\n-   `makeup`: boolean\n\nexample:\n\n```python\nprint(vban.strip[4].comp.knob)\n```\n\nStrip Comp properties are defined as write only.\n\n`knob` defined for all versions, all other parameters potato only.\n\n##### Strip.Gate\n\nThe following properties are available.\n\n-   `knob`: float, from 0.0 to 10.0\n-   `threshold`: float, from -60.0 to -10.0\n-   `damping`: float, from -60.0 to -10.0\n-   `bpsidechain`: int, from 100 to 4000\n-   `attack`: float, from 0.0 to 1000.0\n-   `hold`: float, from 0.0 to 5000.0\n-   `release`: float, from 0.0 to 5000.0\n\nexample:\n\n```python\nvban.strip[2].gate.attack = 300.8\n```\n\nStrip Gate properties are defined as write only, potato version only.\n\n`knob` defined for all versions, all other parameters potato only.\n\n##### Strip.Denoiser\n\nThe following properties are available.\n\n-   `knob`: float, from 0.0 to 10.0\n\nstrip.denoiser properties are defined as write only, potato version only.\n\n##### Strip.EQ\n\nThe following properties are available.\n\n-   `on`: boolean\n-   `ab`: boolean\n\nStrip EQ properties are defined as write only, potato version only.\n\n##### Gainlayers\n\n-   `gain`: float, from -60.0 to 12.0\n\nexample:\n\n```python\nvban.strip[3].gainlayer[3].gain = 3.7\n```\n\nGainlayers are defined for potato version only.\n\n##### Levels\n\nThe following properties are available.\n\n-   `prefader`\n\nexample:\n\n```python\nprint(vban.strip[3].levels.prefader)\n```\n\nLevel properties will return -200.0 if no audio detected.\n\n### Bus\n\nThe following properties are available.\n\n-   `mono`: boolean\n-   `mute`: boolean\n-   `label`: string\n-   `gain`: float, -60 to 12\n\nexample:\n\n```python\nprint(vban.bus[0].label)\n```\n\n##### Bus.EQ\n\nThe following properties are available.\n\n-   `on`: boolean\n-   `ab`: boolean\n\n```python\nvban.bus[4].eq.on = true\n```\n\n##### Modes\n\nThe following properties are available.\n\n-   `normal`: boolean\n-   `amix`: boolean\n-   `bmix`: boolean\n-   `composite`: boolean\n-   `tvmix`: boolean\n-   `upmix21`: boolean\n-   `upmix41`: boolean\n-   `upmix61`: boolean\n-   `centeronly`: boolean\n-   `lfeonly`: boolean\n-   `rearonly`: boolean\n\nThe following methods are available.\n\n-   `get()`: Returns the current bus mode\n\nexample:\n\n```python\nvban.bus[4].mode.amix = True\n\nprint(vban.bus[2].mode.get())\n```\n\n##### Levels\n\nThe following properties are available.\n\n-   `all`\n\nexample:\n\n```python\nprint(vban.bus[0].levels.all)\n```\n\n`levels.all` will return -200.0 if no audio detected.\n\n### Strip | Bus\n\nThe following methods are available.\n\n-   `fadeto(amount, time)`: float, int\n-   `fadeby(amount, time)`: float, int\n\nModify gain to or by the selected amount in db over a time interval in ms.\n\nexample:\n\n```python\nvban.strip[0].fadeto(-10.3, 1000)\nvban.bus[3].fadeby(-5.6, 500)\n```\n\n### Command\n\nCertain 'special' commands are defined by the API as performing actions rather than setting values. The following methods are available:\n\n-   `show()` : Bring Voiceemeter GUI to the front\n-   `shutdown()` : Shuts down the GUI\n-   `restart()` : Restart the audio engine\n-   `reset()`: Applies the `reset` config. (phys strip B1, virt strip A1, gains, comp, gate 0.0, mute, mono, solo, eq false)\n\nThe following properties are write only and accept boolean values.\n\n-   `showvbanchat`: boolean\n-   `lock`: boolean\n\nexample:\n\n```python\nvban.command.restart()\nvban.command.showvbanchat = true\n```\n\n### Multiple parameters\n\n-   `apply`\n    Set many strip/bus parameters at once, for example:\n\n```python\nvban.apply(\n    {\n        'strip-0': {'A1': True, 'B1': True, 'gain': -6.0},\n        'bus-1': {'mute': True, 'mode': 'composite'},\n        'bus-2': {'eq': {'on': True}},\n        'vban-in-0': {'on': True},\n    }\n)\n```\n\nOr for each class you may do:\n\n```python\nvban.strip[0].apply({'mute': True, 'gain': 3.2, 'A1': True})\nvban.vban.outstream[0].apply({'on': True, 'name': 'streamname', 'bit': 24})\n```\n\n## Config Files\n\n`vban.apply_config(<configname>)`\n\nYou may load config files in TOML format.\nThree example configs have been included with the package. Remember to save\ncurrent settings before loading a user config. To load one you may do:\n\n```python\nimport vban_cmd\nwith vban_cmd.api('banana') as vban:\n    vban.apply_config('example')\n```\n\nwill load a config file at configs/banana/example.toml for Voicemeeter Banana.\n\nYour configs may be located in one of the following paths:\n-   \\<current working directory\\> / \"configs\" / kind_id\n-   \\<user home directory\\> / \".config\" / \"vban-cmd\" / kind_id\n-   \\<user home directory\\> / \"Documents\" / \"Voicemeeter\" / \"configs\" / kind_id\n\nIf a config with the same name is located in multiple locations, only the first one found is loaded into memory, in the above order.\n\n#### `config extends`\n\nYou may also load a config that extends another config with overrides or additional parameters.\n\nYou just need to define a key `extends` in the config TOML, that names the config to be extended.\n\nThree example 'extender' configs are included with the repo. You may load them with:\n\n```python\nimport voicemeeterlib\nwith voicemeeterlib.api('banana') as vm:\n    vm.apply_config('extender')\n```\n\n## Events\n\nLevel updates are considered high volume, by default they are NOT listened for. Use `subs` keyword arg to initialize event updates.\n\nexample:\n\n```python\nimport vban_cmd\n\nopts = {\n    'ip': '<ip address>',\n    'streamname': 'Command1',\n    'port': 6980,\n}\nwith vban_cmd.api('banana', ldirty=True, **opts) as vban:\n    ...\n```\n\n#### `vban.subject`\n\nUse the Subject class to register an app as event observer.\n\nThe following methods are available:\n\n-   `add`: registers an app as an event observer\n-   `remove`: deregisters an app as an event observer\n\nexample:\n\n```python\n# register an app to receive updates\nclass App():\n    def __init__(self, vban):\n        vban.subject.add(self)\n        ...\n```\n\n#### `vban.event`\n\nUse the event class to toggle updates as necessary.\n\nThe following properties are available:\n\n-   `pdirty`: boolean\n-   `ldirty`: boolean\n\nexample:\n\n```python\nvban.event.ldirty = True\n\nvban.event.pdirty = False\n```\n\nOr add, remove a list of events.\n\nThe following methods are available:\n\n-   `add()`\n-   `remove()`\n-   `get()`\n\nexample:\n\n```python\nvban.event.remove(['pdirty', 'ldirty'])\n\n# get a list of currently subscribed\nprint(vban.event.get())\n```\n\n## VbanCmd class\n\n`vban_cmd.api(kind_id: str, **opts)`\n\nYou may pass the following optional keyword arguments:\n\n-   `ip`: str='localhost', ip or hostname of remote machine\n-   `port`: int=6980, vban udp port of remote machine.\n-   `streamname`: str='Command1', name of the stream to connect to.\n-   `bps`: int=256000, bps rate of the stream.\n-   `channel`: int=0, channel on which to send the UDP requests.\n-   `pdirty`: boolean=False, parameter updates\n-   `ldirty`: boolean=False, level updates\n-   `timeout`: int=5, amount of time (seconds) to wait for an incoming RT data packet (parameter states).\n-   `outbound`: boolean=False, set `True` if you are only interested in sending commands. (no rt packets will be received)\n\n#### `vban.pdirty`\n\nTrue iff a parameter has been changed.\n\n#### `vban.ldirty`\n\nTrue iff a level value has been changed.\n\n#### `vban.sendtext(script)`\n\nSends a script block as a string request, for example:\n\n```python\nvban.sendtext('Strip[0].Mute=1;Bus[0].Mono=1')\n```\n\n## Errors\n\n-   `errors.VBANCMDError`: Base VBANCMD Exception class.\n-   `errors.VBANCMDConnectionError`: Exception raised when connection/timeout errors occur.\n\n## Logging\n\nIt's possible to see the messages sent by the interface's setters and getters, may be useful for debugging.\n\nexample:\n```python\nimport vban_cmd\n\nlogging.basicConfig(level=logging.DEBUG)\n\nopts = {'ip': 'ip.local', 'port': 6980, 'streamname': 'Command1'}\nwith vban_cmd.api('banana', **opts) as vban:\n    ...\n```\n\n## Tests\n\nFirst make sure you installed the [development dependencies](https://github.com/onyx-and-iris/vban-cmd-python#installation)\n\nThen from tests directory:\n\n`pytest -v`\n\n## Resources\n\n-   [Voicemeeter VBAN TEXT](https://vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf#page=19)\n\n-   [Voicemeeter RT Packet Service](https://vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf#page=27)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python interface for the VBAN RT Packet Service (Sendtext)",
    "version": "2.5.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f08c814a9f5c4a8629388034735b3cdfc70e6c51b70329ee21007274e232087b",
                "md5": "3aa6dbf3665ad32378c1fc44a7169d24",
                "sha256": "751df23ee5b2c10c887d19f515ca59b134e6de4e810ac0a7d02bfe5b2a01854c"
            },
            "downloads": -1,
            "filename": "vban_cmd-2.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3aa6dbf3665ad32378c1fc44a7169d24",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 29270,
            "upload_time": "2025-01-25T02:06:48",
            "upload_time_iso_8601": "2025-01-25T02:06:48.590676Z",
            "url": "https://files.pythonhosted.org/packages/f0/8c/814a9f5c4a8629388034735b3cdfc70e6c51b70329ee21007274e232087b/vban_cmd-2.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "50740055a71657c19e77333a18f514f57ad9952c721c9e85a2796190f22a5234",
                "md5": "8966a34151559ca1f64bb74929aaaab7",
                "sha256": "167be0f1e6a82d34a7e2d62e4c4d7f0919293e1c8e951633b8fa440caf6a8330"
            },
            "downloads": -1,
            "filename": "vban_cmd-2.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "8966a34151559ca1f64bb74929aaaab7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 27149,
            "upload_time": "2025-01-25T02:06:50",
            "upload_time_iso_8601": "2025-01-25T02:06:50.648571Z",
            "url": "https://files.pythonhosted.org/packages/50/74/0055a71657c19e77333a18f514f57ad9952c721c9e85a2796190f22a5234/vban_cmd-2.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-25 02:06:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "vban-cmd"
}
        
Elapsed time: 0.99150s