![]() |
MD_MIDIFile Standard MIDI File Processing
2.2
Library to play Standard MIDI Files (SMF)
|
Header file for helper functions definitions. More...
Macros | |
#define | MTHD_HDR "MThd" |
SMF marker. | |
#define | MTHD_HDR_SIZE 4 |
SMF marker length. | |
#define | MTRK_HDR "MTrk" |
SMF track header marker. | |
#define | MTRK_HDR_SIZE 4 |
SMF track header marker length. | |
#define | BUF_SIZE(x) (sizeof(x)/sizeof(x[0])) |
Buffer size macro. | |
#define | MB_LONG 4 |
readMultibyte() parameter specifying expected 4 byte value | |
#define | MB_TRYTE 3 |
readMultibyte() parameter specifying expected 3 byte value | |
#define | MB_WORD 2 |
readMultibyte() parameter specifying expected 2 byte value | |
#define | MB_BYTE 1 |
readMultibyte() parameter specifying expected 1 byte value | |
Functions | |
uint32_t | readMultiByte (SdFile *f, uint8_t nLen) |
uint32_t | readVarLen (SdFile *f) |
void | dumpBuffer (uint8_t *p, int len) |
Header file for helper functions definitions.
void dumpBuffer | ( | uint8_t * | p, |
int | len | ||
) |
Dump a block of data stream
During debugging, this method provides a formatted dump of data to the debug output stream.
The DUMP_DATA macro define must be set to 1 to enable this method.
p | pointer to the data buffer. |
len | size of the data buffer. |
uint32_t readMultiByte | ( | SdFile * | f, |
uint8_t | nLen | ||
) |
Read a multi byte value from the input stream
SMF contain numbers that are fixed length. This function reads these from the input file.
*f | pointer to SDFile object to use for reading. |
nLen | one of MB_LONG, MB_TRYTE, MB_WORD, MB_BYTE to specify the number of bytes to read. |
uint32_t readVarLen | ( | SdFile * | f | ) |
Read a variable length parameter from the input stream
SMF contain numbers that are variable length, with the last byte of the number identified with bit 7 set. This function reads these from the input file.
*f | pointer to SDFile object to use for reading. |