Giter Site home page Giter Site logo

cocoa's People

Contributors

joearms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cocoa's Issues

Unable to use with Elixir

Hello,

First off, thanks for your hard work. I'm very new to Elixir (erlang-r16) and am running OSX 10.7.5. I'd really like to play with MIDI in elixir, but am struggling to understand how to use this via interop.

Here's what I've done so far to try to get this working:

I editied the Makefiles in au and midi_interface as it seemed like these were the things I might want to play with. I changed the paths to point at the more recent versions of erl_interface and erts. In au everything built just fine without changing -arch i386 to -arch x86_64. The same wasn't true for midi_interface. In order to get further I tried to switch -arch i386 to -arch x86_64 because I was getting architecture-related errors when trying to build.

cocoa/midi_interface master ♺ (solo)> make
erlc -W cocoa_test.erl
erlc -W midi_nifs.erl
midi_nifs.erl:19: Warning: variable 'X' is unused
midi_nifs.erl:34: Warning: variable 'I' is unused
midi_nifs.erl:34: Warning: variable 'Pid' is unused
erlc -W midi_test.erl
midi_test.erl:15: Warning: variable 'E' is unused
midi_test.erl:25: Warning: variable 'T' is unused
gcc -c -arch x86_64 -g -Wall -fPIC\
            -I/usr/local/lib/erlang/lib/erl_interface-3.7.11/include\
            -I/usr/local/lib/erlang/erts-5.10.1/include midi_nifs.c
midi_nifs.c: In function ‘list_audio_components’:
midi_nifs.c:57: warning: passing argument 1 of ‘AudioComponentCount’ from incompatible pointer type
cc midi_nifs.o -arch x86_64\
                       -framework CoreMIDI\
                       -framework CoreAudio\
                       -framework AudioUnit\
                       -framework CoreServices\
                       -bundle -flat_namespace -undefined suppress\
                       -L/usr/local/lib/erlang/lib/erl_interface-3.7.11/lib\
                       -lerl_interface -lei -o midi_nifs.so
erl -s midi_test start
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Starting midi tests ...
Finding devices ...
{z,ok}
make: *** [all] Segmentation fault: 11

Despite this, I decided I'd try and hook it up to to elixir. I added this to my mix.exs:

defp deps do
  [{:midi_nifs, path: "../cocoa/midi_interface", app: false}]
end

I then ran mix deps and got an ok.
Then: iex -S mix
Then: iex(1)> :midi_nifs.module_info

It couldn't find the module. So, I tried doing what someone from the channel suggested for a different, much older and completely broken midi library: I moved the *.beam files into a directory under midi_interface named ebin.

I tried the same thing again and this time it seemed to know what I was talking about, except it blows up because it cannot find midi_nifs.so.

What can I do to make cocoa play nice with elixir?

Thanks in advance!
Devin

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.