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

improve device selection error messages #6

Open
satchmorun opened this issue Jan 10, 2012 · 4 comments
Open

improve device selection error messages #6

satchmorun opened this issue Jan 10, 2012 · 4 comments

Comments

@satchmorun
Copy link

I'm trying out your micromidi library and when I try to run the example in the readme, I get an error when using the use method:

ruby-1.9.2-p290 :001 > require 'midi'
 => true 
ruby-1.9.2-p290 :002 > @i = UniMIDI::Input.use(:first)
NoMethodError: private method `open' called for nil:NilClass
    from /Users/rulfzid/.rvm/gems/ruby-1.9.2-p290@s10-edu/gems/unimidi-0.3.2/lib/unimidi/congruous_api_adapter.rb:147:in `use_device'
    from /Users/rulfzid/.rvm/gems/ruby-1.9.2-p290@s10-edu/gems/unimidi-0.3.2/lib/unimidi/congruous_api_adapter.rb:98:in `use'
    from (irb):2
    from /Users/rulfzid/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :003 > @o = UniMIDI::Output.use(:first)
NoMethodError: private method `open' called for nil:NilClass
    from /Users/rulfzid/.rvm/gems/ruby-1.9.2-p290@s10-edu/gems/unimidi-0.3.2/lib/unimidi/congruous_api_adapter.rb:147:in `use_device'
    from /Users/rulfzid/.rvm/gems/ruby-1.9.2-p290@s10-edu/gems/unimidi-0.3.2/lib/unimidi/congruous_api_adapter.rb:98:in `use'
    from (irb):3
    from /Users/rulfzid/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
ruby-1.9.2-p290 :004 > exit

I'm on OSX Lion, running ruby 1.9.2. Is there something I'm missing?

Another strange thing: i couldn't even get it to require 'midi' until i installed the alsa-rawmidi, midi-jruby and midi-winmm gems. The first i understand, but seems like some platform detection might not be working correctly for the latter two.

@arirusso
Copy link
Owner

Does your computer have any MIDI devices? This is what would happen if it didn't... I could probably do better error reporting there of course

You can check what devices CoreMIDI is recognizing by running "unimidi list" at the command line or UniMIDI::Device.list in Ruby

@satchmorun
Copy link
Author

UniMIDI::Device.list returns an empty array.

I was under the impression that OSX has built-in MIDI devices. Ah, I had to turn on the IAC driver.

I'm mainly interested in the output anyway.

Sorry for another very noob question, but how do you send midi messages to headphones/speakers?

@arirusso
Copy link
Owner

OSX can route MIDI messages from one application to another but you'll need to activate that in order to see it represented with unimidi at all

Here's a blog post I did on it a while back

http://tx81z.blogspot.com/2011/06/osx-unimidi-and-midi-patch-bay.html

MIDI messages are just data -- you would need to send them to some sort of sound generator to generate sounds. For instance, sending MIDI from unimidi to Ableton Live or GarageBand would be one way to achieve this

@arirusso
Copy link
Owner

I'm going to change the title of this issue to "improve device selection error messages" and use it as a reminder to do that

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