MIDI in ReactOS
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
Using TiMidity++ for MIDI engine
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.
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.
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?
The audio quality and filesize are usually proportional (larger = better sounding).
- Vintage Dreams Waves v2 + steel drums (298 KB) NOTE: nearly 8-bit sounding (Original version)
- TimGM6mb (5.71 MB)
- GeneralUser GS v1.43 (29.8 MB)
- Unison (23.4 MB) and PersonalCopy v5.1f (53.7 MB)
- Fluid - Release 3 (145MB)
- SGM-V2.01 (235 MB)
- Crisis General Midi v3.01 (1.57 GB) NOTE: sound quality is AMAZING, but it has some volume imbalances & missing sounds
It may be possible to include these and maybe other higher-quality soundfonts in "Download!" or whatever package manager is being used by then.
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
- Windows Driver Kit Table of Contents
- DMusUART Sample Driver
- FMSynth Sample Driver
- MPU-401 Sample Driver
- CORE-8806 - MIDI playback doesn't work