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 problem


From: Josh Green
Subject: Re: [fluid-dev] invalid instrument/drum selection problem
Date: Mon, 07 Jan 2008 13:48:28 -0800

On Mon, 2008-01-07 at 12:03 -0800, jimmy wrote:
> Hi Josh,
> 
> Sorry, I missed the part you asked about specific MIDI
> files that causes problem.  The last file on this list
> is one that will cause trouble.
> 
> www.geocities.com/TheTropics/Cabana/4967/inicial.html
> www.geocities.com/TheTropics/Cabana/4967/Amor_Eterno.mid
> www.geocities.com/TheTropics/Cabana/4967/Ansiedad.mid
> www.geocities.com/TheTropics/Cabana/4967/allanera.mid
> www.geocities.com/TheTropics/Cabana/4967/Bailamos.mid
> www.geocities.com/TheTropics/Cabana/4967/bamboleo.mid
> www.geocities.com/TheTropics/Cabana/4967/besame.mid
> www.geocities.com/TheTropics/Cabana/4967/caballo.mid
> 
> Fluidsynth will play all the other files fine.  On the
> last file, it reset the drumset to be "Grand Piano". 
> After that, if I try to go back and play the previous
> files on this list, I hear "Grand Piano" for drums,
> probably because the drums are never set/reset by
> those files, except for the bad one that spoils it.
> 

Cool, thanks for the examples.  Sounds like FluidSynth should reset
itself to a default state each time a new MIDI file is started.

I just tried that last MIDI file and did not experience the same issue
as far as the drums channel #10 getting remapped to piano.  I do see
that it sends some strange bank change messages to MIDI channels 7 and 8
though, which thus become unmapped and not present in the song.  It
looks like its mapping bank 1026 (0x402 hex) which corresponds to 0x08
MSB bank and 0x02 LSB bank values.  That file doesn't have any SYSEX
messages to select what type of module it is though.  I'd be curious how
other MIDI soft synths handle that and what module its expecting.

> No matter what the GS specs.says.  The drumchannel
> should never be set to "Gran Piano" if there is a
> valid drumset available - don't you think?  Anyway, I
> think the DRUM_INST_MASK constant in src/fluid_synth.h
> should really be 128.  In the released code, it tries
> to use DRUM_INST_MASK as an offset for the drum
> channel selection, but that constant is erroneously
> set to 
> 
>    #define DRUM_INST_MASK         ((unsigned
> int)0x80000000)
> 
> Some of the channel 9 progarm change uses channel 128
> or higher, some uses an offset from 128.
> 
        
I think that flag was supposed to be used internally as a way of marking
an instrument as percussion.  Its correct as far as the DLS standard is
concerned, but FluidSynth doesn't support DLS directly so I'm not sure
how it made it into the code.  I'd expect that same flag to get set in
some other part of the code though for SoundFont files, which isn't the
case.  So you are right, it probably should be changed to 128 and the
code:

      /* try to search the drum instrument first */
      preset = fluid_synth_find_preset(synth, banknum | DRUM_INST_MASK, 
prognum);

should be changed to:

      /* try to search the drum instrument first */
      preset = fluid_synth_find_preset(synth, DRUM_INST_BANK, prognum);

Where DRUM_INST_BANK is 128.

> Jimmy
> 

Cheers!
        Josh






reply via email to

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