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

Look for soundfonts by default in /usr/share/sounds/sf2 #453

Closed
Jacalz opened this issue Oct 29, 2018 · 9 comments
Closed

Look for soundfonts by default in /usr/share/sounds/sf2 #453

Jacalz opened this issue Oct 29, 2018 · 9 comments

Comments

@Jacalz
Copy link

Jacalz commented Oct 29, 2018

FluidSynth version

1.1.11

Current behavior

Nowadays it looks like we need to load files like /usr/share/sounds/sf2/GeneralUser.sf2 which is a bit annoying and it makes the need to write the full path every time.

Expected behavior

It would be way beter to have it look for sound fonts in /usr/share/sounds/sf2 by default so you only need to load the soundfont with GeneralUser.sf2 instead. This would make lide a lot easier 😄

From sudo fluidsynth -a alsa -s -g 1.5 /usr/share/sounds/sf2/GeneralUser.sf2
to sudo fluidsynth -a alsa -s -g 1.5 GeneralUser.sf2

@derselbst
Copy link
Member

fluidsynth automatically loads the soundfont specified by synth.default-soundfont if none is provided via command line. The value of this setting is configurable at compile time. Type

info synth.default-soundfont

in the fluid shell to see its default value. Once configured you just type

fluidsynth -a alsa -s -g 1.5

Also, I recommend to avoid using sudo.

@Jacalz
Copy link
Author

Jacalz commented Oct 29, 2018

I am using the version from the Solus repo so a default at compile time is not an option. When not using Sudo it complains about not being able to set thread priority. Is that an issue with the Solus package?

@Jacalz
Copy link
Author

Jacalz commented Oct 29, 2018

And the default setting mean that you only can use one file. Having it automatically look for .sf2 files in that directory would make it easy to use multiple files...

@derselbst
Copy link
Member

a default at compile time is not an option

Use a symlink?

When not using Sudo it complains about not being able to set thread priority.

Setup /etc/security/limits.conf or a similar config file in that folder to your needs.

Having automatically look for .sf2 files in that directory would make it easy to use multiple files...

I'm not convinced that we need this. And implementing this raises a couple of question:

  • How to implement the default path (env. variable, dirname(synth.default-soundfont), custom path)?
  • Compile-time or run-time configurable?
  • How to deal with other OSs?
  • How to deal with files that exist in this default directory as well as in the current working directory?
  • After all: Why not writing a simple shell script for your use-case?

If you insist on your idea, I suggest you bring it to the mailing list for discussion.

@Jacalz
Copy link
Author

Jacalz commented Oct 29, 2018

I am really not that experienced with Linux to create a symlink and other tuff, I would guess that more people are the same.

I think that it would be best to have it as a compile time selectable variable so you could select a path on Windows and Mac also. Only
Looking for .sf2 files would be best.

Yes of course I could write a shell script but I think that this would make it easier for more users. I had been writing some documentation for Solus on this. That is why I want to make fluidsynth easier for more users to enjoy this great software:

getsolus/help-center-docs#180

@derselbst
Copy link
Member

sudo mv 'GeneralUser GS 1.471'/'GeneralUser GS v1.471.sf2' /usr/share/sounds/sf2/GeneralUser.sf2

Your efforts in all honor, but why making documentation unnecessarily complicated? Soundfonts are specific to a certain user. You should collect them somewhere in your $HOME. Then you don't have to fiddle with the path.

And again: Don't use sudo unless you really need it. You can just ignore the thread priority issue.

Also: The guy is called S. Christian Collins

I think that it would be best to have it as a compile time selectable variable

For implementation details: mailing list, please. However, given your previous statement of "mak[ing] fluidsynth easier for more users to enjoy" I think this would be the most user unfriendly option, esp. because you already said "a default at compile time is not an option".

@Jacalz
Copy link
Author

Jacalz commented Oct 29, 2018

Okay thank you for the tips on my documentation, I will make sure to improve it 🙂👍

I was unclear with what I exactly meant but I still think this is kind of good idea. Maybe not in /usr/share/sounds/sf2 but in Home like you say. Will see about contacting the mailing list sometime in the future. Might rethink my idea in to something more useful. I am happy to learn more and help out. Thanks for having this conversation 🙂

@ghost
Copy link

ghost commented Oct 31, 2018

You don't need /usr/share/sounds when /usr/share/soundfonts already exist. The default soundfont is just a symlink. However, if this feature is considered I think the following would be reasonable:

  • Keep the default soundfont configurable at compile-time, since maintainers are already used to this, so no need to change it
  • Allow soundfonts to be found at runtime with configurable paths. For example. look in the current directory and if it's not found, look at /usr/share/soundfonts next or $XDG (example, ~/.local/share/soundfonts). You would need the Windows/Mac equivalents too

I'd be happy to write a PR.

@Jacalz
Copy link
Author

Jacalz commented Nov 1, 2018

Thanks @remyabel 👍

@Jacalz Jacalz closed this as completed Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants