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

Main header file for the MD_MIDIFile library. More...

#include <Arduino.h>
#include <SdFat.h>
+ Include dependency graph for MD_MIDIFile.h:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  midi_event
 
struct  sysex_event
 
struct  meta_event
 
class  MD_MFTrack
 
class  MD_MIDIFile
 

Macros

#define DUMP_DATA   0
 
#define SHOW_UNUSED_META   0
 
#define MIDI_MAX_TRACKS   16
 
#define TRACK_PRIORITY   1
 
#define SD_FAT_TYPE   0
 
#define ARRAY_SIZE(a)   (sizeof(a)/sizeof((a)[0]))
 
#define DUMPS(s)
 Print a string.
 
#define DUMP(s, v)
 Print a value (decimal)
 
#define DUMPX(s, x)
 Print a value (hex)
 

Typedefs

typedef SdFat SDFAT
 SDFat class used.
 
typedef File SDDIR
 File type for folders.
 
typedef File SDFILE
 File type for files.
 

Detailed Description

Main header file for the MD_MIDIFile library.

Macro Definition Documentation

◆ DUMP_DATA

#define DUMP_DATA   0

Set to 1 to to dump the file data instead of processing callback. Neither SHOW_UNUSED_META nor DUMP_DATA should be set to 1 when MIDI messages are being transmitted through the serial port as Serial.print() functions are called to print information to the serial monitor.

◆ MIDI_MAX_TRACKS

#define MIDI_MAX_TRACKS   16

Max number of MIDI tracks. This may be reduced or increased depending on memory requirements. 16 tracks is the maximum available to any MIDI device. Fewer tracks may not allow many MIDI files to be played, while a minority of SMF may require more tracks.

◆ SD_FAT_TYPE

#define SD_FAT_TYPE   0

Defines the type of file system that is supported by the SDFat library

  • SD_FAT_TYPE = 0 for SdFat/File as defined in SdFatConfig.h,
  • SD_FAT_TYPE = 1 for FAT16/FAT32,
  • SD_FAT_TYPE = 2 for exFAT,
  • SD_FAT_TYPE = 3 for FAT16/FAT32/exFAT.

The library and application code should use the typedefs SDFAT, SDFILE, SDDIR

◆ SHOW_UNUSED_META

#define SHOW_UNUSED_META   0

Set to 1 to display unused META messages. DUMP_DATA must also be enabled for this to have an effect. Neither SHOW_USED_META nor DUMP_DATA should be set to 1 when MIDI messages are being transmitted through the serial port as Serial.print() functions are called to print information to the serial monitor.

◆ TRACK_PRIORITY

#define TRACK_PRIORITY   1

Events may be processed in 2 different ways. One way is to give priority to all events on one track before moving on to the next track (TRACK_PRIORITY) or to process one event from each track and cycling through all tracks round robin fashion until no events are left to be processed (EVENT_PRIORITY). This macro definition enables the mode of operation implemented in getNextEvent().