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.

Variable Index

 o controlNameFor
Array with Controller-name for Controller-number as index.
 o noteNameFor
Array with Note-name for pitchvalue MODULO 12 as index.
 o programNameFor
Array with GM-Instrument-name for Program-number as index.

Constructor Index

 o MIDIEventUtil()

Method Index

 o channelToText(int)
Returns String representing MIDI-channel.
 o eventLength(int)
Returns number of dataBytes for voice-message.
 o getControlText(MIDIEvent)
Returns String representing ControlChange-event.
 o getControlValue(MIDIEvent, FileInputStream)
Reads ControlChange-data from specified file to MIDI-event.
 o getNoteText(MIDIEvent)
Returns String representing NoteOn-, NoteOff- or AfterTouch-event.
 o getNoteValue(MIDIEvent, FileInputStream)
Reads NoteOn-, NoteOff- and AfterTouch-data from specified file to MIDI-event.
 o getPitchText(MIDIEvent)
Returns String representing PitchBend-event.
 o getPitchValue(MIDIEvent, FileInputStream)
Reads PitchBend-data from specified file to MIDI-event.
 o getPressText(MIDIEvent)
Returns String representing Pressure-event.
 o getPressValue(MIDIEvent, FileInputStream)
Reads Pressure-data from specified file to MIDI-event.
 o getProgramText(MIDIEvent)
Returns String representing ProgramChange-event.
 o getProgramValue(MIDIEvent, FileInputStream)
Reads ProgramChange-data from specified file to MIDI-event.
 o textToChannel(String)
Returns MIDI-channel represented by String.
 o textToNote(String)
Returns pitch-value represented by String.
 o valueToText(int, MIDIEvent)
Returns String representing one dataByte of MIDI-event.

Variables

 o noteNameFor
 static final String noteNameFor[]
Array with Note-name for pitchvalue MODULO 12 as index.

 o programNameFor
 static final String programNameFor[]
Array with GM-Instrument-name for Program-number as index.

 o controlNameFor
 static final String controlNameFor[]
Array with Controller-name for Controller-number as index.

Constructors

 o MIDIEventUtil
 public MIDIEventUtil()

Methods

 o 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.

 o channelToText
 static String channelToText(int status)
Returns String representing MIDI-channel of statusByte status (lower 4bit).

 o textToChannel
 static int textToChannel(String s) throws MIDIException
Returns MIDI-channel reprsented by String s.
Throws Exception if an error occurs.

 o textToNote
 static int textToNote(String s) throws MIDIException
Returns pitch-value represented by String s.
Throws Exception if an error occurs.

 o 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.

 o 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.

 o 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!

 o getControlText
 static String getControlText(MIDIEvent e) throws MIDIException
Returns String representing ControlChange-event e.
Throws Exception in e is not a ControlChange-event.

 o 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!

 o getProgramText
 static String getProgramText(MIDIEvent e) throws MIDIException
Returns String representing ProgramChange-event e.
Throws Exception in e is not a ProgramChange-event.

 o 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!

 o getPressText
 static String getPressText(MIDIEvent e) throws MIDIException
Returns String representing Pressure-event e.
Throws Exception in e is not a Pressure-event.

 o 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!

 o getPitchText
 static String getPitchText(MIDIEvent e) throws MIDIException
Returns String representing PitchBend-event e.
Throws Exception in e is not a PitchBend-event.

 o 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!