Results 1 to 2 of 2
  1. #1
    Ben Wheatley is offline Member
    Join Date
    Jul 2009
    Posts
    2
    Rep Power
    0

    Default Getting input from MIDI devices on a Mac

    Hi,

    I have a Mac, and I'm trying to write a rhythm-action game, taking input from a MIDI keyboard attached to the computer. Following the examples I've seen elsewhere, I have this code to list the available MIDI devices:

    Java Code:
    MidiDevice.Info md_infos[] = MidiSystem.getMidiDeviceInfo();
    for (i=0; i<md_infos.length; ++i) {
    	System.out.println(md_infos[i].getName());
    }
    Unfortunately, this code will always print exactly two lines ("Real Time Sequencer" and "Java Sound Synthesizer"), regardless of whether or not I have my MIDI keyboard plugged in. Other applications on the system (e.g. GarageBand) recognise they keyboard and it's input. Can anyone help?

    (Intel MacMini, MacOS X 10.5.7; MIDI keyboard is attached via a MIDI-to-USB converter)

  2. #2
    freqrush is offline Member
    Join Date
    Jan 2009
    Location
    Belgium
    Posts
    20
    Rep Power
    0

    Default

    Check out the code of JSynthLib, which is an "Open Source Universal Synthesizer Patch Editor / Librarian written in the Java Language".

    It must have a method you can get an example from, as it also recognises the available MIDI ports. Browse or download the code here: http : // jsynthlib . svn . sourceforge.net/viewvc/jsynthlib/trunk/ (remove spaces, I can't post links yet)

Similar Threads

  1. connect to usb devices
    By alex1234 in forum Advanced Java
    Replies: 2
    Last Post: 03-30-2009, 05:39 PM
  2. How to control robots and other devices
    By francojava in forum Advanced Java
    Replies: 0
    Last Post: 01-24-2008, 05:03 PM
  3. Replies: 3
    Last Post: 12-25-2007, 05:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •