[Scummvm-devel] [Scummvm-cvs-logs] SF.net SVN: scummvm:[48147] scummvm/trunk/engines/draci/music.cpp

Johannes Schickel lordhoto at scummvm.org
Sun Feb 28 00:31:34 CET 2010


Robert Špalek wrote:
> On Sat, Feb 27, 2010 at 3:01 PM, Jordi Vilalta 
> <jvprat at users.sourceforge.net <mailto:jvprat at users.sourceforge.net>> 
> wrote:
>
>     The draci engine also changes the channel masfor MT32 devices in line
>     132 of draci.cpp:
>     _midiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
>
>     I hope it solves the mystery ;)
>
>
> I copied & pasted this line from another engine.  I don't know what 
> this code means.  if you know more about MIDI, I'd love to learn from 
> you.  my intention was just to play given MIDI files read from disk 
> about which I know literally nothing.
>
> I was surprised that this simple task is very complicated in ScummVM, 
> as opposed to just playing samples or MP3's.  I had to copy & paste 
> non-trivial MIDI code from other modules and do a lot of 
> initialization and configuration work.  I just did it such that it 
> works for me.

Actually MT-32 MIDI is no General MIDI implementation first of all. Next 
the MT-32 does only feature 9 channels, while all (?) General MIDI 
implementations feature 16 channels. That's actually why the channel 
mask is set to 0x3FE, which is binary 0000001111111110, i.e. it only 
enables channels 2-10 (when you start counting from 1 on). By default 
those are the only channels the MT-32 will accept MIDI data, for example 
channel 1 (or 0) is "ignored" by default. AFAIK it is possible to 
reconfigure the MT-32 to use different channels numbers for data.

// Johannes




More information about the Scummvm-devel mailing list