Discussion:
[fluid-dev] fluidsynth, Midi Bank Select
David Back
2017-12-20 14:19:45 UTC
Permalink
Hi All
My organ eplayOrgan uses sf2 sound fonts and as you know these may includemore than one bank of presets.
I need to be able to tell fluidsynth which bank to use at the time that the soundfont is loaded, the bank will never change thereafter. This bank must be used byALL midi channels. (I am NOT stacking sound fonts one above the other, thereis only font).
The fluidsynth documentation on this subject is highly confusing - I would callit a mess. There is no example of how to do this and I do not know whetherbanks are best set before or after the sound font is loaded. I do not want touse CC's for this purpose if it can be avoided - I just need to set the bank onceand for all, preferably with an API command.
Would fluid_synth_set_bank_offset( );be useful. If so what is starting point for offsetting? Would an offset of 1 select bank1 on all channels?
So far nothing I have tried has changed the bank from 0.
Could you please supply an example of how to do this showing the sequenceof commands from the point that fluidsynth is loaded.
Thank you.
csw900 (David)
Marcus Weseloh
2017-12-20 14:38:33 UTC
Permalink
Hi David,
Post by David Back
Would fluid_synth_set_bank_offset( );
be useful. If so what is starting point for offsetting? Would an offset
of 1 select bank

If I read the source correctly, then it seems like the bank offset is
*subtracted* from the bank number (which seems very weird, in my opinion...)
So in order to shift the bank upwards, you would have to offset by a
negative number.

Cheers,

Marcus
Tom M.
2017-12-20 16:35:37 UTC
Permalink
Post by David Back
There is no example of how to do this
It should be as simple as using fluid_synth_bank_select() after the
soundfont was loaded:

http://www.fluidsynth.org/api/synth_8h.html#a97b0f45f00922a46b1c1961d5b1f8cb5
Post by David Back
and I do not know whether banks are best set before or after the sound font is loaded.
In this case it shouldnt matter, but it's usually best to do any
channel setup as late as possible to avoid that e.g. these are being
reset during load operations.


Tom
Post by David Back
Hi David,
Post by David Back
Would fluid_synth_set_bank_offset( );
be useful. If so what is starting point for offsetting? Would an offset of
1 select bank
If I read the source correctly, then it seems like the bank offset is
*subtracted* from the bank number (which seems very weird, in my opinion...)
So in order to shift the bank upwards, you would have to offset by a
negative number.
Cheers,
Marcus
_______________________________________________
fluid-dev mailing list
https://lists.nongnu.org/mailman/listinfo/fluid-dev
David Back
2017-12-20 21:08:01 UTC
Permalink
Thanks Marcus, I will give this a try.
It would be useful to know whether this command has to be given beforeor after loading the sound font. Or perhaps it makes no difference.
I agree subtracting seems weird to me as well. But I have never had muchsuccess with midi bank selection, there seem to be problems everywhereyou look. Even using CC's its not easy to write code which works on anysystem.
David

From: Marcus Weseloh <***@weseloh.cc>
To: David Back <***@yahoo.co.uk>; FluidSynth mailing list <fluid-***@nongnu.org>
Sent: Wednesday, 20 December 2017, 14:38
Subject: Re: [fluid-dev] fluidsynth, Midi Bank Select

Hi David,
Post by David Back
Would fluid_synth_set_bank_offset( );
be useful. If so what is starting point for offsetting? Would an offset of 1 select bank
If I read the source correctly, then it seems like the bank offset is *subtracted* from the bank number (which seems very weird, in my opinion...)So in order to shift the bank upwards, you would have to offset by a negative number.

Cheers,
    Marcus
Marcus Weseloh
2017-12-20 21:47:13 UTC
Permalink
Hi David,
Post by David Back
It would be useful to know whether this command has to be given before
or after loading the sound font. Or perhaps it makes no difference.
Well, as one of the parameters to the fluid_synth_set_bank_offset function
is the sound font id, you will have to use it after loading.
And in case you use fluid_synth_program_reset, the offset needs to be set
before the reset call.

Instead of using the API, you could also use the FluidSynth command line:

load /path/to/sound/font.sf2 0 -10

That would load the soundfont with an offset of 10. So FluidSynths bank 0
will load the soundfont bank 10. The second parameter controls whether to
resend a bank select and program change for every channel after loading (1)
or not (0).

Cheers,

Marcus
David Back
2017-12-21 08:51:46 UTC
Permalink
Thanks Marcus for your very useful information. I think you have nowanswered all my questions and I have already started to implementthe set_bank_offset function. I may know later today whether it worksas I hope it will and will let you know the result.
David

From: Marcus Weseloh <***@weseloh.cc>
To: David Back <***@yahoo.co.uk>
Cc: FluidSynth mailing list <fluid-***@nongnu.org>
Sent: Wednesday, 20 December 2017, 21:47
Subject: Re: [fluid-dev] fluidsynth, Midi Bank Select

Hi David,
Post by David Back
It would be useful to know whether this command has to be given before
or after loading the sound font. Or perhaps it makes no difference.
Well, as one of the parameters to the fluid_synth_set_bank_offset function is the sound font id, you will have to use it after loading.And in case you use fluid_synth_program_reset, the offset needs to be set before the reset call.
Instead of using the API, you could also use the FluidSynth command line:
   load /path/to/sound/font.sf2 0 -10
That would load the soundfont with an offset of 10. So FluidSynths bank 0 will load the soundfont bank 10. The second parameter controls whether to resend a bank select and program change for every channel after loading (1) or not (0).
Cheers,
    Marcus

 

Loading...