diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da67a3e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/midi-hid diff --git a/main.go b/main.go index 402ce0e..a993714 100644 --- a/main.go +++ b/main.go @@ -2,7 +2,8 @@ package main import ( "log" - "time" + "os" + "os/signal" "gitlab.com/gomidi/midi/v2" ) @@ -23,5 +24,8 @@ func main() { controllerList := must(config.Construct()) defer controllerList.Stop() - time.Sleep(time.Second * 20) + // wait for SIGINT + sigintChan := make(chan os.Signal, 1) + signal.Notify(sigintChan, os.Interrupt) + <-sigintChan }