2022-12-15 01:02:24 +00:00
|
|
|
[![Go Reference](https://pkg.go.dev/badge/github.com/onyx-and-iris/voicemeeter.svg)](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter/v2)
|
2022-06-23 10:45:26 +01:00
|
|
|
|
2022-06-22 20:51:25 +01:00
|
|
|
# A Go Wrapper for Voicemeeter API
|
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
This package offers a Go interface for the Voicemeeter Remote C API.
|
|
|
|
|
|
|
|
For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
2022-06-22 20:51:25 +01:00
|
|
|
|
|
|
|
## Tested against
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- Basic 1.0.8.8
|
|
|
|
- Banana 2.0.6.8
|
|
|
|
- Potato 3.0.2.8
|
2022-06-22 20:51:25 +01:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- [Voicemeeter](https://voicemeeter.com/)
|
|
|
|
- Go 1.18 or greater
|
2022-06-30 22:20:18 +01:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-09-29 18:04:13 +01:00
|
|
|
Initialize your own module then `go get`
|
|
|
|
|
|
|
|
```
|
|
|
|
go mod init github.com/x/y
|
2022-12-15 00:52:29 +00:00
|
|
|
go get github.com/onyx-and-iris/voicemeeter/v2
|
2022-09-29 18:04:13 +01:00
|
|
|
```
|
2022-06-30 22:20:18 +01:00
|
|
|
|
|
|
|
## `Use`
|
|
|
|
|
|
|
|
#### `main.go`
|
|
|
|
|
|
|
|
```go
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2022-08-23 03:35:34 +01:00
|
|
|
"log"
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-12-08 10:53:50 +00:00
|
|
|
"github.com/onyx-and-iris/voicemeeter/v2"
|
2022-06-30 22:20:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-09-18 05:36:24 +01:00
|
|
|
vm, err := vmConnect()
|
2022-09-07 20:59:55 +01:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
defer vm.Logout()
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Strip[0].SetLabel("rode podmic")
|
|
|
|
vm.Strip[0].SetMute(true)
|
2022-12-08 10:53:50 +00:00
|
|
|
fmt.Printf("Strip 0 (%s) mute was set to %v\n", vm.Strip[0].Label(), vm.Strip[0].Mute())
|
2022-06-30 22:20:18 +01:00
|
|
|
}
|
2022-09-18 05:36:24 +01:00
|
|
|
|
|
|
|
func vmConnect() (*voicemeeter.Remote, error) {
|
2022-09-29 18:04:13 +01:00
|
|
|
vm, err := voicemeeter.NewRemote("banana", 20)
|
2022-09-18 05:36:24 +01:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
err = vm.Login()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return vm, nil
|
|
|
|
}
|
2022-06-30 22:20:18 +01:00
|
|
|
```
|
|
|
|
|
2022-09-14 16:11:34 +01:00
|
|
|
## `voicemeeter.NewRemote(<kindId>, <delay>)`
|
2022-09-14 16:05:49 +01:00
|
|
|
|
|
|
|
### `kindId`
|
2022-06-30 22:20:18 +01:00
|
|
|
|
|
|
|
Pass the kind of Voicemeeter as an argument. kindId may be:
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `basic`
|
|
|
|
- `banana`
|
|
|
|
- `potato`
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-09-14 16:05:49 +01:00
|
|
|
### `delay`
|
|
|
|
|
|
|
|
Pass a delay in milliseconds to force the getters to wait for dirty parameters to clear.
|
|
|
|
|
2022-12-08 10:53:50 +00:00
|
|
|
Useful if not listening for event updates.
|
2022-09-14 16:05:49 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
## `Remote Type`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Strip`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
[]t_strip slice containing both physicalStrip and virtualStrip types
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Bus`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
[]t_bus slice containing both physicalBus and virtualBus types
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Button`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
[]button slice containing button types, one for each macrobutton
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Command`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
pointer to command type, represents action type functions
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Vban`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
pointer to vban type, containing both vbanInStream and vbanOutStream slices
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Device`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
pointer to device type, represents physical input/output hardware devices
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Recorder`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
pointer to recorder type, represents the recorder
|
|
|
|
|
2022-08-22 22:39:35 +01:00
|
|
|
#### `vm.Midi`
|
|
|
|
|
|
|
|
pointer to midi type, represents a connected midi device
|
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Type()`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
returns the type of Voicemeeter as a string
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Version()`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
returns the version of Voicemeeter as a string
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-08-22 22:39:35 +01:00
|
|
|
#### `vm.GetFloat(<param>)`
|
|
|
|
|
|
|
|
gets a float parameter value
|
|
|
|
|
|
|
|
#### `vm.SetFloat(<param>, <value>)`
|
|
|
|
|
|
|
|
sets a float parameter value eg. vm.SetFloat("strip[0].mute", 1)
|
|
|
|
|
|
|
|
#### `vm.GetString(<param>)`
|
|
|
|
|
|
|
|
gets a string parameter value
|
|
|
|
|
|
|
|
#### `vm.SetString(<param>, <value>)`
|
|
|
|
|
|
|
|
sets a string parameter value eg. vm.SetString("strip[0].label", "podmic")
|
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.SendText(<script>)`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-01 00:01:56 +01:00
|
|
|
sets many parameters in script format eg. ("Strip[0].Mute=1;Bus[3].Gain=3.6")
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Register(o observer)`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
register an observer type as an observer
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Deregister(o observer)`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
deregister an observer type as an observer
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
#### `vm.EventAdd(<events>)`
|
2022-08-22 22:39:35 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
adds a single or multiple events to the pooler. Accepts a string or slice of strings.
|
2022-08-22 22:39:35 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
#### `vm.EventRemove(<events>)`
|
2022-08-22 22:39:35 +01:00
|
|
|
|
2022-10-10 18:51:30 +01:00
|
|
|
removes a single or multiple events from the pooler. Accepts a string or slice of strings.
|
2022-08-22 22:39:35 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Pdirty()`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-01 00:01:56 +01:00
|
|
|
returns True iff a GUI parameter has changed
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-07-18 16:23:15 +01:00
|
|
|
#### `vm.Mdirty()`
|
2022-07-01 01:41:43 +01:00
|
|
|
|
2022-08-22 22:39:35 +01:00
|
|
|
returns True iff a macrobutton parameter has changed
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-09-14 00:58:05 +01:00
|
|
|
#### `vm.Sync()`
|
|
|
|
|
2022-09-14 16:11:34 +01:00
|
|
|
Use this to force dirty parameters to clear after a delay in milliseconds.
|
2022-09-14 00:58:05 +01:00
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
## `Available commands`
|
|
|
|
|
|
|
|
### Strip
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Mute() bool`
|
|
|
|
- `SetMute(val bool)`
|
|
|
|
- `Mono() bool`
|
|
|
|
- `SetMono(val bool)`
|
|
|
|
- `Solo() bool`
|
|
|
|
- `SetSolo(val bool)`
|
|
|
|
- `Limit() int`
|
|
|
|
- `SetLimit(val int)` from -40 to 12
|
|
|
|
- `Label() string`
|
|
|
|
- `SetLabel(val string)`
|
|
|
|
- `Gain() float64`
|
|
|
|
- `SetGain(val float64)` from -60.0 to 12.0
|
|
|
|
- `Mc() bool`
|
|
|
|
- `SetMc(val bool)`
|
|
|
|
- `Audibility() float64`
|
|
|
|
- `SetAudibility(val float64)` from 0.0 to 10.0
|
|
|
|
- `A1() bool - A5() bool`
|
|
|
|
- `SetA1(val bool) - SetA5(val bool)`
|
|
|
|
- `B1() bool - B3() bool`
|
|
|
|
- `SetB1(val bool) bool - SetB3(val bool) bool`
|
|
|
|
- `AppGain(name string, gain float64)`
|
|
|
|
- `AppMute(name string, val bool)`
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-07-01 00:01:56 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Strip[3].SetGain(3.7)
|
2022-12-08 19:46:56 +00:00
|
|
|
fmt.Println(vm.Strip[0].Label())
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Strip[4].SetA1(true)
|
2022-09-17 03:47:54 +01:00
|
|
|
|
|
|
|
vm.Strip[5].AppGain("Spotify", 0.5)
|
|
|
|
vm.Strip[5].AppMute("Spotify", true)
|
2022-07-01 00:01:56 +01:00
|
|
|
```
|
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
##### Comp
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Comp()`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
|
|
|
The following methods are available
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Knob() float64`
|
|
|
|
- `SetKnob(val float64)` from 0.0 to 10.0
|
|
|
|
- `GainIn() float64`
|
|
|
|
- `SetGainIn(val float64)` from -24.0 to 24.0
|
|
|
|
- `Ratio() float64`
|
|
|
|
- `SetRatio(val float64)` from 1.0 to 8.0
|
|
|
|
- `Threshold() float64`
|
|
|
|
- `SetThreshold(val float64)` from -40.0 to -3.0
|
|
|
|
- `Attack() float64`
|
|
|
|
- `SetAttack(val float64)` from 0.0 to 200.0
|
|
|
|
- `Release() float64`
|
|
|
|
- `SetRelease(val float64)` from 0.0 to 5000.0
|
|
|
|
- `Knee() float64`
|
|
|
|
- `SetKnee(val float64)` from 0.0 to 1.0
|
|
|
|
- `GainOut() float64`
|
|
|
|
- `SetGainOut(val float64)` from -24.0 to 24.0
|
|
|
|
- `MakeUp() bool`
|
|
|
|
- `SetMakeUp(val bool)`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
vm.Strip[3].Comp().SetRatio(3.5)
|
|
|
|
```
|
|
|
|
|
|
|
|
##### Gate
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Gate()`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
|
|
|
The following methods are available
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Knob() float64`
|
|
|
|
- `SetKnob(val float64)` from 0.0 to 10.0
|
|
|
|
- `Threshold() float64`
|
|
|
|
- `SetThreshold(val float64)` from -60.0 to -10.0
|
|
|
|
- `Damping() float64`
|
|
|
|
- `SetDamping(val float64)` from -60.0 to -10.0
|
|
|
|
- `BPSidechain() int`
|
|
|
|
- `SetBPSidechain(val int)` from 100 to 4000
|
|
|
|
- `Attack() float64`
|
|
|
|
- `SetAttack(val float64)` from 0.0 to 1000.0
|
|
|
|
- `Hold() float64`
|
|
|
|
- `SetHold(val float64)` from 0.0 to 5000.0
|
|
|
|
- `Release() float64`
|
|
|
|
- `SetRelease(val float64)` from 0.0 to 5000.0
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
fmt.Println(vm.Strip[4].Gate().Attack())
|
|
|
|
```
|
|
|
|
|
|
|
|
##### Denoiser
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Denoiser()`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
|
|
|
The following methods are available
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Knob() float64`
|
|
|
|
- `SetKnob(val float64)` from 0.0 to 10.0
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
vm.Strip[1].Denoiser().SetKnob(4.2)
|
|
|
|
```
|
|
|
|
|
2022-12-08 19:46:56 +00:00
|
|
|
##### Gainlayer
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Gainlayer()[j]`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Get() float64`
|
|
|
|
- `Set(val float64)`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Strip[6].GainLayer()[3].Set(-13.6)
|
2022-07-01 14:03:01 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
##### Levels
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Levels()`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `PreFader() []float64`
|
|
|
|
- `PostFader() []float64`
|
|
|
|
- `PostMute() []float64`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
fmt.Println(vm.Strip[5].Levels().PreFader())
|
2022-07-01 14:03:01 +01:00
|
|
|
```
|
|
|
|
|
2022-06-30 23:09:45 +01:00
|
|
|
### Bus
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `String() string`
|
|
|
|
- `Mute() bool`
|
|
|
|
- `SetMute(val bool)`
|
|
|
|
- `Mono() bool`
|
|
|
|
- `SetMono(val bool)`
|
|
|
|
- `Label() string`
|
|
|
|
- `SetLabel(val string)`
|
|
|
|
- `Gain() float64`
|
|
|
|
- `SetGain(val float64)` from -60.0 to 12.0
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
example:
|
|
|
|
|
2022-07-01 01:38:34 +01:00
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Bus[3].SetEq(true)
|
2022-12-08 19:46:56 +00:00
|
|
|
fmt.Println(vm.Bus[0].Label())
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
##### Modes
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Bus[i].Mode()`
|
2022-07-01 01:38:34 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-07-01 01:38:34 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `SetNormal(val bool)`
|
|
|
|
- `Normal() bool`
|
|
|
|
- `SetAmix(val bool)`
|
|
|
|
- `Amix() bool`
|
|
|
|
- `SetBmix(val bool)`
|
|
|
|
- `Bmix() bool`
|
|
|
|
- `SetRepeat(val bool)`
|
|
|
|
- `Repeat() bool`
|
|
|
|
- `SetComposite(val bool)`
|
|
|
|
- `Composite() bool`
|
|
|
|
- `SetTvMix(val bool)`
|
|
|
|
- `TvMix() bool`
|
|
|
|
- `SetUpMix21(val bool)`
|
|
|
|
- `UpMix21() bool`
|
|
|
|
- `SetUpMix41(val bool)`
|
|
|
|
- `UpMix41() bool`
|
|
|
|
- `SetUpMix61(val bool)`
|
|
|
|
- `UpMix61() bool`
|
|
|
|
- `SetCenterOnly(val bool)`
|
|
|
|
- `CenterOnly() bool`
|
|
|
|
- `SetLfeOnly(val bool)`
|
|
|
|
- `LfeOnly() bool`
|
|
|
|
- `SetRearOnly(val bool)`
|
|
|
|
- `RearOnly() bool`
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Bus[3].Mode().SetAmix(true)
|
|
|
|
vm.Bus[4].Mode().SetCenterOnly(true)
|
2022-07-01 14:03:01 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
##### Levels
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Bus[i].Levels()`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-07-01 14:03:01 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `All() []float64`
|
2022-07-01 14:03:01 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
fmt.Println(vm.Bus[1].Levels().All())
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
|
|
|
|
2022-09-17 03:47:54 +01:00
|
|
|
### Strip | Bus
|
|
|
|
|
2022-12-09 01:17:16 +00:00
|
|
|
##### EQ
|
2022-12-08 19:46:56 +00:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Strip[i].Eq()` `vm.Bus[i].Eq()`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
|
|
|
The following methods are available.
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `On() bool`
|
|
|
|
- `SetOn(val bool)`
|
|
|
|
- `Ab() bool`
|
|
|
|
- `SetAb(val bool)`
|
2022-12-08 19:46:56 +00:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
vm.Strip[1].Eq().SetOn(true)
|
|
|
|
fmt.Println(vm.Bus[3].Eq().Ab())
|
|
|
|
```
|
|
|
|
|
2022-09-17 03:47:54 +01:00
|
|
|
The following methods are available.
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `FadeTo(target float64, time_ int)`: float, int
|
|
|
|
- `FadeBy(change float64, time_ int)`: float, int
|
2022-09-17 03:47:54 +01:00
|
|
|
|
|
|
|
Modify gain to or by the selected amount in db over a time interval in ms.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
vm.Strip[3].FadeBy(-8.3, 500)
|
|
|
|
vm.Bus[3].FadeTo(-12.8, 500)
|
|
|
|
```
|
|
|
|
|
2022-06-30 23:09:45 +01:00
|
|
|
### Button
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `State() bool`
|
|
|
|
- `SetState(val bool)`
|
|
|
|
- `StateOnly() bool`
|
|
|
|
- `SetStateOnly(val bool)`
|
|
|
|
- `Trigger() bool`
|
|
|
|
- `SetTrigger(val bool)`
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2022-07-01 01:38:34 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Button[37].SetState(true)
|
2022-12-08 19:46:56 +00:00
|
|
|
fmt.Println(vm.Button[64].StateOnly())
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
|
|
|
|
2022-06-30 23:09:45 +01:00
|
|
|
### Command
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Show()` Show Voicemeeter GUI if it's hidden
|
|
|
|
- `Hide()` Hide Voicemeeter GUI if it's shown
|
|
|
|
- `Shutdown()` Shuts down the GUI
|
|
|
|
- `Restart()` Restart the audio engine
|
|
|
|
- `Lock(val bool)` Lock the Voicemeeter GUI
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Command.Restart()
|
|
|
|
vm.Command.Show()
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
2022-06-30 23:09:45 +01:00
|
|
|
|
|
|
|
### VBAN
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Vban.Enable()` `vm.Vban.Disable()` Turn VBAN on or off
|
2022-06-30 23:09:45 +01:00
|
|
|
|
|
|
|
##### Instream | Outstream
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `vm.Vban.InStream[i]` `vm.Vban.OutStream[i]`
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `On() bool`
|
|
|
|
- `SetOn(val bool)`
|
|
|
|
- `Name() string`
|
|
|
|
- `SetName(val string)`
|
|
|
|
- `Ip() string`
|
|
|
|
- `SetIp(val string)`
|
|
|
|
- `Port() int`
|
|
|
|
- `SetPort(val int)` from 1024 to 65535
|
|
|
|
- `Sr() int`
|
|
|
|
- `SetSr(val int)` (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
|
|
|
|
- `Channel() int`
|
|
|
|
- `SetChannel(val int)` from 1 to 8
|
|
|
|
- `Bit() int`
|
|
|
|
- `SetBit(val int)` 16 or 24
|
|
|
|
- `Quality() int`
|
|
|
|
- `SetQuality(val int)` from 0 to 4
|
|
|
|
- `Route() int`
|
|
|
|
- `SetRoute(val int)` from 0 to 8
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2022-07-01 01:38:34 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
# turn VBAN on
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Vban.Enable()
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
// turn on vban instream 0
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Vban.InStream[0].SetOn(true)
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
// set bit property for outstream 3 to 24
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Vban.OutStream[3].SetBit(24)
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
|
|
|
|
2022-06-30 23:09:45 +01:00
|
|
|
### Device
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Ins()`
|
|
|
|
- `Outs()`
|
|
|
|
- `Input(val int)`
|
|
|
|
- `Output(val int)`
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2022-07-01 01:38:34 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
for i := 0; i < int(vm.Device.Ins()); i++ {
|
|
|
|
fmt.Println(vm.Device.Input(i))
|
2022-07-01 01:38:34 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-06-30 23:09:45 +01:00
|
|
|
### Recorder
|
|
|
|
|
2022-07-10 23:08:14 +01:00
|
|
|
The following methods are available
|
2022-06-30 23:09:45 +01:00
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Play()`
|
|
|
|
- `Stop()`
|
|
|
|
- `Pause()`
|
|
|
|
- `Replay()`
|
|
|
|
- `Record()`
|
|
|
|
- `Ff()`
|
|
|
|
- `Rew()`
|
2022-06-30 22:20:18 +01:00
|
|
|
|
2022-07-01 01:38:34 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Recorder.Play()
|
|
|
|
vm.Recorder.Stop()
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
# Enable loop play
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Recorder.Loop(true)
|
2022-07-01 01:38:34 +01:00
|
|
|
|
|
|
|
# Disable recorder out channel B2
|
2022-07-18 16:23:15 +01:00
|
|
|
vm.Recorder.SetB2(false)
|
2022-07-01 01:38:34 +01:00
|
|
|
```
|
|
|
|
|
2022-08-22 22:39:35 +01:00
|
|
|
### Midi
|
|
|
|
|
|
|
|
The following methods are available
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `Channel()` returns the current midi channel
|
|
|
|
- `Current()` returns the most recently pressed midi button
|
|
|
|
- `Get(<button>)` returns the value in cache for the midi button
|
2022-08-22 22:39:35 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
|
|
|
var current = vm.Midi.Current()
|
|
|
|
var val = vm.Midi.Get(current)
|
|
|
|
```
|
|
|
|
|
|
|
|
### Events
|
|
|
|
|
|
|
|
By default level updates are disabled. Any event may be enabled or disabled. The following events exist:
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- `pdirty` parameter updates
|
|
|
|
- `mdirty` macrobutton updates
|
|
|
|
- `midi` midi updates
|
|
|
|
- `ldirty` level updates
|
2022-08-22 22:39:35 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```go
|
2022-10-16 17:24:51 +01:00
|
|
|
events := []string{"ldirty", "mdirty", "pdirty"}
|
2022-08-22 22:39:35 +01:00
|
|
|
|
2022-10-16 17:24:51 +01:00
|
|
|
vm.EventAdd(events...)
|
|
|
|
|
|
|
|
vm.EventRemove(events...)
|
2022-08-22 22:39:35 +01:00
|
|
|
```
|
|
|
|
|
2022-06-30 22:20:18 +01:00
|
|
|
### Run tests
|
|
|
|
|
|
|
|
To run all tests:
|
|
|
|
|
|
|
|
```
|
2022-07-01 14:03:01 +01:00
|
|
|
go test ./...
|
2022-06-30 22:20:18 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
### Official Documentation
|
|
|
|
|
2024-01-03 09:30:57 +00:00
|
|
|
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|