RWMidi was developed and accessible and useful Java class that contains static methods to get a list of the available MIDI devices.
You can ask RWMidi about available input and output devices. You can then use the methods on the returned objects to open an input or output midi port.
RWMidi doesn’t provide access to the available MIDI devices through an index number, but rather requires you to use the returned MidiDevice object.
This is because the number of available devices can change between a call to the function listing the device and the call opening the device, which could potentially lead to an index mismatch.
Provides access to and control of MIDI devices (input and output) installed on the current machine.
References:
See ‘Thread’
The WON API:
Platform-independent, event-based, Object-oriented access to MIDI devices and ports
n
g
o
r
d
e
r
.
–
1
7
1
,
–
4
,
3
,
5
S
o
r
t
–
2
2
,
–
0
.
2
,
4
,
3
i
n
d
e
s
c
e
n
d
i
n
g
o
r
d
e
r
.
4
,
3
,
–
0
.
2
,
–
2
2
P
u
t
1
,
–
2
/
1
7
,
–
3
/
1
1
,
–
2
i
n
d
e
s
c
e
n
d
i
n
g
o
r
d
e
r
.
1
,
–
2
/
1
7
,
–
3
/
1
1
,
–
2
S
o
r
t
–
5
,
2
6
,
–
2
.
–
5
,
–
2
,
2
6
P
u
t
–
1
8
6
,
3
,
5
i
n
d
e
s
c
e
n
d
i
n
g
o
r
d
e
r
.
5
,
3
,
–
1
8
6
S
o
r
t
–
4
,
–
An accessibility class for the RMI application. It is a Java
implementation of the MIDI API. It is intended to be a simple to
use, well-structured and, above all, very portable. Being the first
of its kind it is also the only one.
Code:
import java.io.File;
import java.io.IOException;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.midi.*;
public class MidiPort
{
private MidiDevice[] devices;
private int[] portList;
private String name;
private String deviceName;
private MidiDevice[] open(String[] args) throws IOException
{
String[] command = {“-list”};
String[] response = {“-list”};
for (int i=0;i
91bb86ccfa
RWMidi is a Java class which provides static methods to list the available MIDI devices on a machine, and open a port for each available device.
RWMidi allows several devices to be listed through a single call to the getAvailableDevices() function, returning a list of available devices. The list returned is in the order the devices were found, so that order is preserved.
This is an alternative to the getAllDevices() method, which returns a list of all available devices.
This class is automatically loaded with all Java 1.4 compatible platforms.
If the class RWMidi is not found at runtime, you are prompted with a dialog box prompting you to locate the RWMidi class on your machine.
QuickStart:
The following example demonstrates how to get a list of the available MIDI devices, and open an input or output port for each device.
This example uses the methods getMidiInDevices() and getMidiOutDevices() to provide a list of the available input and output MIDI devices respectively.
getMidiInDevices() and getMidiOutDevices()
getMidiInDevices() and getMidiOutDevices() are called to obtain an instance of the class RWMidi.
The class RWMidi implements the MidiDevice interface. The constructor MidiDevice() automatically calls the getId() method to determine the device type.
A device’s MIDI name is simply the device name.
RWMidi Device Object
The RWMidi.MidiDevice class implements a midi device.
It is in charge of reading and writing midi data.
The constructor takes the name of the device as a parameter. The constructor creates an object for the MidiDevice, then calls the createMidiInPort(MidiInPortInfo) and createMidiOutPort(MidiOutPortInfo) static methods.
MidiInPortInfo
MidiInPortInfo provides a default constructor with the two global defaults values: a default port of 0, and a default queue size of 1.
The createMidiInPort() method must be called to set the port and queue.
MidiInPortInfo contains the following fields:
portNumThe port number.
queueNumThe queue size.
midiChannelThe midi channel number.
transportToSetTransport
channelToSet
RWMidi is a static class that can be used to find input and output midi devices
Java RWMidi Sample Code
RWMidi.availableDevices(); //Finds all the available midi devices
RWMidi.getMidiDevice(RWMidi.MidiInPort.class); //Finds the Input MIDI device
RWMidi.getMidiDevice(RWMidi.MidiOutPort.class); //Finds the Output MIDI device
//—
//—
MidiDevice rwmidi_input = RWMidi.getMidiDevice(RWMidi.MidiInPort.class); //Gets the input MIDi device
MidiDevice rwmidi_output = RWMidi.getMidiDevice(RWMidi.MidiOutPort.class); //Gets the output MIDi device
You can now use these MidiDevice objects to obtain information about the devices. You can also write the midi data using the write method on the device.
Other Libraries/Programs
See the main site here at
JavaCV
JavaCV was developed by the Toronto Research Centre, Adobe, and others for the use of image processing computer vision. It allows you to program image analysis algorithms in Java and store them in a JAR file. It has a public and a private API. The public API allows you to do anything with images, like find image candidates using live objects detection or extract features from an image using SIFT.
As well as the image processing functionality, it also provides multiple interfaces for input, output and network. To use the image processing functionality, you must import the JavaCV library in your project.
As it is Java API, it runs on any platform and even on mobile devices and you can write applications for smartphones.
JavaCV Description:
JavaCV is a programming library and development framework that enables programmers to use open-source codes, algorithms, and techniques to accelerate their application development, especially in image-based tasks.
JavaCV is free software under the Open Source GPL (LGPL) license.
See the main site here at
JavaFX
JavaFX supports graphics and GUI in Java. It is an excellent tool for developing interactive applications. The standard version is JavaFX 2.0, you can extend it in Java FX 8. It has its own interface and event model.
See
Minimum:
OS: Windows 7 or later
Processor: Intel Core i5-2500K (3.3GHz – 3.7GHz) or AMD Phenom II X4 940
Memory: 8 GB RAM (8 GB+ for XSplit Gamecaster)
Graphics: NVIDIA GeForce GTX 660 (2GB) or ATI Radeon HD 7850 (2GB) or AMD Radeon HD 7870 (2GB)
DirectX: Version 11
Network: Broadband internet connection
Hard Drive: 30 GB available space