midi or other background music alternative

i am having a lot of problems trying to get midi in java 5 to work when using it with the wav player that comes with lwjgl, is there another alternative i could use to lwjgl play midi files like maybe use openal instead of java, or is there another better method to play background music, because wav, mp3, etc are a little heavy when compared to midi?

You can use the FMOD stuff in LWJGL to play MIDI, but remember that FMOD is shareware and if you plan on making the big bucks you owe Mr. FMOD some cash.

Cas :slight_smile:

A slight problem with FMOD is that it only supports midi on the Windows platforms :-/

sure?
http://www.fmod.org/docs/HTML/FMUSIC_LoadSong.html
LoadSong is implemented on Linux and other platforms too…

Playing a Midi isn’t hard at all:


    try
   {
          Sequence midi = MidiSystem.getSequence(new File("Blue_Monday.mid"));
          Sequencer player = MidiSystem.getSequencer();

          player.open();
          player.setSequence(midi);
          player.start();
   }
   catch (IOException e) 
   {
         e.printStackTrace();
    }
    catch(InvalidMidiDataException e)
    {
         e.printStackTrace();
    }
    catch(MidiUnavailableException e)
    {
         e.printStackTrace();
    }
  }

I do not tested it under 5.0 but it runs fine under 1.4.2.
Stay Tuned,
Jens

meh - from forum:

"fmod only supports midi on win32 platforms. "

and

“we’re currently working on fmod4 and that will have software mixed midi support and it should also have hardware support through /dev/midi etc.”

I have my information from the following site:

http://www.fmod.org/ifmodfeatures.html

Have a look at the table called “Cross Platform feature chart”

fmod looks good but a bit on the heavy side if u want to sell your game. I was hoping there was a more free open source way for playing midi is there any other lite weight format that can be used for background music!

[quote][…]
I do not tested it under 5.0 but it runs fine under 1.4.2.
[/quote]
Ye, well… sound is totally broken in 1.5.0 :-/

The only thing, which still works as it should is triggering midi events manually… :frowning: