LWJGL
May 20, 2013, 05:01:10 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Anybody know a Java MIDI library?  (Read 4111 times)
Ciardhubh
Talks Too Much
***
Posts: 159


« on: June 10, 2010, 04:18:04 »

Does anybody know a Java library that can synthesise MIDI audio files to something sampled (like Wav/Ogg/etc.), so you can pass it to OpenAL? License is also an issue. It shouldn't be "infectious" like the GPL, e.g. BSD, LGPL, Apache.

I looked around but didn't find anything suitable.

javax.sound.midi appears to use hardcoded ouput via the OS' audio system. It's unstable (doesn't work together with other audio apps) and AFAIK there's no way to capture output.
JFugue is buillt on top of javax.sound.midi and suffers from the same limitations.
Gervill and Frinika are published under the GPL.
Logged
kappa
Administrator
Nerdus Imperius
*****
Posts: 1112



« Reply #1 on: June 10, 2010, 05:09:14 »

Not found a good java midi library however their is a really good java library for playing mod/xm/s3m called IBXM.

Slick2D already uses this to play sound files, so if you need a quick implementation for LWJGL just rip it out from there as its coded nicely and easily separable.

Next if you go to the Slick2D HomePage on the side bar you'll find an old tool called G2Mid2Mod (you can also try see if you can find it on google if you want). This will convert midi to xm allowing you to play them with IBXM.

P.S Thanks for your lwjgl tutorials on your website, i've found them most useful.
Logged
Ciardhubh
Talks Too Much
***
Posts: 159


« Reply #2 on: June 10, 2010, 10:12:51 »

Thanks, I already integrated IBXM into my audio system (with a few tweaks; mono output for 3D sources and a fixed endianness issue on Linux). It's a nice decoder. Too bad the new version has no licensing info available, so I'm still using a slightly older one.

If converting from MIDI to a tracker format would work at runtime, that would be nice. I already thought about command line, non-Java synthesisers to do it at runtime but then I'd have the rather annoying overhead of maintining natives for all OSs (plus the non-Java crowd seems to be rather taken by the GPL). Midi probably isn't worth the trouble. I wonder what's better - performance-wise - convert to Ogg or a tracker format and decode that at runtime.

Anyway ... always glad when those tutorials I put up are of some use to someone Smiley
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #3 on: June 11, 2010, 17:51:01 »

I found this, but havnt tried it yet
http://sites.google.com/site/mumart/home/liquinth-polyphonicanalogue-stylemusicsynthesizerforjava
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
Ciardhubh
Talks Too Much
***
Posts: 159


« Reply #4 on: June 12, 2010, 02:28:56 »


From the looks of it (comments are a bit ... non-existent) it's a virtual keyboard/instrument. It does synthesise single notes to PCM audio data when you press a key. Unfortunately it doesn't look like it supports predefined sequences like MIDI files.
Logged
bobjob
Prolific Timewaster
****
Posts: 335


LWJGL: WOW SO GOOD


« Reply #5 on: June 12, 2010, 12:54:56 »

From the looks of it (comments are a bit ... non-existent) it's a virtual keyboard/instrument. It does synthesise single notes to PCM audio data when you press a key. Unfortunately it doesn't look like it supports predefined sequences like MIDI files.
Damn,
I tried to find another solution and I'm actually surprised that MIDI is such a head ache in java.
Logged

LWJGL Benchmark online test:
http://have2chat.net/benchmark/
http://have2chat.net/benchmark/fullpage.html (run full OpenGL webpage)
Matthias
Talks Too Much
***
Posts: 180


WWW
« Reply #6 on: June 13, 2010, 02:53:42 »

Java has a MIDI playback API - but it will output it via the sound card and not to PCM data
Logged

Ciardhubh
Talks Too Much
***
Posts: 159


« Reply #7 on: June 15, 2010, 04:03:21 »

Java has a MIDI playback API - but it will output it via the sound card and not to PCM data

javax.sound.midi? I don't get what the point of that API is supposed to be. No access to PCM data and it requires exclusive access to the OS's audio system, i.e. it prevents other (VLC, OpenAL, etc.) apps from playing audio and won't play if others are playing. Either I'm missing something or javax.sound.midi is useless for any non-trivial application.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!