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 autoswi


From: David Henningsson
Subject: Re: [fluid-dev] Re: Patch for channel_type, also XG drum-channel autoswitch
Date: Fri, 11 Feb 2011 08:02:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 2011-02-10 22:51, jimmy wrote:


--- On Thu, 2/10/11, David Henningsson<address@hidden>  wrote:


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.

Perhaps you are talking about GM, GS mode where bank# is LSB.  Now, just think 
XG uses MSB instead of LSB.

I'm looking at the xg_spec from here: http://web.archive.org/web/20060926124939/http://www.yamaha.co.uk/xg/reading/pdf/xg_spec.pdf

"The Bank Select MSB selects melody voice, SFX voice, or rhythm kit. The MSB allows any channel to be designated for rhythm play.
Bank Select MSB values are as follows.
00H: Melody voice
01H to 3FH: not used
40H: SFX voice
41H to 7DH: not used
7EH: SFX kit (SFX voices arranged over keyboard)
7FH: Rhythm kit (Rhythm voices arranged over keyboard)
XG Specifications ver.1.26

And if I look at table 1 on page 35, you see that MSB stays at 0 and LSB varies, and that the variation in turn gives different banks.

Now, the two questions are:

1) Does the XG world work that way? Is the above wrong? I e, unless there is consensus here that we should deviate from the standard, I'm unhappy to do so.

2) The SF2 spec - which Pedro quoted - says that sf2 bank 0-127 is melodic and 128 is drums. So there is no "SFX Voice" in the SF2 standard, and no "SFX Kit" either. So what do we do with it? Currently, we ignore MSB for 64/0x40 and map 126/0x7E, to drums, but should we change the bank calculation from "LSB" to MSB*128+LSB (mma style), the result for 64/0x40 would be a bank outside the valid SF2 bank range.

MSB=128 is drum in XG,

MSB range is 0 - 127, so it can't be 128.

as well as MSB=126, MSB=120.  No difference in that regard (the number 128).  
The only difference is that it is sent via CC#0.  So for MMA-calculation 
(basically convert to decimal number the combination of MSB, LSB), MSB need to 
be shifted 7 bits further to the left.  And this is done only for XG 
bank-select style in my code.  I hope it help clear any confusion.

I understand that you want MSB*128+LSB / mma-style calculation for XG, I'm just not convinced that it's the right way to do.

I did look over the fluid_synth_program_change function and
tried to
clear it up a little. It's also in r406. With that patch
and your
example I now get:

fluidsynth: warning: Instrument not found on channel 6
[bank=128
prog=1], substituted [bank=128 prog=0]

...which is what it actually did, both before and after
r406.

// David


Hmmm... ???  I'll take another look on my side.  Again, can you try with:

    fluidsynth  -o synth.midi-bank-select=xg

if and when you get a chance.

My test included that option.

// David



reply via email to

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