The "wavetable" support is emulated by FluidSynth with a loadable SoundFont. I have not found an unencumbered General MIDI soundfont that we could distribute legally beyond a reasonable doubt, so it's up to users to obtain and load their own.
FluidSynth can also hook up the default system MIDI IN, and x16emu can tie it to the serial input of the first emulated UART.
FluidSynth's internal MIDI synth audio is mixed into the rest of x16emu's audio, alongside VERA and FM.
Unfortunately, FluidSynth does not present the operating system's MIDI OUT, so the internal synth is currently tied to both UARTs' outputs. With additional work we could use the native MIDI libraries on each operating system to plumb the first UART to a hardware MIDI out in the future.
As FluidSynth runs in its own threads, and MIDI input is event driven with a threaded callback into x16emu code, x16emu needs to handle the buffers in a thread-safe way, so this is the beginning of thread code in x16emu.
fluidsynth is now a build dependency for x16emu but not a strict runtime dependency, as we are using dynamic library loading.
This PR adds serial MIDI support