Skip to content

CLI Flag for specifying bank offset #1538

@derselbst

Description

@derselbst

Related discussion

#1473

Is your feature request related to a problem?

Loading multiple soundfonts with different bank offsets is currently not possible via the command line. The only option is to use a config file for fluidsynth's shell, which stops the MIDI player, loads the new Soundfont(s) with the desired offset and then restarts the player.

Describe the solution you'd like

Based on @mrbumpy409 's idea:

A new positional command-line flag --bank **n** / -b **n** would change the bank offset for any Sondfonts following that flag, e.g.:

fluidsynth -b 1 Altitude.sf2 Altitude.mid

...would load Altitude.sf2 into bank 1 and play Altitude.mid.

If you also wanted to specify GM/bank 0 SoundFont, you could do:

fluidsynth synthgs-sf2_04-compat.sf2 -b 1 Altitude.sf2 Altitude.mid

...which would load synthgs-sf2_04-compat.sf2 into the default bank 0, Altitude.sf2 into bank 1 and play Altitude.mid.

fluidsynth -b 1 Altitude.sf2 synthgs-sf2_04-compat.sf2 Altitude.mid

Would load both Soundfonts with a bankoffset of 1.

Describe alternatives you've considered

Another idea would be to simply use a prefix before the SoundFont path in "bank:SoundFont" format, e.g.:

fluidsynth 1:Altitude.sf2 Altitude.mid

If you need to use quotes for spaces in the filename, the quotes would start after the bank number prefix, e.g.:

fluidsynth 1:"Far From It.sf2" "Far From It.mid"

The drawback of this approach is, that it cannot be distinguished from a filename that really consists of a number and a colon at the beginning.

Additional context

Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions