Creating an ultralight MIDI player requires careful consideration of resource utilization to ensure it can run on devices with limited capabilities. Here are some useful papers and guidelines that could help in making an efficient MIDI player:
You want dynamic music that changes with gameplay. Instead of streaming MP3s (which spike CPU on loop), use ultralight MIDI: ultralight midi player resource pack work
Run the MIDI player on a headless server (no monitor, no keyboard). Send MIDI signals via UDP or WebSockets. This allows one powerful machine to serve ultralight MIDI playback to dozens of thin clients. The "work" becomes distributed. The Config Script (2KB): 3
But calling it a "player" is like calling a Formula 1 car a "transportation device." It is an instrument. use ultralight MIDI:
If using TiMidity++, create a configuration file (timidity.cfg) that points to your tiny .sf2 file: