[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] invalid instrument/drum selection

From: jimmy
Subject: Re: [fluid-dev] invalid instrument/drum selection
Date: Tue, 27 Jan 2009 08:28:33 -0800 (PST)

Hi Josh,

Again, the test midi is:


May I suggest a change in

   src/fluid_synty.c:  fluid_synth_program_change()

changing the two lines near the end from:

       fluid_channel_set_sfontnum(channel, sfont_id);
       fluid_channel_set_preset(channel, preset);

put an extra check that "preset" is not NULL first, to become:

    if ( preset ) {
       fluid_channel_set_sfontnum(channel, sfont_id);
       fluid_channel_set_preset(channel, preset);

It would take care of the case when the preset is NULL, which is the case when 
the loaded soundfonts doesn't have the prognum.

>From what I understand in XG sounds, the same prognum for different soundbanks 
>are the same type of instrument.  In the simplest case, it can simply be same 
>instrument with different effects.

The suggested change doesn't guarrantee the same type of instrument, just keep 
the already loaded instrument in that channel.  Currently it sets the channel 
to point to invalid, non-existing instrument.

Preferably, FS should try to find any soundbank with that prognum and use that 
instrument instead.  Maybe you can decide what best to do here.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]