Thanks again for the review (nitpick?)
midihelper.h has no construct like
OK. It has now, but it is only ever included in one file which is protected from re-inclusion.
n++; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< extra n++ in the loop? why ?
Left over from when it was a while loop. Should not affect the functionality though, as the for loop is just a way to limit too many events. Effectively halves the (arbitrary) limit.
if there is an error should you not close the file ?
Yes absolutely. Interesting is that SDFat did not fail over eepeated teationg with a fle that was not correct. It must handle the case of the open file (or maybe it just doesn't care?).
some var names are still cryptic e.g. c
This is picky. The char array is local to a block of 5 lines of code! To keep you happy I have renamed it 'h'
Clearly so. I'll do some testing as the original code was proposed as the right code to process the varlen parameters by the MIDI organisation.
#DEFINE DUMPLN(T) Serial.println(T) ??
The philosophy adopted in the DUMP output is that the \n is at the start of the new line, not at the end of the previous one. This makes it cleaner as I can't always tell where the end may be but am sure when I start a new line. So I need to explicitely use '\n' when I want it. It also makes it easier if I want to add debug as I don't need to worry about the line endings sprinkled through the code.
style diff between the #ifdef used for void MFTrack::dump(void) and void MIDIFile::dump(void)
I assume you mean in the header file for the class definition?
I wanted to keep the dump function prototype available at all times so that I don't need #if in the sketch code around a call to the dump() method, even if it is an empty function. However, in the classes, the #if switch will cut out all the code for the MFTRack class, as this is only called by MIDIFile.dump().
I suppose an alternative is an empty inline definition in the class dependent on the #if, but the result isthe same.