Class MidiSplitter


  • public class MidiSplitter
    extends Object

    MIDI Splitter (Java)

    This program receives MIDI messages from a transmitting MIDI port and splits any incoming notes (e.g. from a chord) into the first available MIDI channel. This is based off of a similar application I wrote in C#, but I decided to do a Java rewrite to make it available on operating systems other than Windows.

    This program was designed to get around an issue with using MIDI keyboards in Moppy2, but may be useful for other applications as well. Recommended software to use alongside this on Windows1 is loopMIDI by Tobias Erichsen. On most Linux kernels, a virtual MIDI through-port is provided and can be enabled with modprobe snd-virmidi snd_index=<index of last audio card + 1>.2


    1 - Windows users please note that due to a bug with MIDI device handling in Windows, when running this program on Windows a device will not be removed when the lists are refreshed, however new devices will be added. The ghost device will disappear upon restarting the program.

    2 - Linux users please note that due to an issue with JVM MIDI access, Java reports all sub-devices of the virmidi ports seperately. I have found success in simply not using more than one virmidi port where the second digit (y) in the [hw: x,y,z] is the same.
    Since:
    2020-01-28
    • Constructor Detail

      • MidiSplitter

        public MidiSplitter()
    • Method Detail

      • main

        public static void main​(String[] args)
        The entrance method for the program.
        Parameters:
        args - the command line arguments specified.
        • -h, -help, --help
          • Display the help prompt
        • -i device, --input device
          • Specify a default MIDI input device to attempt to select
          • Sequential instances of argument represent prioritized default input devices
          • If both a valid --input and --output argument are provided, the splitter will start on launch
        • -o device, --output device
          • Specify a default MIDI output device to attempt to select
          • Sequential instances of argument represent prioritized default output devices
          • If both a valid --input and --output argument are provided, the splitter will start on launch
        • -s, --silent
          • Suppress all console output, including error messages
        • -q, --quiet
          • Show console error messages, but don't ask for user input; overridden by --silent
        • -d, --debug
          • Output MIDI translation debugging information to the console; overridden by --silent and --quiet
        • --
          • Don't interpret arguments inside '--' block as options (for example you could do '--input -- -i --' if you had a device named '-i')
        Since:
        2020-03-08