Fluid synth channel 10

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Fluid synth channel 10

David Back
Hi Tom

Its about a year since you successfully advised me how to set up midi soundfont banks on Fluidsynth. Since then my organ eplayOrgan has been progressing and improving nicely.

The organ uses 4 instances of fluidsynth, one each for Swell, Great, Accomp and Pedal Divisions. I am using channel 10 in the Pedal Division to provide the default midi percussion but I would like to unset the percussion default in channel 10 of the other three instances so that I can use the channel for normal midi.

I have tried fluid_synth_unset_program(synth, 9); and this returns 0 (OK) however the command is ignored and ch10 remains at its default.

How can I unset the default to midi percussion in channel 10?

Thank you






_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fluid synth channel 10

Tom M.
Hi David,

you need to change the channel type of that channel, by calling:

fluid_synth_set_channel_type(synth, 9, CHANNEL_TYPE_MELODIC);

After this, fluidsynth will treat all program change events for channel 10 as it does for the other channels by default. Note that fluidsynth uses zero based counting of channels, so its channel 9 here.

Also make sure to select your personally preferred bank selection mode with the "synth.midi-bank-select" setting:

http://www.fluidsynth.org/api/fluidsettings.xml#synth.midi-bank-select

> I have tried fluid_synth_unset_program(synth, 9); and this returns 0 (OK) however the command is ignored and ch10 remains at its default.

On every program change, fluidsynth tries to find a preset that the soundfont provides. For drum channels it tries bank 128, which is why percussion instruments keep being selected.


Tom




_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fluid synth channel 10

Tom M.
> I do not give FS any midi commands, it all works from the FS software functions so I do not think your bank select comment has any relevance at the present time.

It doesn't matter whether bank changes come as midi events or via API functions. What fluidsynth makes of it always depends on the bank selection mode. However, if selecting instruments and percussion works fine for you, there's indeed no need to change the mode.

Tom




_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fluid synth channel 10

Tom M.
David, please make sure to send a copy of your mails to the mailing list.

> However if I then assign another FSchannel to be percussion e.g.fluid_synth_set_channel_type(synth, 12, CHANNEL_TYPE_DRUM);this channel plays the instrument I have assigned in channel 9 as well as the percussion (and sounds awful).

Did you send a note off on channel 12? Did you issue fluid_synth_program_reset()?

> Do the channel_type commands above also set the bank?

No. They only set the channel type, which is basically a no-op to the user. The type is only considered on a program change event to determine a fallback instrument bank. That said: I cannot recommend to switch channel types back and forth with fluid_synth_set_channel_type(). You should rather turn all channels into melodic ones and select percussion by setting the bank (using e.g. fluid_synth_bank_select()) appropriately to what it is in your soundfont (usually bank 128).

Also note that I must correct myself: The bank selection mode only matters when using fluid_synth_cc(). fluid_synth_bank_select() is not affected by it, you were correct. Sry for the confusion.


Tom


14. Jan. 2019, 16:47:24 CET:
>  Thanks Tom
> I do not think I need to change the mode from the default - however I do need to COMPLETELY undo the default bank and channel type for FS channel 9 (default percussion channel) and I do need to set other different FS channels to play percussion.As you suggestfluid_synth_set_channel_type(synth, 9, CHANNEL_TYPE_MELODIC);does allow me to assign a midi instrument to this default percussion channel and it plays OK.
> However if I then assign another FSchannel to be percussion e.g.fluid_synth_set_channel_type(synth, 12, CHANNEL_TYPE_DRUM);this channel plays the instrument I have assigned in channel 9 as well as the percussion (and sounds awful).
> Do the channel_type commands above also set the bank? or should I perhaps also usefluid_synth_bank_select(synth, 9, 1);   //the normal bank for melodic instruments and fluid_synth_bank_select(synth, 12, 127);//127? 128? the normal bank for percussion
> to set the banks of these channels?
> David (csw900)
>  



_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fluid synth channel 10 etc.

David Back
Hi Tom

Many thanks, once again your advice has been invaluable. The only catch was that percussion bank 128 also needs program change 0 to be set as it does not default to 0.

Best Wishes
David (csw900)


On ‎Monday‎, ‎14‎ ‎January‎ ‎2019‎ ‎18‎:‎50‎:‎47‎ ‎GMT, Tom M. <[hidden email]> wrote:


David, please make sure to send a copy of your mails to the mailing list.

> However if I then assign another FSchannel to be percussion e.g.fluid_synth_set_channel_type(synth, 12, CHANNEL_TYPE_DRUM);this channel plays the instrument I have assigned in channel 9 as well as the percussion (and sounds awful).

Did you send a note off on channel 12? Did you issue fluid_synth_program_reset()?

> Do the channel_type commands above also set the bank?

No. They only set the channel type, which is basically a no-op to the user. The type is only considered on a program change event to determine a fallback instrument bank. That said: I cannot recommend to switch channel types back and forth with fluid_synth_set_channel_type(). You should rather turn all channels into melodic ones and select percussion by setting the bank (using e.g. fluid_synth_bank_select()) appropriately to what it is in your soundfont (usually bank 128).

Also note that I must correct myself: The bank selection mode only matters when using fluid_synth_cc(). fluid_synth_bank_select() is not affected by it, you were correct. Sry for the confusion.


Tom


14. Jan. 2019, 16:47:24 CET:
>  Thanks Tom
> I do not think I need to change the mode from the default - however I do need to COMPLETELY undo the default bank and channel type for FS channel 9 (default percussion channel) and I do need to set other different FS channels to play percussion.As you suggestfluid_synth_set_channel_type(synth, 9, CHANNEL_TYPE_MELODIC);does allow me to assign a midi instrument to this default percussion channel and it plays OK.
> However if I then assign another FSchannel to be percussion e.g.fluid_synth_set_channel_type(synth, 12, CHANNEL_TYPE_DRUM);this channel plays the instrument I have assigned in channel 9 as well as the percussion (and sounds awful).
> Do the channel_type commands above also set the bank? or should I perhaps also usefluid_synth_bank_select(synth, 9, 1);  //the normal bank for melodic instruments and fluid_synth_bank_select(synth, 12, 127);//127? 128? the normal bank for percussion
> to set the banks of these channels?
> David (csw900)




_______________________________________________
fluid-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/fluid-dev