Small and simple MIDI jukebox library for MD_MIDIFile and LittleFS.
Since I need one program that I can shuffle the MIDI files in a directory inside an embedded system like Arduino, why not I just write one? :D
Just create a new PlayList object at startup with default shuffle and at root directory such as:
PlayList playlist("/", true);
If you need to move to next file after playing, just call this (make sure on your side you do your cleanup such as silence MIDI file and etc!):
playlist.next();
Currently the random number generator is using RP2040/RP2350's hardware pseudo-random generator - you may need to substitute this rp2040.hwrand32() for your own version if your are doing it at another platform!
You may need to also make sure that the MIDI files in your storage is less than the maximum number of MIDI files in the list: MAX_NUMBER_SONGS. If your MIDI files exceed this one it returns an empty playlist!