[PlanetCCRMA] MIDI provider from Java applications to JACK?

Paavo Nieminen nieminen@cc.jyu.fi
Fri Feb 10 15:40:02 2006

Thank you very much for your answer, Mark. I shall continue a bit here...

Maybe I'll rephrase the question: Is somebody using any Java-based
MIDI application simultaneously with other audio/midi applications, and if
so, how is the JRE set up to do this?

Some details follow...

On Fri, 10 Feb 2006, Mark Knecht wrote:

>    Are you using QJackCtl? If you've tried it can you explain what
> it's MIDI connection pane doesn't support for you?

To demonstrate my problem with the Java run-time environment (JRE), I was
referring to QJackCtl, the "JACK Audio Connection Kit - Qt GUI Interface".
My problem, however, is not within QJackCtl or what it supports.

>From what I understand, the JRE used to come without concrete MIDI port
support (because, I suppose, it is so dependent on the sound system
implementation), and the proper one for a specific system had to be some
kind of plug-in or extension to the Java engine. When I first tried JRE
1.4.2 and ran a Java MIDI application (tried JSynthLib and k5keditor)
without adding anything, I got an error message including the following

Caused by: java.lang.ClassNotFoundException:
javax.sound.midi.MidiDevice$Info not found in
parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}

So far, the WWW has let me understand that after JRE 1.3, or so, the
package javax.sound.midi defines an interface for applications that need
MIDI input and output, and the actual physical interface is done in an
implementation-specific provider class, using, I suppose, some native
system code. I also saw notes that JRE 1.5.0 has this built-in for i386
Linux. Well, I updated to jre1.5.0_05, with which the applications do
launch OK, and they seem to be able to locate my soundcard's MIDI port
which shows up with a name like "DSP24 hw[0,0]". This is not what I would
like, though, even if it did work (which it hasn't done yet, under my

What I would like to see happen, is that upon launching a Java MIDI
application, its MIDI input and output would appear no differently from a
JACK-supporting application such as Rosegarden, Ardour, Fluidsynth, etc.
This would mean, I suppose, that I could see them on the list of "Readable
Clients / Output Ports" and "Writable Clients / Input Ports" in QJackCtl
and make connections from there.

There is also the problem that nothing seems to be sent through the
hardware port even though it seems to be found by the app... I've been
sort of guessing that it might have to do with the port being taken over
by the JACK/ALSA sequencer, but I haven't tried shutting those down for
trying only one application at a time. I'm not yet very clear about which
part of the audio/midi system does what and how exactly. I'm no expert,
and that's why I'm asking around for help :)  after getting a bit

I also tried out this Tritonus thing <http://tritonus.org/>, but it
crashed upon launching, and there hasn't been an update since 2003, so
to me it looks abandoned. The Tritonus did register the application's port
proper-lookingly for half a second before crashing, though.

>    I find that for the apps that are sort of weak in terms of doing
> connections that QJC's MIDI pane provides all the connection
> capabilities I need.

Yes. I'm new to Linux music, and so far I've been happy with the
applications in the PlanetCCRMA collection and the underlying Jack system.
QJackCtl is one of the nice things, no complaints. My problem seems to be
in (my incapability of) setting up the JRE for MIDI in a FC4/PlanetCCRMA

I hope there's a way to get these Java apps transmitting to my Kawai
K5000S and friends some day. It seems like such a simple thing.. just
bytes in series via a cable...

I hope I cleared my intention here somewhat. Greetings from Finland, a
rather cool place these wintry days.


  Paavo Nieminen  <nieminen@cc.jyu.fi>
  Beyond progressive: http://www.portraitofbeyond.com/