MIDI in ReactOS

From ReactOS Wiki
Revision as of 08:05, 26 October 2009 by Fred02 (talk | contribs) (Using TiMidity++ for MIDI engine: linked to various TiMidity projects while keeping the original reference)
Jump to: navigation, search

This page describes ideas and development towards the MIDI engine for ReactOS.


Since Windows 95, Microsoft has always included a software synthesizer to play MIDI files. The synthesizer wasn't very good, but it worked. At the time, many sound cards already supplied a hardware-based synthesizer that was much better than the software one. As computers got better at playing audio and disk space increased, the need to use MIDI to play music in games and other applications was reduced. Also, as computers advanced and the CPU because more capable of handling many different tasks at once, sound cards began to lose functionality at the hardware level and have it implemented at the software level. As a result, MIDI was relegated to primarily retro game development, small/amateur game development, music composition, and professional audio and music work.

Nowadays, it is pretty rare to find a sound card with a built in MIDI synthesizer or even a MIDI port at all. However, MIDI is still used, and must be implemented to complete the audio subsystem in ReactOS, including a softsynth to use when the sound card doesn't support MIDI.

Suggestions for MIDI support

A discussion on the forums started by Nintendo Maniac 64 indicated that MIDI support was still desired, but it was requested to have SoundFont support in it.

Using TiMidity++ for MIDI engine

forart suggested using TiMidity++/TiMidity++ Windows Synthesizer/libTiMidity for the basis of the MIDI engine in ReactOS, as all the components are readily available.

However, Pharaoh_Atem has said that TiMidity has issues playing MIDI files with SoundFonts as well as being quite old (the last release was five years ago) and not ready for 64-bit Windows.

Also, TiMidity does not require the usage of SoundFonts to set up the instrument bank. In fact, in Fedora Linux, an instrument patchset is used instead.

Using FluidSynth for MIDI engine

Unlike TiMidity, which hasn't been updated in five years, FluidSynth is still being actively developed. FluidSynth closely follows the SoundFont 2.0 specification and requires the use of a SoundFont to play back MIDI.

FluidSynth cannot be compiled as a player in Windows, only as a supporting DLL or static library.

Pharaoh_Atem suggested using libfluidsynth (as a DLL) as the basis for the MIDI engine

Since libfluidsynth is only ~245KB as a DLL, it wouldn't place too much of a burden on including it as part of the core distribution.

A lightweight SoundFont (TimGM6mb.sf2) was chosen as well.

Other soundfonts could be found here and here.

A discussion was started by Nintendo Maniac 64 in the Feedback & Suggestions category suggesting the use of FluidSynth to make the MIDI engine.

In that discussion, Pharaoh_Atem posted that he uploaded the source and binary libraries of libfluidsynth 1.0.9 for Windows compiled with MinGW along with Code::Blocks project files, which are to be extracted in the root of the source archive.

Current Situation in ReactOS

There is currently no MIDI support in the audio subsystem. Considering that the rest of it barely works as-is, this is not so much an issue right now.

MSDN Information and Samples Regarding MIDI Drivers