Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put a soundfont file in /usr/share/soundfonts/default.sf2 upon installing fluidsynth #1005

Open
brandneetjan opened this issue Nov 30, 2021 · 6 comments

Comments

@brandneetjan
Copy link

It seems that by default there is no default.sf2 file packaged with fluidsynth (pun intended ?). I had an issue with this today on my Artix Linux system and fixed it using this: https://wiki.archlinux.org/title/FluidSynth#SDL_Mixer. But I think it would be best and logical/expected to have an actual default.sf2 file coming with a fluidsynth installation. What do you guys think ? Or maybe your opinion is that this is the distro package maintainers responsibility ?

@derselbst
Copy link
Member

default.sf2 is meant as a placeholder or pointer to a real soundfont. Primarily I see the user (or local sysadmin) in charge to put a symlink there and make it point to your preferred soundfont. Secondarily, this job could be done by a package maintainer, yes.

I vote against shipping a soundfont with "a fluidsynth installation" for the following reasons:

  • soundfonts are usually pretty big, this would unnecessarily bloat fluidsynth
  • soundfonts are typically copyrighted and I really don't be blamed for violating any distribution terms
  • how to make a proper unbiased choice for a soundfont anyway?
  • using such a default soundfont might suggest to newbies, that this is the way fluidsynth sounds like, i.e. they might not actually dive into the soundfont topic at all - they either like what they hear or they don't. and if they don't, they might believe that this is the "only supported thing" by fluidsynth. and they might simply move on rather than dealing with the topic, I'm afraid.

@pedrolcl
Copy link
Contributor

pedrolcl commented Dec 4, 2021

This is in my opinion an entirely valid issue. Fluidsynth is not functional without a Soundfont. And there are messages complaining about a missing 'default.sf2' when another soundfont file is not provided. On the other hand, all of the reasons argued by Tom are equally valid, and I agree. We have discussed in another place that PREFIX/share/soundfonts (or PREFIX/share/sounds/sf2 in Debian-ish distros) is outside the scope of the application, and should be managed by the package maintainers only. In case we ship a soundfont file, the proper install place would be PREFIX/share/fluidsynth/.

But anyway, I can't strongly oppose to an "emergency soundfont" provided as a fallback when any other options are not available. Of course this should fulfill some requirements: to be small, free with a compatible license, and with enough quality to compellingly render some small SMF demos, preferably GM compatibles.

What other soft synths do? the popular and windows only VirtualMIDISynth does not ship any. On the other hand the Java's OpenJDK Gervill has an internally generated emergency soundbank.

@clort81
Copy link

clort81 commented May 4, 2023

Every opportunity should be exploited to teach naive users that MIDI and also General-MIDI do not specify the exact (PCM) sound that is played, only in the case of general-MIDI,the type of sound desired.
The obvious analogy of soundfonts should to text fonts should be explained to the kids maybe with a text like this:
"Soundfonts are like text fonts, but for sounds. In the case of a text font, the application requests the letter 'A' to be drawn, but it looks different depending on the chosen font. Similarly the general-MIDI application might request an 'Oboe' sound, but that will sound different depenting on which soundfont the user prefers.
People have their own individual preferences for fonts and often applications allow the user to select the preferred font. Likewise general-MIDI players give users the flexibility to choose their preferred 'font' for music."

@baweaver
Copy link

baweaver commented Dec 6, 2023

Having come across this in the future I must concur with the above opinions that this can be confusing for a new user, and would take at least a few searches to reasonably remedy.

In lieu of shipping with a default sound font would it be possible to consider a prompt or instructional guide rather than error messages like the following?:

fluidsynth: error: fluid_sfloader_load(): Failed to open '/usr/local/Cellar/fluid-synth/2.3.4/share/soundfonts/default.sf2': File does not exist.
fluidsynth: error: Unable to open file '/usr/local/Cellar/fluid-synth/2.3.4/share/soundfonts/default.sf2'
fluidsynth: error: Failed to load SoundFont "/usr/local/Cellar/fluid-synth/2.3.4/share/soundfonts/default.sf2"

I can appreciate the predicament of finding a free and reasonable soundfount as @pedrolcl has mentioned, but would continue to advocate for a knowledge sharing approach which redirects those who encounter it to further reading.

As someone who is very naive on MIDI and just got started in experimenting with it I find that there are a lot of areas to potentially get lost in across tools, so whatever we can do to address those gaps would be very appreciated. I'd love to put in a PR to help on this, but I also do not know a good resource to point folks to either at the moment.

@hikari-no-yume
Copy link

The open-source part of Android, AOSP, includes its own General MIDI synthesizer called "sonivox". Interestingly, this synth has its own built-in sound set, and it's under the same Apache 2.0 license. However, while the synth supports DLS sound sets, this sound set only exists as tables in C code: https://github.com/pedrolcl/sonivox/blob/master/arm-wt-22k/lib_src/wt_22khz.c

If it could be ported to SF2, that seems like a legally safe option. It's on a billion devices and Google are diligent. :)

@pedrolcl
Copy link
Contributor

pedrolcl commented Sep 1, 2024

The link in your comment points to my fork of the Sonivox project. Let me add my €0.2 contrib:

I've forked this AOSP project so it could be used by my projects' users as an option. In fact, it is one of the back-ends of Drumstick::RT, and it is available in VMPK and dmidiplayer. The quality is very modest (the audio output of the synth is only 22 kHz) and the samples are very simplistic and duplicated among program changes. To my surprise, it is the favorite among some users, even over Fluidsynth. In my opinion, it is partly because the "cheesy" sounds, and more important because the simplicity of installing it and getting sound at once, without any configuration.

while the synth supports DLS sound sets, this sound set only exists as tables in C code: https://github.com/pedrolcl/sonivox/blob/master/arm-wt-22k/lib_src/wt_22khz.c

If you look at the top of the file, it says that was created by a program translating it from the source: wt_200k_G.dls
Then you can search the net for a file called "SONiVOX_EAS_GM_Wavetable_12_Variants.zip" which is 17.8 Mb and contains among others a file called wt_200k_G.sf2 which is exactly what you are proposing. You may try this file with Fluidsynth.

If it could be ported to SF2, that seems like a legally safe option. It's on a billion devices and Google are diligent. :)

It is also included on many Linux repositories.

If you want my vote, I prefer GeneralUser GS by @mrbumpy409 which is only available in a few distributions. Compare it with the monstrosity FluidR3. I always cite this issue when talking about the incompetence of the Linux distributions. Or when talking about the Ubuntu bug #1: when my VMPK users install it on Windows, it always produced sound at once, without having to configure anything, or searching and installing soundfonts. It's comfort, my friend...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants