List of usage examples for javax.sound.midi ShortMessage POLY_PRESSURE
int POLY_PRESSURE
To view the source code for javax.sound.midi ShortMessage POLY_PRESSURE.
Click Source Link
From source file:com.rockhoppertech.music.midi.js.MIDIEvent.java
public String toReadableString() { StringBuilder sb = new StringBuilder(); // switch(se.getType()) { // case MidiEvent.CHANNEL_VOICE_MESSAGE: switch (status & 0xF0) { case ShortMessage.NOTE_OFF: sb.append("Note Off Key=").append(bytes[0]).append(" Velocity=").append(bytes[1]); break;/*from w ww . j a v a 2 s.c om*/ case ShortMessage.NOTE_ON: sb.append("Note On Key=").append(bytes[0]).append(" Velocity=").append(bytes[1]); break; case ShortMessage.POLY_PRESSURE: sb.append("Polyphonic key pressure key=").append(bytes[0]).append(" pressure=").append(bytes[1]); break; case ShortMessage.CONTROL_CHANGE: sb.append("Control Change controller=").append(bytes[0]).append(" value=").append(bytes[1]); sb.append(" ").append(MIDIControllers.getControllerName((int) bytes[0])); break; case ShortMessage.PROGRAM_CHANGE: sb.append("Program Change program=").append(bytes[0]).append(" name=") .append(MIDIGMPatch.getName(bytes[0])); break; case ShortMessage.CHANNEL_PRESSURE: sb.append("Channel Pressure pressure=").append(bytes[0]); break; case ShortMessage.PITCH_BEND: // int val = (this.bytes[0] & 0x7f) | ((this.bytes[1] & 0x7f) << 7); // short centered = 0x2000; short s14bit; s14bit = bytes[1]; s14bit <<= 7; s14bit |= bytes[0]; sb.append("Pitch Bend one=").append(bytes[0]).append(" two=").append(bytes[1]); sb.append(" val=").append(s14bit); break; default: sb.append(" Unhandled=").append(status & 0xF0); break; } sb.append(" Channel=").append(status & 0x0F); sb.append(" status=").append(Integer.toHexString(status)); /* * case MidiEvent.CHANNEL_MODE_MESSAGE: printChannelModeMessage(se); * break; * * case MidiEvent.SYSTEM_COMMON_MESSAGE : System.out.print(" system * common message "); break; * * case MidiEvent.SYSTEM_REALTIME_MESSAGE : System.out.print(" system * realtime message "); break; * * default: strMessage = "unknown event: status = " + se.getStatus() + * ", byte1 = " + this.bytes[0] + ", byte2 = " + this.bytes[1]; */ // System.out.print(sw.toString()); return sb.toString(); }