The internal data structures of the Standard MIDI File Library is simple and fully commented in the source code; the first data structure we meet is a packed array of bytes, declared as follows:
TYPE MIDIdata = PACKED ARRAY [0..3] OF BYTE;
and is the data structure in which all the data bytes will be stored before the writing or after the reading of a Standard MIDI File; please, remember to deallocate the memory it uses, after handling in the opportune way the informations, in order to prevent memory from undesirable fragmentation. This array has a length of four bytes because in the first position, we will keep its actual length information, and in the following, the effective data bytes; no MIDI channel message may be longer than three bytes, and that's the reason of its length. So, we pass this structure to each opportune writing function, while, in case of reading context, we use it to temporarily store the data bytes, before rewriting them on a file. So if you write, for instance, a NOTE ON message, you will behave as follows:
Text : str255;
in it, the SMFAppl stores the bytes to be written or read concerning a System Exclusive message, or some kind of MIDI Meta Events. This is because in it, no long messages or meta events are implemented in the MIDI File sample, but each application should eventually customize this data structure with a more powerful one, depending on what it wants to perform. However, if you think to write a Text Meta Event, for instance, you would behave as follows:
[ Index | Glossary | Previous Paragraph | Next Paragraph ]