Code Monkey home page Code Monkey logo

Comments (10)

kisielk avatar kisielk commented on July 20, 2024

Can you try running the code with theGODEBUG=cgocheck=2 environment variable set?

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

@kisielk Tried that and got the same error.

from portmidi.

kisielk avatar kisielk commented on July 20, 2024

Okay, but you didn't get any messages from the Go runtime? Also, which version of Go are you using?

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

go version go1.7.4 linux/amd64

Didn't notice any extra messages from the Go runtime.

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

Also here is pacman -Qi portmidi

Name            : portmidi
Version         : 217-5
Description     : Platform independent library for real-time MIDI input/output
Architecture    : x86_64
URL             : http://portmedia.sourceforge.net/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : alsa-lib
Optional Deps   : java-runtime: for using pmdefaults
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 154.00 KiB
Packager        : Eric Belanger <[email protected]>
Build Date      : Sat 26 Oct 2013 12:14:09 PM CDT
Install Date    : Sat 14 Jan 2017 04:26:42 PM CST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

Reviewing the cgo docs it says that the GODEBUG checks are sidestepped by code that uses package unsafe, and the code that is crashing in this case does use unsafe. I wonder if it's possible to not use unsafe?

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

Looks like we have to use unsafe.Pointer since PortMidiStream is void

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

FWIW I started playing with an alternative midi implementation https://github.com/scgolang/midi seems pretty stable on linux so far, haven't used it on mac much yet

from portmidi.

kisielk avatar kisielk commented on July 20, 2024

@briansorahan cool, I will check it out. One thing I'm struggling with in PortMIDI is to have an efficient way to have channels for incoming MIDI events implemented in an efficient way, preferably without polling. Seems like using ALSA might solve that.

from portmidi.

briansorahan avatar briansorahan commented on July 20, 2024

@kisielk Writing that package has been interesting so far. The linux part took me maybe two hours and resulted in a beautiful tiny interface which basically just had Open, Read, Write, and Close. Read would block until I sent data from the device, which seemed just perfect to me since consumers of the package can easily type go to make it nonblocking.
Wrapping coremidi caused me to rewrite the linux code though because in order to get data from the device you register a callback.
So now I return a channel for reading in both the linux and darwin code.

from portmidi.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.