Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Kaiser

Fluidsynth / Synth Players

Recommended Posts

I've been researching on ways to implement a synth player for the upcoming Doom64EX release and found that Fluidsynth is being used by several source ports already. Though I've read somewhere here that Fluidsynth is heavy on the CPU load which would be bad for low end machines. So there's some questions I'd like to ask and get feedback from.

I've had the joy of experiencing the frustrations of getting Fluidsynth to compile. I've obtained a precompiled .DLL used for Slade and and tried to build a test application. As usual I am getting unresolved symbols on every fluidsynth-related function, even when fluidsynth.h is included. Has anyone had luck in being able to successfully link the fluidsynth library to their application? Also I am assuming that I need the .lib file as well.. but haven't seen any precompiled .lib files yet.

Reason why I am asking these sort of questions is because the majority of Doom64's sound system has been identified, thanks to Natt's help, and I've been identifying more things that makes up the sound system. I've been looking for ways to implement a synth player but if Fluidsynth does in fact hog the CPU then I may consider writing a pseudo-ish synth player to suit my needs. Question is would this be even worth my time? Would I be bitting more than I can chew with this? I am initially thinking this would be simple to do since the music system itself is pretty simple since it only does notes, pitching, panning, and volume fade ins/outs.

I do plan on updating the D64 Bible with information on the sound format and midi format if anyone cares/interested.

Any feedback to my questions/situations is appreciated.

Share this post


Link to post

Heh, fluidsynth. I use the fluidsynth.dll I compiled myself, however I'm fairly certain I invoked a few black magics for that, so I'd recommend against it, what with the pig blood and all.

Randy Heit maintains a fluidsynth.dll which is better than mine (doesn't pull in glib or gthreads dependencies).

But if you just have a .dll, you need to use a .lib (msvc) or a .a (mingw) file at link time, which you can get by doing magic to the dll:

pexports fluidsynth.dll > fluidsynth.def
dlltool -d fluidsynth.def -l libfluidsynth.a
lib /def:fluidsynth.def
This creates libfluidsynth.a (usable by mingw at link time), fluidsynth.lib and fluidsynth.exp (usable by msvc at link time).

'pexports' and 'dlltool' are from mingw, 'lib' is from msvc


I believe this is what entryway uses for the official prboom-plus builds; Randy Heit's fluidsynth.dll and a .lib file created as above. If you don't have the appropriate toolchains, I can email you the files no problem.

One thing I can say that's good about this, is the exact same build script works on mingw and linux (and presumably any other posix-like system that fluidsynth compiles on), so you don't lose any cross-platform compatibility.

As far as writing your own synth, IMO it mostly depends on how complex things get. My midi converter spits out "unknown" tags for quite a few of the Doom64 midi events. I know you've looked more closely at the Doom64 sound code than I have; but if one of those turns out to be "set reverb level" and one turns out to be "set lowpass resonance" etc etc, then you're writing a full fledged dsp and you might as well use fluidsynth at that point.

I don't know any real alternatives though. I don't think timidity has a good API. There are a lot of good module file players out there, but I don't think most of them expose their synthesizer as an API either. I did a lot of synthesizer searching when I wrote new sound code for prboom-plus.

Share this post


Link to post

That's why I am thinking about writing my own synth. Midway's sequence library is capable of doing very simple sequences. So far I've found that Doom64 alone can only do pitch, fade in/outs, panning, and volume control. Quake64 barely does anything with it's sequences despite that it's using the exact same library. I am not catching anything fancy or whatnot. While Doom64 DOES have reverb effects, I do believe its a post mix procedure and not part of the synth itself.

Share this post


Link to post

DLL by Randy does not work on Win9x. I did not try to understand the reasons (probably because of some *W imports) and just disabled it for 9x.

Kaiser said:

Also I am assuming that I need the .lib file as well.. but haven't seen any precompiled .lib files yet.

You can download libfluidsynth.lib from prboom-plus SVN
https://www.crowproductions.de/repos/prboom/branches/prboom-plus-24/prboom2/src/MUSIC/lib/libfluidsynth.lib

Share this post


Link to post

I compiled a test application and everything compiled fine but no sound is playing. I assume it's because I am running on Window's XP?

Share this post


Link to post
Kaiser said:

I compiled a test application and everything compiled fine but no sound is playing. I assume it's because I am running on Window's XP?


Fluidsynth works on WinXP. You can email me your test application if you like, and I'll take a look at it.

Share this post


Link to post
entryway said:

works for me (test.exe TimGM6mb.sf2)


Yeah, we just resolved it. I was using a broken soundfont but after downloading another one from the web, everything seems to work just fine.

Share this post


Link to post
Kaiser said:

Yeah, we just resolved it. I was using a broken soundfont but after downloading another one from the web, everything seems to work just fine.


I protest! My awesome soundfont is not broken. It just doesn't supply anything for a lot of instruments because it's not intending to cover the general midi instrument set.

Share this post


Link to post

haha okay okay I take it back :P

Since now fluidsynth is working without any problems, I may start on working on Doom64ex's synth player. Since I have control over scheduled events, Doom64ex could read and play the midi without converting it to PC format. Though just converting the midi to PC format may just be quicker and easier to do but what's the challenge in that?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×