fluid-dev
[Top][All Lists]
Advanced

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

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


From: jimmy
Subject: [fluid-dev] Re: Patch for channel_type, also XG drum-channel
Date: Fri, 11 Feb 2011 14:06:34 -0800 (PST)


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

> 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.


The above XG doc is not wrong, it was mainly a guide (back in mid 1990's), 
check the date of that document.  Since then, newer Yamaha instruments came out 
with Drum/SFX-kits using MSB=126, and more recently MSB-120.

Some of their older SFX-kits use MSB=64, or so.  I don't know what to make of 
that, being Melodic, or Drum treatment.  But recent instruments have their 
SFX-kits in the MSB=126, and MSB=120 range with Drumkits.

As I replied to Pedro's latest message about soundfont specs.  So what if SF2 
supports only 128 banks.  For all we care, that fits completely into LSB banks. 
 Consider MSB as the multiplier of LSB.

If I want to use Unison.sf2 as MSB=0, SGM.sf2 as MSB=1, some NylonGuitar.sf2 as 
MSB=10, SomePiano.sf2 as MSB=20, ...  how is that conflicting with Soundfont 
specs?  Let alone that it is going to be done for XG-mode only for the moment.  
Just because you don't need MSB, don't care about MSB doesn't mean that you 
should throw away MSB.

MSB is part of the GM and GM2 spec.  Fluidsynth doesn't have know how to handle 
MSB, nor have any code working with MSB doesn't mean it should stay crippled.



> >> 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


In XG-mode the sequence of events recommended/expected are: MSB, LSB, 
ProgChange. Since your changes never kept the MSB in Fluid synth at all.  More 
than that if any LSB message came int, it specifically zero-out MSB, too.  How 
can it show anything higher than 128?

As I said, with my patch, at least it keeps the MSB and shows the banks that's 
needed for such midi files.  I can then search them in the midi files, or find 
a way to create/map a sound bank to work with it.

----

As I said above about using multiple soundfonts, that's exactly what MSB means 
in XG, and MMA calculation.  Don't let LSB be the limit of sound banks 
available in the system.  You can use MSB to multiply your LSB up to 127 times, 
assuming MSB=0 is the current default situation.

One simple way to do that is have a configuration file, for example:

   MSB[0] = Unison.sf2
   MSB[6] = CustomSynth.sf2
   MSB[11] = SpanishGuitar.sf2
   MSB[27] = SGM.sf2
   MSB[42] = MoreCustomSynth.sf2
   ...
   MSB[120] = CustomDrums.sf2
   MSB[126] = MoreCustomDrums.sf2


It doesn't break any SF2 specs.  In fact, that is what GM use of MSB/CC#0 calls 
for.  XG, and MMA calculation simply reflect the intention of MSB/CC#0.

Jimmy








reply via email to

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