|Subject:||Re: [fluid-dev] MIDI bank select problems|
|Date:||Fri, 29 Nov 2013 18:28:07 -0700|
On 11/29/2013 11:31 AM, Element Green wrote:The way I see it, it's basically a shifted+masked value pair. i.e.
The original MIDI standard pretty much spells that out, though I think
there was some confusion around it leading to divergent vendor standards.
CC 32-63 are supposed to be the least significant bytes and CC 0-31 the
most significant bytes of 14 bit controller values.
Instead, the MMA went a different way with GM2. CC0 selects a channel typeI don't really see it as a "different way" in respect to MIDI, but more in
(120 = percussion (only allowed on channels 9 and 10), and 121 = melodic),
and CC32 selects a bank (must be 0 on percussion channels).
comparison to the other instrument mapping standards. Interpreting CC0 and
CC32 as MSB/LSB of a 14 bit number (as the GM2 article on Wikipedia also
says), then GM2 percussion is on bank 15360 and the melodic banks start
int type = ctrl >> 7;
int bank = ctrl & 127;
The upper bits hold the channel type, and the lower bits hold the bank number. You can't use more than 128 melodic banks (just like with GS and XG) since the 128th bank value will overflow into the type bits:
01111001000000 /* CC0 121 */
00000001000000 /* bank 128 */
And since percussion must set CC32 to 0, you still get 128 melodic banks (0-127), and a percussion bank (implied 128).
Though that's just my interpretation from the wikipedia page.
|[Prev in Thread]||Current Thread||[Next in Thread]|