fluid-dev
[Top][All Lists]
Advanced

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

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


From: Josh Green
Subject: Re: [fluid-dev] invalid instrument/drum selection
Date: Tue, 27 Jan 2009 17:30:24 -0800

Hello Jimmy,

I remember discussing this issue way back when, but kind of left it for
later, since I wasn't really sure what the best solution was.  I should
probably read over the older thread, since I think I did have some good
ideas of how to resolve it then (something about determining whether the
MIDI file is expecting a GM, GS or XG MIDI device).

In summary and to check my understanding..

MIDI file selects an instrument in an alternative bank/program,
expecting a variation on an instrument.  The loaded SoundFont doesn't
have the particular bank/program combination.  Currently FluidSynth
mutes the channel.  What you are proposing is to just have it continue
using the previously selected instrument.

Personally I think FluidSynth should listen for MIDI events indicating
GM, GS or XG mode and also have the ability to override the mode
manually.  When in GS or XG mode, it could fall back to bank 0 same
program #, if an instrument is not found.  Does that sound adequate?
        Josh


On Tue, 2009-01-27 at 08:28 -0800, jimmy wrote:
> Hi Josh,
> 
> Again, the test midi is:
> 
>    www.sternton.com/midi/xgmidi/orion_xg.mid
> 
> 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.
> 
> Thanks,
> 
> Jimmy
> 
> 
> 
>       
> 
> 
> _______________________________________________
> fluid-dev mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fluid-dev





reply via email to

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