MIDI in ReactOS

From ReactOS Wiki
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.

Timidity also has source code for a Win32 driver in its trunk. Reliability is questionable, given that the code hasn't been touched in 2-3 years. It also cannot be built against release versions of Timidity.

Using FluidSynth for MIDI engine

FluidSynth is still being developed, even if official releases are rare and more than a year apart (1.0.9 @ April 2009 and 1.1.0 @ November 2009), however 1.1.0 and newer releases require GLib. FluidSynth closely follows the SoundFont 2.0 specification and requires the use of a SoundFont to play back MIDI.

FluidSynth cannot be easily compiled as a player in Windows, only as a supporting DLL or static library. With some difficulty with different supporting libraries and MSYS, it is possible to compile the FluidSynth CLI player.

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 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.

He later made available a full binary/source package of fluidsynth (including libfluidsynth) 1.0.9.

  • Idea: Aforementioned Timidity Win32 driver could be used to help write a MIDI driver based on libfluidsynth?

Example SoundFonts

The audio quality and filesize are usually proportional (larger = better sounding).

It may be possible to include these and maybe other higher-quality soundfonts in "Download!" or whatever package manager is being used by then.

Other soundfonts could be found here and here.

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. An adventurous tester may try to install TiMidity++/TiMidity++ Windows Synthesizer and report the errors on the bug list, also probably no developer will have a look at it at present.

MSDN Information and Samples Regarding MIDI Drivers

Related Issues