schollz/miti

Building on OS X

nzoschke opened this issue · 1 comments

It took me a minute to get this working on OS X / M1 / Golang 1.19.

Apply this diff fixes #18

diff --git a/src/record/record.go b/src/record/record.go
index 86c31e0..40ab77e 100644
--- a/src/record/record.go
+++ b/src/record/record.go
@@ -33,7 +33,7 @@ func Record(fname string) (err error) {
        patterns := 0
        currentPattern := ""
        currentState := ""
-       previousNote := music.NewNote("C", 4)
+       // previousNote := music.NewNote("C", 4)
        go func() {
                ticker := time.NewTicker(400 * time.Millisecond)
                notes := []midi.Event{}
@@ -69,7 +69,7 @@ func Record(fname string) (err error) {
                                        // } else {
                                        currentState += fmt.Sprintf("%s%d", note.Name, note.Octave)
                                        // }
-                                       previousNote = note
+                                       // previousNote = note
                                }
                                currentState += " "
                                notes = []midi.Event{}
$ go version
go version go1.19.3 darwin/arm64

# upgrade sys fixes compile error
$ go get -u golang.org/x/sys

# install portmidi and export homebrew paths
$ brew install portmidi
$ export CPATH="$HOMEBREW_PREFIX/include:$CPATH"
$ export LIBRARY_PATH="$HOMEBREW_PREFIX/lib:$LIBRARY_PATH"

# it works!
$ go run main.go
0atman commented

yep, applying this fix fixed it for me on linux/aarch64