Skip to content

LeovR/rtp-midi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central

rtpmidi

A Java implementation of the RTP-MIDI protocol.

Usage

Currently this library can only be used as a RTP-MIDI session listener.

  1. Create a AppleMidiServer
  2. Add a AppleMidiSession to the server
  • Either a MidiDeviceAppleMidiSession if a MidiDevice should be used
  • Or a MidiReceiverAppleMidiSession if only a Receiver interface should be used. E.g. for direct processing of messages without a MidiDevice.
  1. start() the server

To announce the server via Apple's bonjour the jMDNS library can be used.

###Demo

public class Application {

    public static void main(final String[] args) throws InterruptedException {
        try {
            JmDNS jmdns = JmDNS.create(InetAddress.getLocalHost());

            ServiceInfo serviceInfo =
                    ServiceInfo.create("_apple-midi._udp.local.", "rtpMidiJava", 50004, "apple-midi");
            jmdns.registerService(serviceInfo);

            MidiDevice midiDevice = ;//get MIDI device

            AppleMidiServer server = new AppleMidiServer();
            server.addAppleMidiSession(
                            new MidiDeviceAppleMidiSession(new MidiDeviceModePair(midiDevice, MidiDeviceMode.READ_ONLY)));

            server.start();

            System.in.read();

            server.stop();
        } catch (final IOException e) {
            e.printStackTrace();
        }
    }
}

ToDo

  • Implement journaling
  • Implement missing session protocol commands
  • Implement session initiation