Java Code Examples for javax.sound.midi.ShortMessage#ACTIVE_SENSING

The following examples show how to use javax.sound.midi.ShortMessage#ACTIVE_SENSING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SoftMainMixer.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 2
Source File: SoftMainMixer.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 3
Source File: SoftMainMixer.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 4
Source File: SoftMainMixer.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 5
Source File: SoftMainMixer.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 6
Source File: SoftMainMixer.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 7
Source File: SoftMainMixer.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 8
Source File: SoftMainMixer.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 9
Source File: SoftMainMixer.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 10
Source File: SoftMainMixer.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 11
Source File: SoftMainMixer.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 12
Source File: SoftMainMixer.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 13
Source File: SoftMainMixer.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 14
Source File: SoftMainMixer.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 15
Source File: SoftMainMixer.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public void processMessage(int ch, int cmd, int data1, int data2) {
    synchronized (synth.control_mutex) {
        activity();
    }

    if (cmd == 0xF0) {
        int status = cmd | ch;
        switch (status) {
        case ShortMessage.ACTIVE_SENSING:
            synchronized (synth.control_mutex) {
                active_sensing_on = true;
            }
            break;
        default:
            break;
        }
        return;
    }

    SoftChannel[] channels = synth.channels;
    if (ch >= channels.length)
        return;
    SoftChannel softchannel = channels[ch];

    switch (cmd) {
    case ShortMessage.NOTE_ON:
        if(delay_midievent != 0)
            softchannel.noteOn(data1, data2, delay_midievent);
        else
            softchannel.noteOn(data1, data2);
        break;
    case ShortMessage.NOTE_OFF:
        softchannel.noteOff(data1, data2);
        break;
    case ShortMessage.POLY_PRESSURE:
        softchannel.setPolyPressure(data1, data2);
        break;
    case ShortMessage.CONTROL_CHANGE:
        softchannel.controlChange(data1, data2);
        break;
    case ShortMessage.PROGRAM_CHANGE:
        softchannel.programChange(data1);
        break;
    case ShortMessage.CHANNEL_PRESSURE:
        softchannel.setChannelPressure(data1);
        break;
    case ShortMessage.PITCH_BEND:
        softchannel.setPitchBend(data1 + data2 * 128);
        break;
    default:
        break;
    }

}
 
Example 16
Source File: MidiCommunication.java    From jmg with GNU General Public License v2.0 4 votes vote down vote up
/**
 * The method required by the recieve interface - It has a stupid name so we
 * pass data for short messages to handleMidiInput (a better name).
 */
// This method is based on test code in Plumbstone - OSX Core MIDI package.
public void send (MidiMessage message, long timeStamp) {
    // Get the message bytes
    byte [] m = message.getMessage ();
    int status = message.getStatus();
    // Is it a short message ?
    if (message instanceof ShortMessage) {
        // Get command and channel data
        int type = (m [0] & 0xFF) >> 4;
        int channel = m [0] & 0xF;
        int data1 = m[1];
        int data2 = -1;
        if (m.length > 2) {
            data2 = m[2];
        }
        
        // Is it a channel message?
        if (type != 15) {
            handleMidiInput(status - channel, channel, data1, data2);
        }
        else {
            // System message - some need special handling due to vast quanitity
            if (status == ShortMessage.TIMING_CLOCK) {
                System.out.print ("MIDI Clock message");
            }
            else if (status == ShortMessage.ACTIVE_SENSING) {
                System.out.print ("MIDI Active sensing message");
            }
            else {
                // Some other system message - just print status byte
                System.out.print ("A non-identified MIDI system message " + status);
            }
        }
    }
    
    // System exclusive message?
    else if (message instanceof SysexMessage) {
        // Print out sysex message
        System.out.println ();
        System.out.print ("Sysex MIDI message <<");
        for (int i=0; i<m.length; i++) {
            System.out.print (" " + m [i]);
        }
        System.out.println (">>");
    }
    
    // Meta message (probably shouldn't ever get this)
    else if (message instanceof MetaMessage) {
        // Print out meta message
        System.out.println ();
        System.out.print ("Meta MIDI Message {");
        for (int i=0; i<m.length; i++) {
            System.out.print (" " + m [i]);
        }
        System.out.println ("}");
    }
    
    // Uncast message
    else {
        System.out.println ("Unknown MIDI message [");
        for (int i=0; i<m.length; i++) {
            System.out.print (" " + m [i]);
        }
        System.out.println ("]");
    }
}