Class MIDIEventUtil
java.lang.Object
|
+----MIDIEventUtil
- public class MIDIEventUtil
- extends Object
This class is used by instances of MIDIEvent.class.
If provides neccessary variables and methods, handling MIDI-messages.
-
controlNameFor
- Array with Controller-name for Controller-number as index.
-
noteNameFor
- Array with Note-name for pitchvalue MODULO 12 as index.
-
programNameFor
- Array with GM-Instrument-name for Program-number as index.
-
MIDIEventUtil()
-
-
channelToText(int)
- Returns String representing MIDI-channel.
-
eventLength(int)
- Returns number of dataBytes for voice-message.
-
getControlText(MIDIEvent)
- Returns String representing ControlChange-event.
-
getControlValue(MIDIEvent, FileInputStream)
- Reads ControlChange-data from specified file to MIDI-event.
-
getNoteText(MIDIEvent)
- Returns String representing NoteOn-, NoteOff- or AfterTouch-event.
-
getNoteValue(MIDIEvent, FileInputStream)
- Reads NoteOn-, NoteOff- and AfterTouch-data from specified file to MIDI-event.
-
getPitchText(MIDIEvent)
- Returns String representing PitchBend-event.
-
getPitchValue(MIDIEvent, FileInputStream)
- Reads PitchBend-data from specified file to MIDI-event.
-
getPressText(MIDIEvent)
- Returns String representing Pressure-event.
-
getPressValue(MIDIEvent, FileInputStream)
- Reads Pressure-data from specified file to MIDI-event.
-
getProgramText(MIDIEvent)
- Returns String representing ProgramChange-event.
-
getProgramValue(MIDIEvent, FileInputStream)
- Reads ProgramChange-data from specified file to MIDI-event.
-
textToChannel(String)
- Returns MIDI-channel represented by String.
-
textToNote(String)
- Returns pitch-value represented by String.
-
valueToText(int, MIDIEvent)
- Returns String representing one dataByte of MIDI-event.
noteNameFor
static final String noteNameFor[]
- Array with Note-name for pitchvalue MODULO 12 as index.
programNameFor
static final String programNameFor[]
- Array with GM-Instrument-name for Program-number as index.
controlNameFor
static final String controlNameFor[]
- Array with Controller-name for Controller-number as index.
MIDIEventUtil
public MIDIEventUtil()
eventLength
public static int eventLength(int status) throws MIDIException
- Returns number of dataBytes for statusByte status.
Returns 1 or 2 for voice-messages, 3 for system-messages.
Throws Exception if statusByte is unknown.
channelToText
static String channelToText(int status)
- Returns String representing MIDI-channel of statusByte status (lower 4bit).
textToChannel
static int textToChannel(String s) throws MIDIException
- Returns MIDI-channel reprsented by String s.
Throws Exception if an error occurs.
textToNote
static int textToNote(String s) throws MIDIException
- Returns pitch-value represented by String s.
Throws Exception if an error occurs.
valueToText
static String valueToText(int pos,
MIDIEvent e) throws MIDIException
- Returns String representing value of dataByte at position pos
of dataVector of MIDI-event e.
Throws Exception if an error occurs.
getNoteText
static String getNoteText(MIDIEvent e) throws MIDIException
- Returns String representing NoteOn-, NoteOff- or AfterTouch-event e.
Throws Exception in e is not one of these events.
getNoteValue
static void getNoteValue(MIDIEvent e,
FileInputStream fpp) throws MIDIException
- Reads NoteOn-, NoteOff- and AfterTouch-data from standard MIDI-file fpp.
Throws Exception if an error occurs.
Should only be called by constructor!
getControlText
static String getControlText(MIDIEvent e) throws MIDIException
- Returns String representing ControlChange-event e.
Throws Exception in e is not a ControlChange-event.
getControlValue
static void getControlValue(MIDIEvent e,
FileInputStream fpp) throws MIDIException
- Reads ControlChange-data from standard MIDI-file fpp.
Throws Exception if an error occurs.
Should only be called by constructor!
getProgramText
static String getProgramText(MIDIEvent e) throws MIDIException
- Returns String representing ProgramChange-event e.
Throws Exception in e is not a ProgramChange-event.
getProgramValue
static void getProgramValue(MIDIEvent e,
FileInputStream fpp) throws MIDIException
- Reads ProgramChange-data from standard MIDI-file fpp.
Throws Exception if an error occurs.
Should only be called by constructor!
getPressText
static String getPressText(MIDIEvent e) throws MIDIException
- Returns String representing Pressure-event e.
Throws Exception in e is not a Pressure-event.
getPressValue
static void getPressValue(MIDIEvent e,
FileInputStream fpp) throws MIDIException
- Reads Pressure-data from standard MIDI-file fpp.
Throws Exception if an error occurs.
Should only be called by constructor!
getPitchText
static String getPitchText(MIDIEvent e) throws MIDIException
- Returns String representing PitchBend-event e.
Throws Exception in e is not a PitchBend-event.
getPitchValue
static void getPitchValue(MIDIEvent e,
FileInputStream fpp) throws MIDIException
- Reads PitchBend-data from standard MIDI-file fpp.
Throws Exception if an error occurs.
Should only be called by constructor!