Closed jadasse closed 3 years ago
You need to set "mididevice=fluidsynth" for FluidSynth support (not a path). Since you seem to use Windows, I have provided a Windows binary below with the latest updates and FluidSynth support enabled:
Download link: dosbox-x-update.zip
Problem, When I play midi files in Windows 98, it doesn't play the soundfont I wanted
Have you set up FluidSynth in the configuration correctly?
I think the problem is that I have fluid.driver on default
mpu401 = intelligent mpubase = 0 mididevice = fluidsynth midiconfig = samplerate = 44100 mpuirq = -1 mt32.romdir = mt32.reverse.stereo = off mt32.verbose = off mt32.thread = off mt32.dac = auto mt32.reverb.mode = auto mt32.reverb.time = 5 mt32.reverb.level = 3 mt32.partials = 32 fluid.driver = default fluid.soundfont = "C:\Users\dlada\Music\tattest.sf2" fluid.samplerate = 48000 fluid.gain = .6 fluid.polyphony = 256 fluid.cores = default fluid.periods = default fluid.periodsize = default fluid.reverb = yes fluid.chorus = yes fluid.reverb.roomsize = .61 fluid.reverb.damping = .23 fluid.reverb.width = .76 fluid.reverb.level = .57 fluid.chorus.number = 3 fluid.chorus.level = 1.2 fluid.chorus.speed = .3 fluid.chorus.depth = 8.0 fluid.chorus.type = 0
I think the problem is that I have fluid.driver on default
Right. Why not try some other options such as dsound and file and see if they work?
Try to start dosbox-x with the -console parameter and look for messages to do with MIDI and FluidSynth.
e.g.
dosbox-x.exe -console
Look for messages in the log similar to this:
LOG: MIDI:Opened device:win32
Fluidsynth is not supported by default You need to modify the file and recompile
download fluidsynth dev from https://dev.azure.com/tommbrt/tommbrt/_build/latest?definitionId=3&branchName=master
x86 and x64
change vs2015/config.h
#undef C_FLUIDSYNTH
to
#define C_FLUIDSYNTH 1
change vs2015/dosbox-x.vcxproj
add fluidsynth include and lib
which one should i download?
https://dev.azure.com/tommbrt/tommbrt/_build/results?buildId=2290&view=artifacts fluidsynth-Win32 and fluidsynth-x64 Add library file fluidsynth.lib for Release not Debug. To use the debug library, install it with vcpkg
/ FluidSynth - A Software Synthesizer
extern "C" {
#define FLUIDSYNTH_API // building static lib? no visibility control then
#if defined(FLUIDSYNTH_NOT_A_DLL)
#define FLUIDSYNTH_API
#elif defined(FLUIDSYNTH_DLL_EXPORTS)
#define FLUIDSYNTH_API __declspec(dllexport)
#else
#define FLUIDSYNTH_API __declspec(dllimport)
#endif
/**
}
I can't find #undef C_FLUIDSYNTH (this is the 64 bit one)
git clone https://github.com/joncampbell123/dosbox-x.git use Visual Studio 2019 Build
Modify line 89 of dosbox-x/vs2015/config.h
#undef C_FLUIDSYNTH
to
#define C_FLUIDSYNTH 1
Modify dosbox-x/vs2015/dosbox-x.vcxproj
Add fluidsynth header directory and library to the project file
Add to fluidsynth.lib Library file to project file
Note that only the release version, not the debug version
Rebuild
I don't see a vs2015 folder in the dosbox-update.zip or extracted zip folder
Download the source code and compile it yourself git clone https://github.com/joncampbell123/dosbox-x.git
wow i'm dumb XD
Is it supposed to look like this?
Did you see that
MIDI:fluidsynth : Loaded SoundFont:xxxxx\xxxxxx.sf2
MIDI:Opened device :fluidsynth
Are you sure tattest.sf2 Is it the correct soundfont file
If you need to compile binaries from source code, you need to modify config.h and dosbox-x.vcxproj to support fluidsynth
I'm sure it's tattest.sf2 that I want to use
Do not use soundfont files larger than 1GB To build x64 with soundfont files larger than 1GB
It's 21.1 mb
@yxmline Thanks for the link to the FluidSynth lib files! I have modified the code accordingly to include and enable FluidSynth support for Visual Studio x86/x64 builds by default.
@yxmline Since FluidSynth support requires extra .DLLs, I have updated the Windows building script and installer as well to copy the required files to the Windows package. If you know a way to combine the .DLLs into a single executable and can confirm it works, please let me know. Thanks!
fluidsynth requires libglib dll glib only supports dynamic library linkage on windows libinstpatch/libsndfile/libintl can static library linkage libinstpatch not vcpkg
What do you think
windows98 change midi out to sb16 midi out
I've modifed the vcxproj
<?xml version="1.0" encoding="utf-8"?>
sorry i meant
vcxproj modified
<?xml version="1.0" encoding="utf-8"?>
It's fine to me when it's not submitted
/ config.h.in. Generated from configure.ac by autoheader. / / Hand-edited by Jonathan Campbell for Visual Studio 2008 /
/*
/ DOSBox-X currently targets Windows XP or higher. / / TODO: Can we drop this to 0x500 for Windows 2000? / / TODO: What is the minimum appropriate WINVER for HX DOS extender? /
/ Define if building universal (internal helper macro) /
/ Compiling on BSD /
/ Determines if the compilers supports always_inline attribute. /
/ Determines if the compilers supports fastcall attribute. /
/ Define to 1 to use inlined memory functions in cpu core /
/ Indicate whether SDL_net is present /
/ Define to 1 if you have the
/ Define to 1 if you want to add Direct3D output to the list of available outputs /
/ Define to 1 to use Direct3D shaders, requires d3d9.h and libd3dx9 /
/ MT32 (munt) emulation /
/ Define to 1 to enable internal debugger, requires libcurses /
/ Define to 1 if you want parallel passthrough support (Win32, Linux). /
/ Define to 1 if you want serial passthrough support (Win32, Posix and OS/2). /
/ The type of cpu this target has /
/ Define to 1 to use x86 dynamic cpu core /
/ Define to 1 to enable fluidsynth MIDI synthesis /
/ Define to 1 to enable floating point emulation /
/ Define to 1 to use a x86/x64 assembly fpu core / / FIXME: VS2015 x86_64 will not allow inline asm! /
//TODO
/ Determines if the compilers supports attributes for structures. /
/ Determines if the compilers supports __builtin_expect for branch prediction. /
/ Define to 1 if you have the mprotect function /
/ Define to 1 to enable heavy debugging, also have to enable C_DEBUG /
/ Define to 1 to enable IPX over Internet networking, requires SDL_net /
/ Define to 1 if you have libpng /
/ Define to 1 to enable internal modem support, requires SDL_net /
/ Define to 1 to enable internal printer redirection support/
/ Define to 1 to enable NE2000 ethernet passthrough, requires libpcap /
/ Set to 1 to enable SDL 1.x support /
/ Set to 1 to enable SDL 2.x support / / #undef C_SDL2 /
/ Define to 1 to use opengl display output support /
/ Set to 1 to enable XBRZ support /
/ Set to 1 to enable scaler friendly but CPU intensive aspect ratio correction options (post-scalers) for 'surface' output / / Please note that this option includes small part of xBRZ code and uses task group parallelism like xBRZ (batch size is hardcoded here) /
/ Define to 1 if you have setpriority support /
/ Define to 1 to enable screenshots, requires libpng /
/ Define to 1 to use a unaligned memory access /
/ define to 1 if you have XKBlib.h and X11 lib /
/ libm doesn't include powf /
/ struct dirent has d_type /
/ environ can be included /
/ environ can be linked /
/ Define to 1 to use ALSA for MIDI /
/ Define to 1 if you have the
/ Define to 1 if you have the
/ Define to 1 if you have the `asound' library (-lasound). /
/ Define to 1 if you have the
/ Define to 1 if you have the <netinet/in.h> header file. /
/ Define to 1 if you have the
/ Define to 1 if you have the
/ Define to 1 if you have the
/ Define to 1 if you have the
/ Define to 1 if you have the
/ Define to 1 if you have the <sys/socket.h> header file. /
/ Define to 1 if you have the <sys/stat.h> header file. /
/ Define to 1 if you have the <sys/types.h> header file. /
/ Define to 1 if you have the
/ Compiling on GNU/Linux /
/ Compiling on Mac OS X /
/ Compiling on OS/2 EMX /
/ Define to the address where bug reports for this package should be sent. /
/ Define to the full name of this package. /
/ Define to the full name and version of this package. /
/ Define to the one symbol short name of this package. /
/ Define to the home page for this package. /
/ Define to the version of this package. /
/ The size of `int ', as computed by sizeof. */
/ The size of `unsigned char', as computed by sizeof. /
/ The size of `unsigned int', as computed by sizeof. /
/ The size of `unsigned long', as computed by sizeof. /
/ The size of `unsigned long long', as computed by sizeof. /
/ The size of `unsigned short', as computed by sizeof. /
/ Define to 1 if you have the ANSI C header files. /
/ Define to 1 if your <sys/time.h> declares `struct tm'. /
/ Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). /
/ Define to empty if `const' does not conform to ANSI C. /
/ Define to __inline__' or
__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. /
/ Define to `unsigned int' if <sys/types.h> does not define. /
/ Define to int
if you don't have socklen_t /
typedef double Real64;
typedef unsigned char Bit8u; typedef signed char Bit8s;
typedef unsigned short Bit16u; typedef signed short Bit16s;
typedef unsigned int Bit32u; typedef signed int Bit32s;
typedef unsigned long Bit32u; typedef signed long Bit32s;
typedef unsigned long Bit64u; typedef signed long Bit64s;
typedef unsigned long long Bit64u; typedef signed long long Bit64s;
typedef Bit32u Bitu; typedef Bit32s Bits;
typedef Bit64u Bitu; typedef Bit64s Bits;
/ Fuck off MSVC I don't care if some C library functions aren't POSIX compliant --J.C. /
/ Linux-side configure script will write/rewrite this file so both Windows and Linux builds carry the same information --J.C. /
Somehow this glitch doesn't apply to config.h
Update source code git pull Enable FluidSynth for Windows VS x86/x64 builds https://github.com/joncampbell123/dosbox-x/commit/51cb5d460fba18a06fd5bb3ebf33f6c276a4377a
Modify the Windows 98 settings in dosbox, otherwise fluidsynth will not be effective
windows 98 Control Panel-->Multimedia-->MIDI-->MIDI OUT-->Single instrument-->Creative Music Synth[220] change to SB16 MIDI OUT[330]
I'll try that out later
@yxmline Do you have FluidSynth VS x86/x64 libs with most libraries already statically linked? The fewer number of external .DLL files, the better of course.
@Wengier No, I didn't If glib library can generate static library in windows I also don't like a program with too many dynamic link libraries
@yxmline The official FluidSynth requires glib, so I tried some unofficial FluidSynth packages without glib such as Fluidsynth-lite and fluidsynth-1.1.6-noglib found in this thread. I could get them to compile and run without external DLLs, but unfortunately for some reason there was no sound when the General MIDI is set to FluidSynth, so they did not work out (not to mention many of them are based on FluidSynth 1.x). If you (or anyone else) can find FluidSynth packages without glib that do work in DOSBox-X (Windows Visual Studio builds), please feel free to let me know.
Tbh I kinda feel bad because this open thread has the most comments as far as I know 😔
I'm curious, is there a video tutorial on how to patch sound-fonts into windows 98 in dosbox x? I feel like this thread is getting a tad complicated. I hope I'm not offending anyone though. 🥴
@jadasse You can try the following updated DOSBox-X binary package, which already has FluidSynth support activated and with the GeneralUser_GS sound font enabled in the config file. The DOS MIDI player named DOSMID will appear on the Z drive which you can verify if the sound font indeed works. Since FluidSynth only supports General MIDI and not Adlib (OPL2/OPL3), please make sure Windows 98 is playing using the General MIDI device and not the Adlib/OPL device.
Download Link: dosbox-x-update.zip
@jadasse Also, this is of course not the open thread that has the most comments so far. For example, the following (recent) open thread has more comments than this one:
Oh ok
@yxmline I think I have managed to get fluidsynth-1.1.6-noglib working (the source code will be included in the Visual Studio solution instead of external linkage). As a result, the following DOSBox-X binary features FluidSynth support and does not require external DLL files:
The only drawback I can see is the FluidSynth version - it is not 2.x, but it is certainly so much better than nothing (FluidSynth support was never officially included in the VS builds before).
@Wengier this working
So, overall, how do I patch soundfonts into windows 98?
@jadasse
By default, Windows 98 uses creative music synth [220] to play midi.
You need to modify Windows 98 multimedia settings.
Windows 98 Control Panel-->Multimedia-->MIDI-->MIDI OUT-->Single instrument-->Creative Music Synth[220] change to SB16 MIDI OUT[330]
Using fluidsynth or virtualmidisynth you do not modify the settings do not work
Will the Sb16 midi out link to the soundfont I patched in VLC? Also known as, the one I'm trying to use.
@jadasse I don't think so VLC has independent fluidsynth settings
I don't know what your trying to do with VLC, but undoubtedly the answer is NO. This has nothing to do with VLC. It simply tells any Windows MIDI program (such as the bundled Media Player) running under Win98 to redirect the MIDI output out of the emulated MIDI port provided by DOSBox-X. This in turn is connected to Fluidsynth, which has a soundfont, and uses that to render the MIDI music to your host PC's soundcard.
I brought up vlc because I used that to experiment with the sf2
long before this
mpu401 = intelligent mpubase = 0 mididevice ="C:\Program Files (x86)\QSynth\fluidsynth.exe" midiconfig = samplerate = 44100 mpuirq = -1 mt32.romdir = mt32.reverse.stereo = off mt32.verbose = off mt32.thread = off mt32.dac = auto mt32.reverb.mode = auto mt32.reverb.time = 5 mt32.reverb.level = 3 mt32.partials = 32 fluid.soundfont="C:\Users\dlada\Music\tattest.sf2" fluid.driver=dsound
I want to patch this soundfont in windows 98 without compiling fluidsynth, it's complicated, so I use qsynth https://drive.google.com/file/d/1SzCkmaUO4cx5tmJwBubNYsr1TDFgIQip/view