For an outline of past/future changes refer to: CHANGELOG
- Basic 1.1.1.1
- Banana 2.1.1.1
- Potato 3.1.1.1
- Voicemeeter
- Go 1.18 or greater
Initialize your own module then go get
go mod init github.com/x/y
go get github.com/onyx-and-iris/voicemeeter/v2
package main
import (
"fmt"
"log"
"github.com/onyx-and-iris/voicemeeter/v2"
)
func main() {
vm, err := vmConnect()
if err != nil {
log.Fatal(err)
}
defer vm.Logout()
vm.Strip[0].SetLabel("rode podmic")
vm.Strip[0].SetMute(true)
fmt.Printf("Strip 0 (%s) mute was set to %v\n", vm.Strip[0].Label(), vm.Strip[0].Mute())
}
func vmConnect() (*voicemeeter.Remote, error) {
vm, err := voicemeeter.NewRemote("banana", 20)
if err != nil {
return nil, err
}
err = vm.Login()
if err != nil {
return nil, err
}
return vm, nil
}Pass the kind of Voicemeeter as an argument. kindId may be:
basicbananapotato
Pass a delay in milliseconds to force the getters to wait for dirty parameters to clear.
Useful if not listening for event updates.
Set a login timeout, defaults to 2 seconds. For example to set it to 1s:
voicemeeter.NewRemote("banana", 20, voicemeeter.WithTimeout(1))
Override the type of Voicemeeter GUI to launch on 64 bit systems. For example, to force 32 bit GUI:
voicemeeter.NewRemote("banana", 20, voicemeeter.WithBits(32))
[]t_strip slice containing both physicalStrip and virtualStrip types
[]t_bus slice containing both physicalBus and virtualBus types
[]button slice containing button types, one for each macrobutton
pointer to command type, represents action type functions
pointer to vban type, containing both vbanInStream and vbanOutStream slices
pointer to device type, represents physical input/output hardware devices
pointer to recorder type, represents the recorder
pointer to midi type, represents a connected midi device
returns the type of Voicemeeter as a string
returns the version of Voicemeeter as a string
gets a float parameter value
sets a float parameter value eg. vm.SetFloat("strip[0].mute", 1)
gets a string parameter value
sets a string parameter value eg. vm.SetString("strip[0].label", "podmic")
sets many parameters in script format eg. ("Strip[0].Mute=1;Bus[3].Gain=3.6")
register an observer type as an observer
deregister an observer type as an observer
adds a single or multiple events to the pooler. Accepts a string or slice of strings.
removes a single or multiple events from the pooler. Accepts a string or slice of strings.
returns True iff a GUI parameter has changed
returns True iff a macrobutton parameter has changed
Use this to force dirty parameters to clear after a delay in milliseconds.
The following methods are available
Mute() boolSetMute(val bool)Mono() boolSetMono(val bool)Solo() boolSetSolo(val bool)Limit() intSetLimit(val int)from -40 to 12Label() stringSetLabel(val string)Gain() float64SetGain(val float64)from -60.0 to 12.0Mc() boolSetMc(val bool)Audibility() float64SetAudibility(val float64)from 0.0 to 10.0A1() bool - A5() boolSetA1(val bool) - SetA5(val bool)B1() bool - B3() boolSetB1(val bool) bool - SetB3(val bool) boolAppGain(name string, gain float64)AppMute(name string, val bool)
example:
vm.Strip[3].SetGain(3.7)
fmt.Println(vm.Strip[0].Label())
vm.Strip[4].SetA1(true)
vm.Strip[5].AppGain("Spotify", 0.5)
vm.Strip[5].AppMute("Spotify", true)vm.Strip[i].Comp()
The following methods are available
Knob() float64SetKnob(val float64)from 0.0 to 10.0GainIn() float64SetGainIn(val float64)from -24.0 to 24.0Ratio() float64SetRatio(val float64)from 1.0 to 8.0Threshold() float64SetThreshold(val float64)from -40.0 to -3.0Attack() float64SetAttack(val float64)from 0.0 to 200.0Release() float64SetRelease(val float64)from 0.0 to 5000.0Knee() float64SetKnee(val float64)from 0.0 to 1.0GainOut() float64SetGainOut(val float64)from -24.0 to 24.0MakeUp() boolSetMakeUp(val bool)
example:
vm.Strip[3].Comp().SetRatio(3.5)vm.Strip[i].Gate()
The following methods are available
Knob() float64SetKnob(val float64)from 0.0 to 10.0Threshold() float64SetThreshold(val float64)from -60.0 to -10.0Damping() float64SetDamping(val float64)from -60.0 to -10.0BPSidechain() intSetBPSidechain(val int)from 100 to 4000Attack() float64SetAttack(val float64)from 0.0 to 1000.0Hold() float64SetHold(val float64)from 0.0 to 5000.0Release() float64SetRelease(val float64)from 0.0 to 5000.0
example:
fmt.Println(vm.Strip[4].Gate().Attack())vm.Strip[i].Denoiser()
The following methods are available
Knob() float64SetKnob(val float64)from 0.0 to 10.0
example:
vm.Strip[1].Denoiser().SetKnob(4.2)vm.Strip[i].Gainlayer()[j]
The following methods are available
Get() float64Set(val float64)
example:
vm.Strip[6].GainLayer()[3].Set(-13.6)vm.Strip[i].Levels()
The following methods are available
PreFader() []float64PostFader() []float64PostMute() []float64
example:
fmt.Println(vm.Strip[5].Levels().PreFader())The following methods are available
String() stringMute() boolSetMute(val bool)Mono() boolSetMono(val bool)Label() stringSetLabel(val string)Gain() float64SetGain(val float64)from -60.0 to 12.0
example:
vm.Bus[3].SetEq(true)
fmt.Println(vm.Bus[0].Label())vm.Bus[i].Mode()
The following methods are available
SetNormal(val bool)Normal() boolSetAmix(val bool)Amix() boolSetBmix(val bool)Bmix() boolSetRepeat(val bool)Repeat() boolSetComposite(val bool)Composite() boolSetTvMix(val bool)TvMix() boolSetUpMix21(val bool)UpMix21() boolSetUpMix41(val bool)UpMix41() boolSetUpMix61(val bool)UpMix61() boolSetCenterOnly(val bool)CenterOnly() boolSetLfeOnly(val bool)LfeOnly() boolSetRearOnly(val bool)RearOnly() bool
example:
vm.Bus[3].Mode().SetAmix(true)
vm.Bus[4].Mode().SetCenterOnly(true)vm.Bus[i].Levels()
The following methods are available
All() []float64
example:
fmt.Println(vm.Bus[1].Levels().All())vm.Strip[i].Eq()vm.Bus[i].Eq()
The following methods are available.
On() boolSetOn(val bool)Ab() boolSetAb(val bool)
example:
vm.Strip[1].Eq().SetOn(true)
fmt.Println(vm.Bus[3].Eq().Ab())The following methods are available.
FadeTo(target float64, time_ int): float, intFadeBy(change float64, time_ int): float, int
Modify gain to or by the selected amount in db over a time interval in ms.
example:
vm.Strip[3].FadeBy(-8.3, 500)
vm.Bus[3].FadeTo(-12.8, 500)The following methods are available
State() boolSetState(val bool)StateOnly() boolSetStateOnly(val bool)Trigger() boolSetTrigger(val bool)
example:
vm.Button[37].SetState(true)
fmt.Println(vm.Button[64].StateOnly())The following methods are available
Show()Show Voicemeeter GUI if it's hiddenHide()Hide Voicemeeter GUI if it's shownShutdown()Shuts down the GUIRestart()Restart the audio engineLock(val bool)Lock the Voicemeeter GUI
example:
vm.Command.Restart()
vm.Command.Show()vm.Vban.Enable()vm.Vban.Disable()Turn VBAN on or off
vm.Vban.InStream[i]vm.Vban.OutStream[i]
The following methods are available
On() boolSetOn(val bool)Name() stringSetName(val string)Ip() stringSetIp(val string)Port() intSetPort(val int)from 1024 to 65535Sr() intSetSr(val int)(11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)Channel() intSetChannel(val int)from 1 to 8Bit() intSetBit(val int)16 or 24Quality() intSetQuality(val int)from 0 to 4Route() intSetRoute(val int)from 0 to 8
example:
# turn VBAN on
vm.Vban.Enable()
// turn on vban instream 0
vm.Vban.InStream[0].SetOn(true)
// set bit property for outstream 3 to 24
vm.Vban.OutStream[3].SetBit(24)The following methods are available
Ins()Outs()Input(val int)Output(val int)
example:
for i := 0; i < int(vm.Device.Ins()); i++ {
fmt.Println(vm.Device.Input(i))
}The following methods are available
Play()Stop()Pause()Replay()Record()Ff()Rew()
example:
vm.Recorder.Play()
vm.Recorder.Stop()
# Enable loop play
vm.Recorder.Loop(true)
# Disable recorder out channel B2
vm.Recorder.SetB2(false)The following methods are available
Channel()returns the current midi channelCurrent()returns the most recently pressed midi buttonGet(<button>)returns the value in cache for the midi button
example:
var current = vm.Midi.Current()
var val = vm.Midi.Get(current)By default level updates are disabled. Any event may be enabled or disabled. The following events exist:
pdirtyparameter updatesmdirtymacrobutton updatesmidimidi updatesldirtylevel updates
example:
events := []string{"ldirty", "mdirty", "pdirty"}
vm.EventAdd(events...)
vm.EventRemove(events...)To run all tests:
go test ./...