JDK-4356787 : MIDI device I/O is not working
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 1.0,1.3.0,1.3.1,5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS:
    generic,solaris_7,windows_95,windows_98,windows_2000 generic,solaris_7,windows_95,windows_98,windows_2000
  • CPU: generic,x86,sparc
  • Submitted: 2000-07-26
  • Updated: 2003-01-30
  • Resolved: 2002-04-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.1 hopperFixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description

Name: skT45625			Date: 07/26/2000


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

When trying to send data to a MIDI device other than the internal java ones
(such as the java sound synthesizer and the java sequencer), although
everything appears to be functioning properly, the MIDI device does not receive
the message. I tested this on many types of devices, including hardware devices
such as a soundcard's synthesizer and its MPU-401, and on virtual devices which
create virtual MIDI ports in the operating system such as Hubi's MIDI Loopback
device v1.5 and a MIDI Monitor program. Here is code that produces the problem:

<pre>
// MidiTest.java
//
// Given as an example of how the javax.sound.midi.* classes do not work on a
// Win98 machine.
//
// by Nicholas Marrone
// July 21, 2000

import javax.sound.midi.*;
import java.lang.Integer;

class MidiTest
{
	public static void main(String[] args)
	{
		MidiDevice.Info[] devices = MidiSystem.getMidiDeviceInfo();

		// If incorrect arguments, just print out a list of the
available devices
		// and the program's usage
		if (args.length != 1) {
			System.out.println("Usage:\n\tjava MidiTest [midi
device number]\n");
			for (int x = 0; x < devices.length; x++) {
				System.out.println("\t"+devices[x]);
			}
		}
		// on the correct arguments, send one note to the specified
midi device
		else {
			try {
			int deviceNum = Integer.parseInt(args[0]);
			MidiDevice md = MidiSystem.getMidiDevice(devices
[deviceNum]);
			md.open();

			// send the message
			ShortMessage myMsg = new ShortMessage();
			myMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93);
			long timeStamp = -1;
			Receiver r = md.getReceiver();
			r.send(myMsg, timeStamp);

			// wait for the not to play
			for (int x = 0; x < 10000; x++) {
				System.out.print("a");
			}

			md.close();
			} catch(Exception e) { System.out.println("Exception
occurred: " + e); }
		}
		System.exit(0);
	}
}
</pre>

The type of soundcard I am using currently which has the problem has an
Interwave chip. I have also tested this on a soundcard with a Crystal chip, and
that soundcard had the same problem.
(Review ID: 107487) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper FIXED IN: hopper INTEGRATED IN: hopper
14-06-2004

EVALUATION ###@###.### 2002-01-17 Serious problem, MIDI I/O is not implemented. This lack had been properly documented in publicly available support documents, has been discussed many times on the javasound-interest mailing list, and is now documented on the Java Sound homepage, too. Should be fixed asap. ###@###.### 2002-02-26 Renamed from "MIDI devices other than the Java internal ones do not function" to "RFE: Add MIDI device I/O". Changed to RFE. Use this bug as container for all MIDI I/O related bugs. ###@###.### 2002-04-17 Changed back to "bug" with synopsis "MIDI device I/O is not working" and commit to Hopper. ###@###.### 2002-05-28 Implemented for Windows. Linux MIDI support will come with ALSA support in a future version. scottyg: the bug database is also used for internal bug tracking, and therefore not all information may make sense for external readers. Hopper is the code name for J2SE 1.4.1.
11-06-2004

WORK AROUND Name: skT45625 Date: 07/26/2000 There is no workaround that I know of. ======================================================================
11-06-2004

PUBLIC COMMENTS This bug is fixed as of 1.4.1 on Windows, and with 1.5.0 on Linux. Since 1.5.0, the sequencer can be connected to MIDI ports. For MIDI i/o on MacOS, please refer to Apple, who is responsable for the MacOS port.
10-06-2004