org.jfugue
Class MidiParser

java.lang.Object
  extended by org.jfugue.Parser
      extended by org.jfugue.MidiParser

public final class MidiParser
extends Parser

Parses MIDI data, whether from a file, a connected device, or some other stream.

Version:
4.0.3 - A Note event with 0 duration is now sent when a note is first encountered

Field Summary
 
Fields inherited from class org.jfugue.Parser
TRACING_OFF, TRACING_ON
 
Constructor Summary
MidiParser()
           
 
Method Summary
 void parse(javax.sound.midi.MidiMessage message, long timestamp)
          Delegator method that calls specific parsers depending on the type of MidiMessage passed in.
 void parse(javax.sound.midi.Sequence sequence)
          Parses a Sequence and fires events to subscribed ParserListener interfaces.
 
Methods inherited from class org.jfugue.Parser
addParserListener, addParserProgressListener, getTracing, removeParserListener, removeParserProgressListener, setTracing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MidiParser

public MidiParser()
Method Detail

parse

public void parse(javax.sound.midi.Sequence sequence)
Parses a Sequence and fires events to subscribed ParserListener interfaces. As the Sequence is parsed, events are sent to ParserListener interfaces, which are responsible for doing something interesting with the music data, such as adding notes to a pattern.

Parameters:
sequence - the Sequence to parse
Throws:
java.lang.Exception - if there is an error parsing the pattern

parse

public void parse(javax.sound.midi.MidiMessage message,
                  long timestamp)
Delegator method that calls specific parsers depending on the type of MidiMessage passed in.

Parameters:
message - the message to parse
timestamp - the time at which the message was encountered in this track