Reading the MIDI file specifications, I think you can start creating anything like
public class MIDIFile {
enum FileFormat {
single_track,
syncronous_multiple_tracks,
assyncronous_multiple_tracks;
}
FileFormat file_format;
short numberOfTracks;
short deltaTimeTicks;
//Create Class for tracks, events, put some collection for storing the tracks,
//some collection for storing the events inside the tracks, etc
//Collection<Integer, MIDITrack> the type of Collection depends on application
}
public class MIDITrack {
int length;
//Collection<MIDIEvent> the type of Collection depends on application
}
public class MIDIEvent {
int delta_time;
int event_type; //Use of enum or final variables is interesting
int key;
int velocity;
}
If you only want to store MIDI messages (so not MIDI file), you could do a Class for the messages
public class MIDIEvent {
int delta_time;
int channel;
int event_type; //Use of enum or final variables is interesting
//two bytes, interpret according the message type
byte byte0;
byte byte1;
//or more memory consuming
byte key;
byte pressure;
byte controller;
short bend;
}
The type of Collection you use to store will be application specific, how you want to access the elements of the list, and much more.
If you just want to insert the MIDIMessages in the Collection and then read from the first to last you could use a LinkedList (that's an implementation of List). But if you want to modify the messages and access elements by an index, you would want to use an ArrayList (that's an implementation of List too).
Information of the MIDI file structure from http://faydoc.tripod.com/formats/mid.htm