Java Midi on Mac OSX Broken?

I am trying to play midi in a browser and use a Java applet that works fine on a PC. This is extremely unreliable on OSX, so I wrote a simple test case that shows the same problem:

import javax.sound.midi.*;
import java.io.InputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class MidiPlayer {

  public static void main(String[] args) {
      try {
          Sequencer sequencer = MidiSystem.getSequencer();
          if (sequencer == null)
              throw new MidiUnavailableException();
          sequencer.open();
          FileInputStream is = new FileInputStream("sample.mid");
          Sequence mySeq = MidiSystem.getSequence(is);
          sequencer.setSequence(mySeq);
          sequencer.start();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
}

It seems that the random message is being removed. Just as a note does not work, and a random note will forever depend. Is this a known issue in OSX? Java doesn't seem to get enough love from Apple these days.

If someone has the best solution for playing Midi in a browser, I’m all ears!

+5
source share
2 answers

. midi sysex mid-2011 OSX 10.7.5, iMac. - -, jar jnilib, -, , -1 system.currentTimeMillis(). sysex , timestamp of -1. , , - / .. , ? . , mmj . , .

+4

mmj - Midi java Mac OS X:

Java java . , MIDI bytes >= 0xF0 (.. sysex, MIDI clock, timecode ..), Midi, ( , ), .

OS X , API .

+3

All Articles