Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on OS X #19

Open
nzoschke opened this issue Jan 13, 2023 · 1 comment
Open

Building on OS X #19

nzoschke opened this issue Jan 13, 2023 · 1 comment

Comments

@nzoschke
Copy link

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
Copy link

0atman commented Jul 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants