Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
512 stars 130 forks source link

Replace Fluidsynth with FluidLite #150

Open RyanBram opened 7 years ago

RyanBram commented 7 years ago

Dear Jonas, The current MKXP already has MIDI support through Fluidsynth. But Fluidsynth is known for having complicated dependency with GLib and also little bit heavy. My suggestion is you may use FluidLite as the alternative. Currently FluidLite offers some advantages over its big brother, such as:

  1. Lightweight;
  2. Designed to be hardware, platform and external dependency independant;
  3. SF3 support.

I am not a programmer, so I am not really sure how hard to implement it in MKXP, but it seems it will give good benefit for MKXP, especially for Android port.

Best regards, RyanBram

Ancurio commented 7 years ago

Thank you Ryan. I was quite surprised, FluidLite seems like a really good candidate for a fluidsynth replacement, I'm very happy that other people saw the same need for a bare bones synthesizer library and actually had the knowledge to make it (or fork and strip it down, I should say). It also kept all symbol names from flluidsynth, which is nice.

I don't have time to put into this right now, but it should in theory be a very painless transition.

Ancurio commented 7 years ago

Actually, since FluidLite kept all the symbol names the same, I wouldn't be surprised if a current mkxp build could just go ahead and dlopen() libfluidlite instead of libfluidsynth and not even notice the difference. Have you tried that out?

RyanBram commented 7 years ago

Hi, Jonas Unfortunately my own laptop doesn't have enough power horse for setting build environment. But if there is a chance I'll try myself to check it in my office computer.

hanetzer commented 7 years ago

Looking into this myself, since I can't compile mkxp with midi support without building fluidsynth for mingw, seems his project is not currently configured to create a shared library, only static.

divideconcept commented 7 years ago

Hi guys,

I confirm FluidLite is 100% compatible with FluidSynth (at least for all the core functionalities). It's now also the official replacement for FluidSynth in VLC 3. I'm not super good at tweaking CMake files but if you want to propose a patch to make it able to compile as shared library, feel free to do so.

hanetzer commented 7 years ago

Got a shared libfluidlite.dll to build, doesn't seem to want to link against it:

fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.delete_fluid_synth[.refptr.delete_fluid_synth]+0x0): undefined reference to `delete_fluid_synth'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.delete_fluid_settings[.refptr.delete_fluid_settings]+0x0): undefined reference to `delete_fluid_settings'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.new_fluid_synth[.refptr.new_fluid_synth]+0x0): undefined reference to `new_fluid_synth'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.new_fluid_settings[.refptr.new_fluid_settings]+0x0): undefined reference to `new_fluid_settings'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_program_change[.refptr.fluid_synth_program_change]+0x0): undefined reference to `fluid_synth_program_change'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_cc[.refptr.fluid_synth_cc]+0x0): undefined reference to `fluid_synth_cc'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_pitch_bend[.refptr.fluid_synth_pitch_bend]+0x0): undefined reference to `fluid_synth_pitch_bend'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_channel_pressure[.refptr.fluid_synth_channel_pressure]+0x0): undefined reference to `fluid_synth_channel_pressure'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_noteoff[.refptr.fluid_synth_noteoff]+0x0): undefined reference to `fluid_synth_noteoff'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_noteon[.refptr.fluid_synth_noteon]+0x0): undefined reference to `fluid_synth_noteon'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_write_s16[.refptr.fluid_synth_write_s16]+0x0): undefined reference to `fluid_synth_write_s16'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_system_reset[.refptr.fluid_synth_system_reset]+0x0): undefined reference to `fluid_synth_system_reset'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_synth_sfload[.refptr.fluid_synth_sfload]+0x0): undefined reference to `fluid_synth_sfload'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_settings_setstr[.refptr.fluid_settings_setstr]+0x0): undefined reference to `fluid_settings_setstr'
fluid-fun.o:fluid-fun.cpp:(.rdata$.refptr.fluid_settings_setnum[.refptr.fluid_settings_setnum]+0x0): undefined reference to `fluid_settings_setnum'
hanetzer commented 7 years ago

Ah, I was misunderstanding what SHARED_FLUID meant... that's not the dlopen'd one. I actually managed to produce a static linked version (shared required ogg and vorbis dlls to work, even though they were static linked into mkxp.exe) of mkxp for x86_64 with fluidlite, no issues whatsoever đź‘Ť

divideconcept commented 7 years ago

Glad to hear you managed to build it :) Le 3 mars 2017 15:35, ntzrmtthihu777 notifications@github.com a écrit :Ah, I was misunderstanding what SHARED_FLUID meant... that's not the dlopen'd one. I actually managed to produce a static linked version (shared required ogg and vorbis dlls to work, even though they were static linked into mkxp.exe) of mkxp for x86_64 with fluidlite, no issues whatsoever 👍

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

Ancurio commented 3 years ago

The move to FluidLite as the default target should still happen, and any compile issues fixed (at least on mkxp's side). Not sure if I'm out of date, but the last time I looked at the project, it seemed to hard depend on libogg and some friends? Not sure how that would be handled; ideally if someone wants to use FluidLite with support for ogg, libogg/libvorbis should be shared between it and mkxp.