Package org.jjazz.midi.api.parser
Class MidiParserListenerAdapter
java.lang.Object
org.jjazz.midi.api.parser.MidiParserListenerAdapter
- All Implemented Interfaces:
MidiParserListener
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when the parser has parsed its last item.void
Called when the parser first starts up, but before it starts parsing anything.void
onChannelChanged
(byte channel) Called when the parser encounters a new channel. known as a Voice).void
onChannelPressureParsed
(byte pressure, float positionInBeats) void
onControllerEventParsed
(byte controller, byte value, float positionInBeats) void
onInstrumentParsed
(byte instrument, float positionInBeats) Called when the parser encounters a new instrument selection.void
onLyricParsed
(String lyric, float positionInBeats) void
onMarkerParsed
(String marker, float positionInBeats) void
onMetaEndEvent
(float positionInBeats) Called when the parser encounters the END META Event.void
onNoteParsed
(Note note, float positionInBeats) void
onPitchWheelParsed
(byte lsb, byte msb, float positionInBeats) void
onPolyphonicPressureParsed
(byte key, byte pressure, float positionInBeats) void
onSystemExclusiveParsed
(float positionInBeats, byte... bytes) void
onTempoChanged
(int tempoBPM, float positionInBeats) Called when the parser encounters a new tempo selection.void
onTextParsed
(String name, float positionInBeats) 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.void
onTrackNameParsed
(String name, float positionInBeats)
-
Constructor Details
-
MidiParserListenerAdapter
public MidiParserListenerAdapter()
-
-
Method Details
-
beforeParsingStarts
public void beforeParsingStarts()Description copied from interface:MidiParserListener
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.- Specified by:
beforeParsingStarts
in interfaceMidiParserListener
-
afterParsingFinished
public void afterParsingFinished()Description copied from interface:MidiParserListener
Called when the parser has parsed its last item. Provides listeners with a chance to clean up.- Specified by:
afterParsingFinished
in interfaceMidiParserListener
-
onChannelChanged
public void onChannelChanged(byte channel) Description copied from interface:MidiParserListener
Called when the parser encounters a new channel. known as a Voice). Tracks correspond to MIDI tracks/channels.- Specified by:
onChannelChanged
in interfaceMidiParserListener
- Parameters:
channel
- the new track event that has been parsed
-
onInstrumentParsed
public void onInstrumentParsed(byte instrument, float positionInBeats) Description copied from interface:MidiParserListener
Called when the parser encounters a new instrument selection.- Specified by:
onInstrumentParsed
in interfaceMidiParserListener
- Parameters:
instrument
- the MIDI instrument (program change) value that has been parsed
-
onTempoChanged
public void onTempoChanged(int tempoBPM, float positionInBeats) Description copied from interface:MidiParserListener
Called when the parser encounters a new tempo selection.- Specified by:
onTempoChanged
in interfaceMidiParserListener
- Parameters:
tempoBPM
- The new tempo value
-
onTimeSignatureParsed
public void onTimeSignatureParsed(byte numerator, byte powerOfTwo, float positionInBeats) Description copied from interface:MidiParserListener
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)- Specified by:
onTimeSignatureParsed
in interfaceMidiParserListener
-
onPitchWheelParsed
public void onPitchWheelParsed(byte lsb, byte msb, float positionInBeats) - Specified by:
onPitchWheelParsed
in interfaceMidiParserListener
-
onChannelPressureParsed
public void onChannelPressureParsed(byte pressure, float positionInBeats) - Specified by:
onChannelPressureParsed
in interfaceMidiParserListener
-
onPolyphonicPressureParsed
public void onPolyphonicPressureParsed(byte key, byte pressure, float positionInBeats) - Specified by:
onPolyphonicPressureParsed
in interfaceMidiParserListener
-
onSystemExclusiveParsed
public void onSystemExclusiveParsed(float positionInBeats, byte... bytes) - Specified by:
onSystemExclusiveParsed
in interfaceMidiParserListener
-
onControllerEventParsed
public void onControllerEventParsed(byte controller, byte value, float positionInBeats) - Specified by:
onControllerEventParsed
in interfaceMidiParserListener
-
onLyricParsed
- Specified by:
onLyricParsed
in interfaceMidiParserListener
-
onTrackNameParsed
- Specified by:
onTrackNameParsed
in interfaceMidiParserListener
-
onTextParsed
- Specified by:
onTextParsed
in interfaceMidiParserListener
-
onMarkerParsed
- Specified by:
onMarkerParsed
in interfaceMidiParserListener
-
onNoteParsed
- Specified by:
onNoteParsed
in interfaceMidiParserListener
-
onMetaEndEvent
public void onMetaEndEvent(float positionInBeats) Description copied from interface:MidiParserListener
Called when the parser encounters the END META Event.- Specified by:
onMetaEndEvent
in interfaceMidiParserListener
-