Interface MIDIFileListener

All Known Implementing Classes:
MIDIFileImage, MIDIFileListenerTest, MIDIFilePrinter, MIDIFileToMusicShape

public interface MIDIFileListener
MIDI File Listener This class is called by the MIDI File Input Stream when it parses MIDI Files.
Author:
Phil Burk (C) 1999 SoftSynth.com
  • Method Summary

    Modifier and Type Method Description
    void handleBeginTrack​(int index)
    Called at the beginning of each track
    void handleEndTrack​(int index)
    Called at the end of each track
    void handleEvent​(int ticks, int command, int data1, int data2)
    Called when a MIDI Message event is encountered.
    void handleHeader​(int format, int numTracks, short division)
    Called when the header is parsed.
    void handleMetaEvent​(int ticks, int type, byte[] b)
    Called when a MetaEvent is encountered.
    void handleSysExF0​(int ticks, byte[] b)
    Called when an F0 SysEx event is encountered.
    void handleSysExF7​(int ticks, byte[] b)
    Called when an F7 SysEx event is encountered.
  • Method Details

    • handleHeader

      void handleHeader​(int format, int numTracks, short division)
      Called when the header is parsed.
      Parameters:
      format - Format of file. 0, 1 or 2.
      numTracks -
      division -
    • handleBeginTrack

      void handleBeginTrack​(int index)
      Called at the beginning of each track
      Parameters:
      index - Track index starting at zero
    • handleEndTrack

      void handleEndTrack​(int index)
      Called at the end of each track
      Parameters:
      index - Track index starting at zero
    • handleSysExF0

      void handleSysExF0​(int ticks, byte[] b)
      Called when an F0 SysEx event is encountered.
      Parameters:
      ticks - MIDIFile time-stamp
      b - bytes read from file for SysEx. May be null.
    • handleSysExF7

      void handleSysExF7​(int ticks, byte[] b)
      Called when an F7 SysEx event is encountered.
      Parameters:
      ticks - MIDIFile time-stamp
      b - bytes read from file for SysEx. May be null.
    • handleMetaEvent

      void handleMetaEvent​(int ticks, int type, byte[] b)
      Called when a MetaEvent is encountered.
      Parameters:
      ticks - MIDIFile time-stamp
      type - MetaEvent type, from 0 to 127.
      b - bytes read from file for SysEx. May be null.
    • handleEvent

      void handleEvent​(int ticks, int command, int data1, int data2)
      Called when a MIDI Message event is encountered.
      Parameters:
      ticks - MIDIFile time-stamp
      command - MIDI Command, eg. NOTE_ON.
      data1 - First data byte of message.
      data2 - Second optional data byte of message.