Hi Gerald,
This isn't what I had in mind when I said "settings" (I meant that you could pass a file as a command-line switch). But I agree, it would also be good to have a more permanent settings (conf) file when FluidSynth starts. Wasn't there some talk about this awhile ago? Ah! It was (I think Pedro) talking about having a soundfont file that could load automatically so we wouldn't have to specify it on the command line.
So here's my list of what we're looking at adding now. Would the main devs (David, Pedro) agree that something along these lines is a good direction for FS to go in:
First, I use the word "settings" as a formal term to describe the things which FluidSynth lets you change with the "set" command (such as "synth.gain").
1. Make it possible to do all the things you can do in the interactive shell (or TCP shell) with settings. For example, add settings for "synth.reverb.roomsize" and "synth.chorus.level".
2. Also make it possible to specify a soundfont in the settings (maybe this is too hard, given that the API for loading soundfonts is quite different to that for changing settings).
3. Define a file format (a simple text file with key=value pairs and # comments would suffice), the "FluidSynth config format", for defining FluidSynth settings. If #2 is too hard, maybe make a special rule in this config format for specifying a soundfont (rather than making it a setting).
4. Have FluidSynth look in some standard places for the config file (/etc/fluidsynth/fluidsynth.conf; $HOME/.local/share/fluidsynth/fluidsynth.conf).
5. Allow the config file to be overridden by a command-line switch --config <file-path>.
These 5 things would enable the following possibilities which aren't currently available:
- Setting reverb and chorus settings on the command-line for all modes of operation. (My original requirement.)
- Permanently customising FluidSynth to your needs without requiring command-line switches.
- Permanently setting a preferred soundfont to avoid having to specify it on the command-line every time.
-
Allowing FluidSynth distro package maintainers to set up a default soundfont, so new users don't need to know what a soundfont is to use FS.
For the record, here is my FluidSynth command-line that I use to set up a MIDI server for Rosegarden:
$ fluidsynth -apulseaudio -ls /usr/share/sounds/sf2/Fluid_GM3.sf2
And here is my FluidSynth command-line that I use to play a MIDI file:
$ fluidsynth -apulseaudio -lni /usr/share/sounds/sf2/Fluid_GM3.sf2 <midifile>
Ideally, it would be much more usable if all I had to do was this to run a FluidSynth MIDI server that Rosegarden can use:
$ fluidsynth
and to play a MIDI file:
$ fluidsynth <midifile>
The above changes would go a long way (not all the way) towards making that a reality.
-----
Update: I have just realised (before sending this message) that FluidSynth has a command:
-f, --load-config
Load command configuration file (shell commands)
I haven't tried it, but it seems to be exactly what I was looking for in the first place (it would hopefully let me set reverb in conjunction with -F). I guess I'm an idiot for not noticing that earlier! Still, I think the above would be a helpful addition.
Matt