fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] MIDI bank select problems


From: Chris Robinson
Subject: Re: [fluid-dev] MIDI bank select problems
Date: Thu, 28 Nov 2013 22:53:20 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9

On 11/28/2013 08:05 PM, Element Green wrote:
Good idea to read through the archives..  I also did this and came up with
a thread which occurred around the date when the code was checked in for
the synth.midi-bank-select option.  I came up with this email in particular
from Pedro which describes the MMA mode:
https://lists.nongnu.org/archive/html/fluid-dev/2010-08/msg00046.html

Hmm, odd. According to that, Creative thinks MMA mode should be CC0*128 + CC32, but neither the GM1 or GM2 standards define this behavior. In fact, GM1 doesn't have bank select messages, and GM2 hadn't been adopted yet when the SoundFont (1 or 2) stuff was created. Looks like this is just what Creative thought the MMA was going to standardize on, but it's really an XG mode that doesn't ignore CC0 as part of the bank number.

Instead, the MMA went a different way with GM2. CC0 selects a channel type (120 = percussion (only allowed on channels 9 and 10), and 121 = melodic), and CC32 selects a bank (must be 0 on percussion channels).

I'm personally curious though, why you chose GM2 as your
MIDI variation of choice?

Mainly because GS and XG are vendor-specific, while GM2 is about as standard as you can get here. And unlike GM1, GM2 allows switching channel 9 to act like a normal channel, which I feel adds an important bit of flexibility in letting the app developer worry about where and how instruments can be mapped in a custom soundfont.

In reading that above email, however, it seems Creative says SF2 synths must use GS mode by default, and I'm aiming for OpenAL Soft's MIDI extension to provide an SF2-compatible synth so developers can know what they're working with. So I guess I shouldn't try forcing GM2 on initialization.


Still, that leaves the question of how to allow apps to use the bank/instrument they want on channel 9. I suppose the "correct" way would be for them to send a GM2 On sysex message {0x7E, 0x09, 0x03}, as described here <http://www.midi.org/techspecs/midimessages.php>, if they want it. But I don't think FluidSynth recognizes that.

The other possibility is that I could watch for CC32 being set to 120 or 121 on channels 9 and 10 in OpenAL's MIDI event handler, switching the channel to be percussion or melodic accordingly via fluid_synth_set_channel_type, and leaving CC0 to be the bank number as per GS mode (basically reversing the bytes as described in GM2).

Supporting the GM2 On sysex message sounds like the better option to me, as its the more standards-compliant way. Watching CC32 is also a possibility, but I'd like to avoid custom behavior if I can.



reply via email to

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