fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Revised patch for new channel field is_drum_channel


From: jimmy
Subject: Re: [fluid-dev] Revised patch for new channel field is_drum_channel
Date: Tue, 1 Feb 2011 16:15:12 -0800 (PST)

If someone has a pressing need for this patch, let us know.  I can try to 
revise and resubmit the simple patch, without XG support for the moment.

Otherwise, before I send the patch for drum channel, perhaps we can hash out 
how Fluidsynth should deal with XG MSB, LSB, ProgChange messages and the 
expected sequence/order of these messages.


-----

Some info on XG (about 8 pages each):

   www.jososoft.dk/yamaha/pdf/xgformat.pdf
   www.jososoft.dk/yamaha/pdf/introxg.pdf


Some other info on XG MSB, LSB Bank Change info:

   www.jososoft.dk/yamaha/articles/style2_8.htm

   myweb.tiscali.co.uk/mikesmusic/my_technical_articles2.html#msb
   
   hem.passagen.se/mrstone/_html/xgmidi.html#Overview

-----


XG bank calculation is (128*MSB+LSB).  XG recommends sending MSB, LSB, 
ProgChange in that order.  LSB is optional (calculate as LSB=0 if not sent).  
When MSB is 64 (SFX), 126 (SFX-kit), or 127 (drum-kit), LSB is most likely 
optional.  When MSB is less than 64, more likely additional LSB value should 
follow the MSB message.

GM sound set is at bank 0 (MSB=0, LSB=0).  GM drum bank is 16256 (MSB=127, 
LSB=0).

Note from:

   en.wikipedia.org/wiki/Comparison_of_MIDI_standards
   
has links to some archived XG docs (PDF), and regarding XG drum channels:

   every channel can play drum kits with Bank Select MSB (CC#0) set to 7FH
   
Published in 1995:

   www.jososoft.dk/yamaha/pdf/introxg.pdf

implies that MSB=126 (7Eh, 0x7E) is SFX-kit, special effects mapped each to a 
key.

From:

   
www.heikoplate.de/mambo/index.php%3Foption=com_content&task=view&id=426&Itemid=63
   
   "The XG percussion voices are organisized in the bank MSB=127/LSB=0, the 
Arabic Kit (only PSR-9000) in the bank MSB=126/LSB=0."

PSR-9000 was available around the year 2000.

I'll try to look up some more manuals on drum-kits, SFX-kit relating to 
MSB=126.  For now, about channel_type auto-switching (in XG mode), we are 
looking at:

    (126 <= MSB) -->  DRUM channel (MSB 127, or 126)
    (125 >= MSB) -->  MELODIC channel

-----


Within XG-mode handling, not mentioned is should the sequence [LSB, ProgChange] 
(without MSB preceding) is allowed at all???  I would assume it means using 
existing MSB.

What about [ProgChange] only without MSB, or LSB preceded ProgChange?  Does 
this mean using existing MSB and LSB ???  I would assume it is.  Do all 
Midi-keyboard controllers (no sound module on board) always send MSB (CC#0)?  
Or, some of them send ProgChange only?

Potentially, the sequence [LSB, MSB, ProgChange] may come in, too.  This may 
also happen in midi-merge cases, besides midi files.

-----

So how should Fluidsynth deal with MSB, LSB for XG ?

The recommended the sequence of messages are [MSB, LSB, ProgChange].  Omitting 
LSB is allowed and would assume LSB=0.  In this case, Fluidsynth handling of 
MSB message can set LSB=0.  If LSB is next message in the sequence it will 
override the LSB=0 (set by MSB handling).  Keep in mind that when MSB is 64 or 
higher (currently only 64, 126, 127 are used), then LSB is completely optional 
(not needed, but may be there) for any "current" XG devices.

But if some midi file(s), or midi-merge have [LSB, MSB, ProgChange] sequence 
(not recommended), MSB message handling should not set LSB=0 at all -- 
especially if MSB is less than 64.  Should Fluidsynth try to handle this 
sequence of messages for XG mode at all?

-----

All the above are only to set/save MSB, LSB, ProgChange values, needed for 
recording Midi.  Not dealing with instrument substitution portion afterward in 
voice rendering, yet.


Jimmy






--- On Sun, 1/30/11, David Henningsson <address@hidden> wrote:

> From: David Henningsson <address@hidden>
> Subject: Re: [fluid-dev] Revised patch for new channel field is_drum_channel
> To: "jimmy" <address@hidden>
> Cc: address@hidden
> Date: Sunday, January 30, 2011, 12:13 AM
> On 2011-01-29 21:01, jimmy wrote:
> > --- On Fri, 1/28/11, David Henningsson<address@hidden> 
> wrote:
> >>
> >> On 2011-01-28 23:07, jimmy wrote:
> >>>
> >>> Here's the revised patch file for the new
> channel
> >> field "is_drum_channel".
> >>
> >> Thanks, but you're missing the patch :-)
> >>
> >> // David
> >>
> >
> > Oops, here it is.
> 
> Thanks. I've fixed a few bugs in your patch - see the
> attached diff.
> 
> But there was one thing keeping me from committing the
> fixed version:
> 
> +
> +  /* if style == XG and bankmsb == 127, convert the
> channel to drum mode.
> +   * How should "newval" above be
> calculated (same as MMA style) ??? */
> +  if (style == FLUID_BANK_STYLE_XG && (127 ==
> bankmsb))
> +  {
> +      chan->is_drum_channel =
> CHANNEL_TYPE_DRUM;
> +  }
> +
> 
> ...this doesn't feel right. First, it seems you can alter
> your channel 
> type via MIDI to be a drum channel, but there is no way to
> alter it back 
> to melodic (?).
> 
> Second, how should we calculate the new banknum in XG mode?
> Given your 
> comment, you don't seem to be certain yourself.
> 
> Could you start off with my fixed version of your patch,
> fix this as 
> well, and send a new diff back? Thanks!
> 
> // David
> 






reply via email to

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