joearms / cocoa Goto Github PK
View Code? Open in Web Editor NEWcocoa and midi native interaface
cocoa and midi native interaface
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 Makefile
s 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.