com.softsynth.jmsl.midi
Class DefaultMidiListener

java.lang.Object
  extended by 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:

        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
DefaultMidiListener()
           
 
Method Summary
 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 Detail

DefaultMidiListener

public DefaultMidiListener()
Method Detail

handleNoteOn

public void handleNoteOn(double timeStamp,
                         int channel,
                         int pitch,
                         int velocity)
Specified by:
handleNoteOn in interface MidiListener

handleNoteOff

public void handleNoteOff(double timeStamp,
                          int channel,
                          int pitch,
                          int velocity)
Specified by:
handleNoteOff in interface MidiListener

handlePolyphonicAftertouch

public void handlePolyphonicAftertouch(double timeStamp,
                                       int channel,
                                       int pitch,
                                       int pressure)
Specified by:
handlePolyphonicAftertouch in interface MidiListener

handleControlChange

public void handleControlChange(double timeStamp,
                                int channel,
                                int id,
                                int value)
Specified by:
handleControlChange in interface MidiListener

handleProgramChange

public void handleProgramChange(double timeStamp,
                                int channel,
                                int program)
Specified by:
handleProgramChange in interface MidiListener

handleChannelAftertouch

public void handleChannelAftertouch(double timeStamp,
                                    int channel,
                                    int pressure)
Specified by:
handleChannelAftertouch in interface MidiListener

handlePitchBend

public void handlePitchBend(double timeStamp,
                            int channel,
                            int lsb,
                            int msb)
Specified by:
handlePitchBend in interface MidiListener

handleSysEx

public void handleSysEx(double timeStamp,
                        byte[] data)
Specified by:
handleSysEx in interface MidiListener