MD_MIDIFile Standard MIDI File Processing 2.6
Library to play Standard MIDI Files (SMF)
MD_MIDIHelper.cpp File Reference

Main file for helper functions implementation. More...

#include <string.h>
#include <MD_MIDIFile.h>
#include "MD_MIDIHelper.h"
+ Include dependency graph for MD_MIDIHelper.cpp:

Functions

uint32_t readMultiByte (SDFILE *f, uint8_t nLen)
 
uint32_t readVarLen (SDFILE *f)
 

Detailed Description

Main file for helper functions implementation.

Function Documentation

◆ readMultiByte()

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.

Parameters
*fpointer to SDFile object to use for reading.
nLenone of MB_LONG, MB_TRYTE, MB_WORD, MB_BYTE to specify the number of bytes to read.
Returns
the value read as a 4 byte integer. This should be cast to the expected size if required.

◆ readVarLen()

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.

Parameters
*fpointer to SDFile object to use for reading.
Returns
the value read as a 4 byte integer. This should be cast to the expected size if required.