Attached test binary of dosbox-SVN (r3871) which includes the updated fluidsynth patch and also attached the patch file itself. Includes fix for issue of "missing drum kit", however, nearly all credit to Matt Giuca for his patch.
For this new patch, modify dosbox.conf settings as follows:
mididevice=fluidsynth
midiconfig=dsound:WeedsGM3.sf2
Where midiconfig has values of "audio driver" and a compatible "soundfont" separated by the ":" delimiter character. Note that for Windows, the audio driver is always dsound. As previously, the fluidsynth function is dependent on the fluidsynth library and its dependencies (win32 versions included in attached archive).
For other operating systems, the following audio drivers are recognized by fluidsynth (may require additional dependencies): pulseaudio, alsa, oss, coreaudio, portaudio, sndman, jack.
I tried the other patch, it did compile cleanly but I never managed to get any sound out of it, I also did remove at some point the driver stuff, since it's useless for my Win. Based build.
It does work as it should, thanks 😀
Edit: I removed the driver parts since in Windows they're useless and lead to bigger config strings and it works just fine.
Edit: attached fluidsynth DLL which was built from recent fluidsynth source code (revised on 9/24/14). This is newer than the fluidsynth DLL, version 1.1.16 (8/16/12), archived with the binary posted earlier in this thread (dosbox-3-GM-reverb.zip).
Attached is a single DLL file, so replace fluidsynth-1.dll in the above archive with this attached DLL file, and then run that archived dosbox as usual. Note this is a win32 build via mingw32/gcc which required a patch to source code. This patch is also in the attached archive; it was created by reverting a code change between version 1.1.16 and this latest codebase. A 2nd patch is likewise included for satisfactory levels of chorus and reverb (same as posted earlier in this thread); this patch was applied to this updated DLL.
Attached a new patch based on the work of truth5678 and Matt Giuca; it removes the need for patching Fluidsynth's synth.h (though you may or may not want to patch ipv6 with truth5678's patch if using code from Fluidsynth's git) and gives the user control over most of Fluidsynth's parameters using DosBox.conf (with its own parameters, not midiconf).
The exposed options (from a sample DosBox.conf help) are:
1fluid.driver: Driver to use with Fluidsynth, not needed under Windows. Available drivers depend on what Fluidsynth was compiled with 2Possible values: pulseaudio, alsa, oss, coreaudio, dsound, portaudio, sndman, jack, file, default. 3fluid.soundfont: Soundfont to use with Fluidsynth. One must be specified. 4fluid.samplerate: Sample rate to use with Fluidsynth. 5fluid.gain: Fluidsynth gain. 6fluid.polyphony: Fluidsynth polyphony. 7fluid.cores: Fluidsynth CPU cores to use, default. 8fluid.periods: Fluidsynth periods. 9fluid.periodsize: Fluidsynth period size. 10fluid.reverb: Fluidsynth use reverb. 11Possible values: no, yes. 12fluid.chorus: Fluidsynth use chorus. 13Possible values: no, yes. 14fluid.reverb,roomsize: Fluidsynth reverb room size. 15fluid.reverb.damping: Fluidsynth reverb damping. 16fluid.reverb.width: Fluidsynth reverb width. 17fluid.reverb.level: Fluidsynth reverb level. 18fluid.chorus.number: Fluidsynth chorus voices 19fluid.chorus.level: Fluidsynth chorus level. 20fluid.chorus.speed: Fluidsynth chorus speed. 21fluid.chorus.depth: Fluidsynth chorus depth. 22fluid.chorus.type: Fluidsynth chorus type. 0 is sine wave, 1 is triangle wave. 23Possible values: 0, 1.
These options default to what are considered "nice" values for gaming.
A small modification to bloodbat's patch is attached. It includes the necessary changes to configure.ac. On POSIX systems, it also does shell-expansion of soundfont paths. That means that they'll work if they contain dollar signs (environment variables) and tildes (to signify user directories).
I would like to add support for fluidsynth to my DOSBox build, but for some reason, I can't get it right. I'm using MinGW+MSYS in Windows, but get some warnings during ./configure:
1configure: WARNING: *** Could not find fcntl.h and/or ioctl.h which are required for sound and midi support 2configure: WARNING: *** Could not find MidiShare.h, disabling MidiShare driver
Does anyone have an idea how I can get fluidsynth compiled under in my environment? GTK+ libraries are installed, MinGW + SYS are up to date. Do I need any other sound driver else than dsound under Windows? And is libsndfile requiered?
Yesterplay80 wrote:I would like to add support for fluidsynth to my DOSBox build, but for some reason, I can't get it right. I'm using MinGW+MSYS i […] Show full quote
I would like to add support for fluidsynth to my DOSBox build, but for some reason, I can't get it right. I'm using MinGW+MSYS in Windows, but get some warnings during ./configure:
1configure: WARNING: *** Could not find fcntl.h and/or ioctl.h which are required for sound and midi support 2configure: WARNING: *** Could not find MidiShare.h, disabling MidiShare driver
Does anyone have an idea how I can get fluidsynth compiled under in my environment? GTK+ libraries are installed, MinGW + SYS are up to date. Do I need any other sound driver else than dsound under Windows? And is libsndfile requiered?
The version I used in my build, is compiled statically into dosbox, but I used a version that removed all the glib dependencies, which might not be an issue on MINGW.
I'll attach an entire patch against the 1.1.6 svn if it will help, but I think honestly you just need to define those to zero so it doesn't try to build parts it doesn't use.
The attached patch turns the 1.1.6 svn into the version at https://github.com/kirbyfan64/fluidsynth (glib-removal) and finishes the glib removal bits (mostly just removing glib.h) but if you're wondering why all the #include patches were changed, that was because I put the files directly into the dosbox MSVC project, so you might be able to just figure out what you need from that.
Maybe try with older Fluidsynth versions and go from there
I went back until 1.0.9, but none would work.
James-F wrote:
Nowadays there are a LOT of BASS based software to load Soundfonts and play MIDI using them.
Fluidsynth is kinda obsolete in this day and age.
Do you know of one that works with DOSBox? Until now I only knew FluidSynth (used in ZDoom).
Kisai wrote:
I'll attach an entire patch against the 1.1.6 svn if it will help, but I think honestly you just need to define those to zero so it doesn't try to build parts it doesn't use.
Thank you! I'll try and see what comes out.
UPDATE: I can't even extract Fluidsynth because of symlinks that can't be generated now. 😕 And I just played around a bit with BASSMIDI, a much more flexible solution imho that would even work with vanilla DOSBox. So, I second James-F's opinion: Screw Fluidsynth and go with an external MIDI driver with soundfont support!
Yesterplay80 wrote:I went back until 1.0.9, but none would work. […] Show full quote
Dominus wrote:
Maybe try with older Fluidsynth versions and go from there
I went back until 1.0.9, but none would work.
James-F wrote:
Nowadays there are a LOT of BASS based software to load Soundfonts and play MIDI using them.
Fluidsynth is kinda obsolete in this day and age.
Do you know of one that works with DOSBox? Until now I only knew FluidSynth (used in ZDoom).
Kisai wrote:
I'll attach an entire patch against the 1.1.6 svn if it will help, but I think honestly you just need to define those to zero so it doesn't try to build parts it doesn't use.
Thank you! I'll try and see what comes out.
UPDATE: I can't even extract Fluidsynth because of symlinks that can't be generated now. 😕 And I just played around a bit with BASSMIDI, a much more flexible solution imho that would even work with vanilla DOSBox. So, I second James-F's opinion: Screw Fluidsynth and go with an external MIDI driver with soundfont support!
The ykhwong build used to just build it directly into dosbox (Eg no external lib) so that might be the issue.
As I noted previously, I wound up changing the include paths in the source files so it could be compiled into the dosbox without compiling a library. It should be possible to compile a library, but the fluidsynth MSVC projects are empty.
It should be noted that VLC dropped support for fluidsynth on Windows in VLC 2.x because of obsolete glib threading library issues. Hence why you might want to look at the no-glib build.
EDIT: Attached Fluidsynth static x86 and x64 for windows. The DLL's would build but they don't work with dosbox. I'm not sure you can even use this with mingw.
I thought I'd give FluidSynth another try, but still I keep running against walls, though different ones than before. What I did so far:
installed CMAKE (GUI version)
downloaded Fluidsynth 1.1.6 source code and all dependencies (glib_2.24, glib-dev_2.24, pkg-config_0.23, proxy-libintl), extracted them all into one directory, all according to this description: https://sourceforge.net/p/fluidsynth/wiki/BuildingWithCMake/
copied dsound.h in the include directory under the directory created in the step above
generated the MakeFile with CMAKE, after disabling all other sound drivers, because only Direct Sound seems to be needed under Windows
So far everything worked pretty smooth, a MakeFile for MinGW was created.
But when I try to compile it, I get the following error:
1C:\DOSBox\msys\1.0\home\MYUSERNAME\fluidsynth\build>mingw32-make 2[ 2%] Building C object src/CMakeFiles/libfluidsynth.dir/fluid_dll.c.obj 3In file included from C:/DOSBox/msys/1.0/home/MYUSERNAME/fluidsynth/sources/src/utils/fluidsynth_priv.h:117:0, 4 from C:\DOSBox\msys\1.0\home\MYUSERNAME\fluidsynth\sources\src\fluid_dll.c:22: 5c:\dosbox\include\ws2tcpip.h:16:2: error: #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." 6 #error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead." 7 ^ 8In file included from C:/DOSBox/msys/1.0/home/MYUSERNAME/fluidsynth/sources/src/utils/fluidsynth_priv.h:117:0, 9 from C:\DOSBox\msys\1.0\home\MYUSERNAME\fluidsynth\sources\src\fluid_dll.c:22: 10c:\dosbox\include\ws2tcpip.h:124:8: error: redefinition of 'struct ip_mreq' 11 struct ip_mreq { 12 ^ 13In file included from c:\dosbox\include\ptw32_errno.h:176:0, 14 from c:\dosbox\include\_ptw32.h:157, 15 from c:\dosbox\include\pthread.h:76, 16 from C:/DOSBox/msys/1.0/home/MYUSERNAME/fluidsynth/sources/src/utils/fluidsynth_priv.h:108, 17 from C:\DOSBox\msys\1.0\home\MYUSERNAME\fluidsynth\sources\src\fluid_dll.c:22: 18c:\dosbox\include\winsock.h:278:8: note: originally defined here 19 struct ip_mreq { 20 ^ 21src\CMakeFiles\libfluidsynth.dir\build.make:62: recipe for target 'src/CMakeFiles/libfluidsynth.dir/fluid_dll.c.obj' failed 22mingw32-make[2]: *** [src/CMakeFiles/libfluidsynth.dir/fluid_dll.c.obj] Error 1 23CMakeFiles\Makefile2:86: recipe for target 'src/CMakeFiles/libfluidsynth.dir/all' failed 24mingw32-make[1]: *** [src/CMakeFiles/libfluidsynth.dir/all] Error 2 25Makefile:148: recipe for target 'all' failed 26mingw32-make: *** [all] Error 2 27
Now I googled the error and everywhere the solution seems to be to include winsock2.h before windows.h. In this case, the file fluidsynth_priv.h seems to be the culprit, so I checked and the includes are already set as they should be:
Does anyone have an idea how to resolve this issue? And btw., which is the latest diff to add FluidSynth to the DOSBox source code? There seem to be several around the vogons boards...
UPDATE: Forget all that above; I've managed to compile 2 libraries, a libfluidsynth.a and a libfluidsynth.dll.a using a fresh install of Windows in a VM and an older version of MinGW. Now I tried to compile DOSBox using those libraries, but although I didn't get any errors during compiling, FluidSynth doesn't work, the DOSBox console window still says
How do i "enable" or "integrate" those libraries when building DOSBox?
I tried to add them to the configure command (LIBS="... -lfluidsynth -lfluidsynth.dll") and to src\makefile.am (LIBS += -lfluidsynth), neither did work.
ANOTHER UPDATE: I found out that adding
1#define C_FLUIDSYNTH 1
to config.in after compiling and before making my build obviously results in an exe file at least trying to use the fluidsynth driver. It first asked for all the dependent dll files (libglib-2.0-0, libgthread-2.0-0, intl), so I copied them all in the DOSBox directory. But the exe crashes every time I start it. 😵
AND ANOTHER UPDATE: I tried compiling and using a shared fluidsynth library. This looks promising! 😊
I don't have any idea why it asks for this file on your machine. I just tried my build on a completely new install of Windows 7 in a VM and it ran right from the start without asking for any other DLLs. I even searched the entire HDD for this file to make sure it isn't installed. So the problem doesn't seem to come from DOSBox. Maybe you already have another version of any of the provided DLLs installed that is looking for a libiconv-2.dll? Just in case, I'll attach the file it is looking for, just copy it in the DOSBox directory where you extraxted my build into.