Package com.softsynth.jmsl.midi
Class DefaultMidiListener
java.lang.Object
com.softsynth.jmsl.midi.DefaultMidiListener
- All Implemented Interfaces:
MidiListener
public class DefaultMidiListener extends java.lang.Object implements MidiListener
MidiListener that prints incoming Midi messages to JMSL.out
Source:
Source:
public void handleNoteOn(double timeStamp, int channel, int pitch, int velocity) { JMSL.out.println("NoteOn, time=" + timeStamp + ", channel= " + channel + ", pitch= " + pitch + ", velocity= " + velocity); } public void handleNoteOff(double timeStamp, int channel, int pitch, int velocity) { JMSL.out.println("Note Off, time=" + timeStamp + ", channel= " + channel + ", pitch= " + pitch + ", velocity= " + velocity); } public void handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure) { JMSL.out.println("PolyphonicAftertouch, time=" + timeStamp + ", channel= " + channel + ", pitch= " + pitch + ", pressure= " + pressure); } public void handleControlChange(double timeStamp, int channel, int id, int value) { JMSL.out.println("ControlChange, time=" + timeStamp + ", channel= " + channel + ", id= " + id + ", value= " + value); } public void handleProgramChange(double timeStamp, int channel, int program) { JMSL.out.println("ProgramChange, time=" + timeStamp + ", channel= " + channel + ", program= " + program); } public void handleChannelAftertouch(double timeStamp, int channel, int pressure) { JMSL.out.println("ChannelAftertouch, time=" + timeStamp + ", channel= " + channel + ", pressure= " + pressure); } public void handlePitchBend(double timeStamp, int channel, int lsb, int msb) { JMSL.out.println("PitchBend, time=" + timeStamp + ", channel= " + channel + ", lsb= " + lsb + ", msb= " + msb); } public void handleSysEx(double timeStamp, byte[] data) { StringBuffer buf = new StringBuffer(); buf.append("SysEx, time= " + timeStamp + ", data: " ); for (int i=0; i < data.length; i++) { buf.append(" " + data[i]); } JMSL.out.println(buf.toString()); }
- Author:
- Nick Didkovsky 4/99
- See Also:
MidiParser
-
Constructor Summary
Constructors Constructor Description DefaultMidiListener()
-
Method Summary
Modifier and Type Method Description void
handleChannelAftertouch(double timeStamp, int channel, int pressure)
void
handleControlChange(double timeStamp, int channel, int id, int value)
void
handleNoteOff(double timeStamp, int channel, int pitch, int velocity)
void
handleNoteOn(double timeStamp, int channel, int pitch, int velocity)
void
handlePitchBend(double timeStamp, int channel, int lsb, int msb)
void
handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure)
void
handleProgramChange(double timeStamp, int channel, int program)
void
handleSysEx(double timeStamp, byte[] data)
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DefaultMidiListener
public DefaultMidiListener()
-
-
Method Details
-
handleNoteOn
public void handleNoteOn(double timeStamp, int channel, int pitch, int velocity)- Specified by:
handleNoteOn
in interfaceMidiListener
-
handleNoteOff
public void handleNoteOff(double timeStamp, int channel, int pitch, int velocity)- Specified by:
handleNoteOff
in interfaceMidiListener
-
handlePolyphonicAftertouch
public void handlePolyphonicAftertouch(double timeStamp, int channel, int pitch, int pressure)- Specified by:
handlePolyphonicAftertouch
in interfaceMidiListener
-
handleControlChange
public void handleControlChange(double timeStamp, int channel, int id, int value)- Specified by:
handleControlChange
in interfaceMidiListener
-
handleProgramChange
public void handleProgramChange(double timeStamp, int channel, int program)- Specified by:
handleProgramChange
in interfaceMidiListener
-
handleChannelAftertouch
public void handleChannelAftertouch(double timeStamp, int channel, int pressure)- Specified by:
handleChannelAftertouch
in interfaceMidiListener
-
handlePitchBend
public void handlePitchBend(double timeStamp, int channel, int lsb, int msb)- Specified by:
handlePitchBend
in interfaceMidiListener
-
handleSysEx
public void handleSysEx(double timeStamp, byte[] data)- Specified by:
handleSysEx
in interfaceMidiListener
-