Strange MIDI sound after building Player on Windows

Hi! I’m currently trying to get the Player build to run properly since I’d like to make some custom modifications.
And the build itself does run (after some messing around), and the player starts fine, but for some reason all MIDIs sound pretty awful. If I download the official build, they sound just like they should (identical to RM2000). Do I need to set something specific to get it to use the right MIDI synth or something?

Could you post the configuration summary displayed after invoking CMake?

Sure. Here it is:

1> CMake generation started for configuration: ‘x64-Release’.
1> The toolchain file has changed (CMAKE_TOOLCHAIN_FILE).
1> Command line: “cmd.exe” /c ““C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe” -G “Ninja” -DCMAKE_BUILD_TYPE:STRING=“RelWithDebInfo” -DCMAKE_INSTALL_PREFIX:PATH=“C:\Users\xxx\Source\Repos\Player\out\install\x64-Release” -DCMAKE_TOOLCHAIN_FILE:FILEPATH=“C:/Tools/buildscripts-master/windows/vcpkg/scripts/buildsystems/vcpkg.cmake” -DPLAYER_BUILD_LIBLCF:BOOL=“True” -DCMAKE_CXX_COMPILER:FILEPATH=“C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe” -DSHARED_RUNTIME=OFF -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_MAKE_PROGRAM=“C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe” “C:\Users\xxx\Source\Repos\Player” 2>&1”
1> Working directory: C:\Users\xxx\Source\Repos\Player\out\build\x64-Release
1> [CMake] – The CXX compiler identification is MSVC 19.27.29111.0
1> [CMake] – Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
1> [CMake] – Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
1> [CMake] – Detecting CXX compiler ABI info
1> [CMake] – Detecting CXX compiler ABI info - done
1> [CMake] – Detecting CXX compile features
1> [CMake] – Detecting CXX compile features - done
1> [CMake] – Windows: Using static runtime library (/MT)
1> [CMake] – Found SDL2: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/SDL2.lib (Required is at least version “2.0.5”)
1> [CMake] – Windows: Using static runtime library (/MT)
1> [CMake] – Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
1> [CMake] – Found the following ICU libraries:
1> [CMake] – i18n (required)
1> [CMake] – uc (required)
1> [CMake] – data (required)
1> [CMake] – data (required)
1> [CMake] – Found ICU: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/include (found version “65.1”)
1> [CMake] – Found EXPAT: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/expat.lib (found version “2.2.7”)
1> [CMake] – Found ZLIB: optimized;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/zlib.lib;debug;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/debug/lib/zlibd.lib (found version “1.2.11”)
1> [CMake] – Found PNG: optimized;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/libpng16.lib;debug;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/debug/lib/libpng16d.lib (found version “1.6.37”)
1> [CMake] – Found Pixman: optimized;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/pixman-1.lib;debug;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/debug/lib/pixman-1d.lib
1> [CMake] – Found Freetype: optimized;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/freetype.lib;debug;C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/debug/lib/freetyped.lib (found version “2.10.2”)
1> [CMake] – Found Harfbuzz: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/harfbuzz.lib
1> [CMake] – Found SDL2_mixer: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/SDL2_mixer.lib
1> [CMake] – Found speexdsp: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/libspeexdsp.lib
1> [CMake] – Found mpg123: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/libmpg123.lib
1> [CMake] – Found LibSndFile: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/libsndfile.lib
1> [CMake] – Found Vorbisfile: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/vorbisfile.lib
1> [CMake] – Found Opusfile: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/opusfile.lib
1> [CMake] – Found WildMidi: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/wildmidi.lib
1> [CMake] – Found XMP: C:/Tools/buildscripts-master/windows/vcpkg/installed/x64-windows-static/lib/libxmp-lite.lib
1> [CMake] – Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
1> [CMake] –
1> [CMake] – Target system: SDL2
1> [CMake] –
1> [CMake] – liblcf: Built from https://github.com/EasyRPG/liblcf.git
1> [CMake] –
1> [CMake] – Audio backend: SDL2_mixer
1> [CMake] –
1> [CMake] – WAV playback: libsndfile
1> [CMake] – MIDI playback: WildMidi. Fallback to built-in (FmMidi)
1> [CMake] – MP3 playback: mpg123
1> [CMake] – Ogg Vorbis playback: libvorbis
1> [CMake] – MOD playback: libxmp
1> [CMake] – Opus playback: opusfile
1> [CMake] – Resampler: speexdsp
1> [CMake] –
1> [CMake] – Font rendering: Freetype with Harfbuzz / built-in
1> [CMake] –
1> [CMake] – Configuring done
1> [CMake] – Generating done
1> [CMake] – Build files have been written to: C:/Users/xxx/source/repos/Player/out/build/x64-Release
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted includes paths.
1> CMake generation finished.

I assume you used our github.com/easyrpg/buildscripts to compile the vcpkg dependencies?

Your build and configuration looks completely fine.

But I see the problem now: We always use the latest version of vcpkg and they updated there packages (again)…
You must edit the build.cmd in the repository and replace “sdl2-mixer[core]” with “sdl2-mixer[core,nativemidi]”. Just rerun build.cmd afterwards, it should only recompile this one package.

To explain your issue: It is currently not possible to configure this but the Midi order is the following:
WildMidi (looks for a wildmidi.cfg in the game dir) -> SDL-mixer Native MIDI (this is what you expect) -> FmMidi (Fallback, this sounds “electronical”).
Because native MIDI was not enabled it falls back to FmMidi.

We currently work on a better internal midi support which does not depend on SDL Mixer anymore (it has some limitations, e.g. Volume and Speed control are not working properly)

OK, got it!
In addition to the change in the cmd you mentioned, I also had to add the --recurse option, otherwise it wouldn’t build again. But after that it worked fine and now the MIDIs sound like they should.
Thanks a lot!