MIDI Plugin / output other than MPD doable?

I am aware this kind of a niche problem, but since this is the “Audiophile” Music Player, I will give it a shot :wink:

Basically I want to play back MIDI files - but not through a software synthesizer, but through real hardware over an USB MIDI interface. To my understanding there would be two ways to achive this. Either trough support in MPD, or by getting volumio to use something different when playing .mid files. It seems support through MPD will be difficult: Support for MIDI output · Issue #1208 · MusicPlayerDaemon/MPD · GitHub - so I wondered if that would be something achievable with a Volumio plugin…

Volumio is very much built around mpd, and “swapping out” of this integral part is just not possible.

And keep in mind, MIDI file contains no actual audio but only contains tempo, volume, velocity, control signal parameters, pitch and some other data.
You need a MIDI player for this.

My 2 cents… Mpd is not the only player in Volumio… Spotify use spop, Spotify connect use a fork of librespot. So we can imagine (I do not have a precise way of doing it)) having a specific player for midi files…

For MPD to deal with MIDI, you need libraries like libwildmidi or FluidSynth.
Then you can play MIDI through aplay.
However this also requires the installation of soundfonts. As the library will do the conversion, which bypasses the external USB MIDI device. Just sending the data stream will not be accepted by MPD.
Or you are going to fully bypass the core of Volumio, hence the remark, Use a MIDI player.

Nice challenge for a plugin writer!!!

I am aware that MPD can play midi files through a software synthesizer library. Unfortutanely both of them don’t support a “dummy” mode where they don’t generate PCM at all but instead write their input to a real MIDI device… Maybe it would be possible to write an input plugin for midi files, that just handles the playback on its own while passing silent PCM data back to MPD, to “fool” it into thinking it was acutally playing back something…