fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Re: Patch for channel_type, also XG drum-channel autos


From: Pedro Lopez-Cabanillas
Subject: Re: [fluid-dev] Re: Patch for channel_type, also XG drum-channel autoswitch
Date: Thu, 10 Feb 2011 20:11:33 +0100
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-desktop; KDE/4.4.4; i686; ; )

On Thursday 10 February 2011, David Henningsson wrote:
> On 2011-02-10 02:45, jimmy wrote:
> >
> >
> >> Hey jimmy,
> >>
> >> Thanks for the research. I've committed the patch now (with
> >> some trivial
> >> changes). Thanks for your contribution!
> >>
> >> And to the rest of you - this bank select handling seems to
> >> be a never
> >> ending debate, and it's not my area of expertise, so let me
> >> know if this
> >> change screwed something up for you.
> >>
> >> // David
> >
> >
> > Your change is not correct in both MSB, and LSB handling for XG bank 
> > calculation.
> 
> Yes, I let it stay the way Pedro wrote it. Maybe I should have mentioned 
> that explicitly, sorry.
> 
> Basically the problem is that Soundfont files can have bank numbers up 
> to 128 only, and that bank numbers 0-127 are melodic and bank 128 is 
> percussion. At least that's the way SWAMI works. I checked Unison.sf2, 
> and it follows this as well. I assume it's somewhere in the sf2 standard.
> 
> So bank numbers above 128 usually make no sense, which is why MSB is 
> ignored for XG (and why MMA style is not the default...). We're kind of 
> stuck between sf2's standard and XG's standard, and need to figure out 
> how to mediate between them.

Agreed. This issue has been already posted and discussed in this list, so here 
are some relevant excerpts and pointers. The SoundFont2 PHDR sub-chunk has this 
header structure:

struct sfPresetHeader
{
        CHAR achPresetName[20];
        WORD wPreset;
        WORD wBank;
        WORD wPresetBagNdx;
        DWORD dwLibrary;
        DWORD dwGenre;
        DWORD dwMorphology;
};

Where wBank is a 16bit field, like wPreset. But the specification states the 
range from 0 thru 127 for both the wBank and wPreset. Document "sfspec21.pdf", 
page 27:

"The WORD wPreset contains the MIDI Preset Number and the WORD wBank contains 
the MIDI Bank Number which apply to this preset. Note that the presets are 
not ordered within the SoundFont compatible bank. Presets should have a 
unique set of wPreset and wBank numbers. However, if two presets have 
identical values of both wPreset and wBank, the first occurring preset in the 
PHDR chunk is the active preset, but any others with the same wBank and 
wPreset values should be maintained so that they can be renumbered and used 
at a later time. The special case of a General MIDI percussion bank is
handled conventionally by a wBank value of 128. If the value in either field 
is not a valid MIDI value of zero through 127, or 128 for wBank, the preset 
cannot be played but should be maintained."

http://connect.creativelabs.com/developer/SoundFont/Forms/AllItems.aspx

Regards,
Pedro



reply via email to

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