diff --git a/base.go b/base.go index b29615f..170152d 100644 --- a/base.go +++ b/base.go @@ -326,7 +326,8 @@ func getMidiMessage() bool { uintptr(unsafe.Pointer(&b1[0])), uintptr(1024), ) - if int(res) < 0 { + x := int(res) + if x < 0 { err := fmt.Errorf("VBVMR_GetMidiMessage returned %d", res) fmt.Println(err) os.Exit(1) diff --git a/publisher.go b/publisher.go index 9dface9..b3cb83b 100644 --- a/publisher.go +++ b/publisher.go @@ -119,7 +119,7 @@ func (p *pooler) macrobuttons() { func (p *pooler) midi() { for p.run { - if getMidiMessage() { + if p.event.midi && getMidiMessage() { p.notify("midi") } time.Sleep(33 * time.Millisecond)