Package org.jjazz.midi.api.parser
Interface MidiParserListener
- All Known Implementing Classes:
MidiParserListenerAdapter
public interface MidiParserListener
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the parser has parsed its last item.voidCalled when the parser first starts up, but before it starts parsing anything.voidonChannelChanged(byte channel) Called when the parser encounters a new channel. known as a Voice).voidonChannelPressureParsed(byte pressure, float positionInBeats) voidonControllerEventParsed(byte controller, byte value, float positionInBeats) voidonInstrumentParsed(byte progChange, float positionInBeats) Called when the parser encounters a new instrument selection.voidonLyricParsed(String lyric, float positionInBeats) voidonMarkerParsed(String marker, float positionInBeats) voidonMetaEndEvent(float positionInBeats) Called when the parser encounters the END META Event.voidonNoteParsed(Note note, float positionInBeats) voidonPitchWheelParsed(byte lsb, byte msb, float positionInBeats) voidonPolyphonicPressureParsed(byte key, byte pressure, float positionInBeats) voidonSystemExclusiveParsed(float positionInBeats, byte... bytes) voidonTempoChanged(int tempoBPM, float positionInBeats) Called when the parser encounters a new tempo selection.voidonTextParsed(String text, float positionInBeats) voidonTimeSignatureParsed(byte numerator, byte powerOfTwo, float positionInBeats) The first parameter is the number of beats per measure; The second parameter is the power by which 2 must be raised to create the note that represents one beat.voidonTrackNameParsed(String name, float positionInBeats)
-
Method Details
-
beforeParsingStarts
void beforeParsingStarts()Called when the parser first starts up, but before it starts parsing anything. Provides listeners with a chance to initialize variables and get ready for the parser events. -
afterParsingFinished
void afterParsingFinished()Called when the parser has parsed its last item. Provides listeners with a chance to clean up. -
onMetaEndEvent
void onMetaEndEvent(float positionInBeats) Called when the parser encounters the END META Event.- Parameters:
positionInBeats-
-
onChannelChanged
void onChannelChanged(byte channel) Called when the parser encounters a new channel. known as a Voice). Tracks correspond to MIDI tracks/channels.- Parameters:
channel- the new track event that has been parsed
-
onInstrumentParsed
void onInstrumentParsed(byte progChange, float positionInBeats) Called when the parser encounters a new instrument selection.- Parameters:
progChange- the MIDI instrument (program change) value that has been parsed
-
onTempoChanged
void onTempoChanged(int tempoBPM, float positionInBeats) Called when the parser encounters a new tempo selection.- Parameters:
tempoBPM- The new tempo value
-
onTimeSignatureParsed
void onTimeSignatureParsed(byte numerator, byte powerOfTwo, float positionInBeats) The first parameter is the number of beats per measure; The second parameter is the power by which 2 must be raised to create the note that represents one beat. Example 1: For a 5/8 time signature, expect 5,3 (since 2^3 = 8) Example 2: For a 4/4 time signature, expect 4,2 (since 2^2 = 4) -
onPitchWheelParsed
void onPitchWheelParsed(byte lsb, byte msb, float positionInBeats) -
onChannelPressureParsed
void onChannelPressureParsed(byte pressure, float positionInBeats) -
onPolyphonicPressureParsed
void onPolyphonicPressureParsed(byte key, byte pressure, float positionInBeats) -
onSystemExclusiveParsed
void onSystemExclusiveParsed(float positionInBeats, byte... bytes) -
onControllerEventParsed
void onControllerEventParsed(byte controller, byte value, float positionInBeats) -
onLyricParsed
-
onTrackNameParsed
-
onTextParsed
-
onMarkerParsed
-
onNoteParsed
-