* The parameter is the number of times to loop, e.g. Y103,2: will play
the sound twice. This still does not work on Windows because
PlaySound() does not support specifying the loop count.
* Get AMSE data size from its header. This fixes audio glitch at the end
of sounds.
Before this, MIDI playback was done by generating an SMF data stream,
which was then played using platform-specific methods (MCI on Windows,
MediaPlayer on Android, SDL_Mixer on other platforms). However, this
approach had an issue where the Y18 command (which reads loop counts and
markers) did not work correctly.
With this change, the MAKOMidi class now uses the RtMidi library to
control MIDI devices in real-time. This approach was used in the
original "System3 for win32", but has now been made cross-platform.
The dependency on RtMidi is optional. If RtMidi is not available at
build time or a MIDI device is unavailable at runtime, FM synthesis will
be used.
The MIDI synthesizer bundled with SDL_Mixer doesn't sound as good as
Windows' built-in software synthesizer.
This adds Windows native implementation of MAKO as win/mako.cpp. It
plays MIDI by writing out SMF to a temporary file and play it with MCI.
CD emulation (--playlist) is also implemented using MCI.
The PCM implementation is copyed from TOTO's original Win32 impl.
This removes SDL_mixer dependency in Windows.
Fixes#1.