GMD tracks through IMuseAdlib
|Reported by:||SF/jamieson630||Owned by:||SF/ender|
|Cc:||Game:||Sam and Max|
This patch augments IMuseAdlib with support for playing GMD (General MIDI) tracks using Adlib output.
* GMD tracks are now given a comparison priority even if _use_adlib is true. This allows GMD tracks to be selected in the absence of ADL (Adlib) tracks, where previously no track was selected at all.
* A table mapping GM programs to FM instrument definitions has been dropped into imuse.cpp. This table was built by matching up DOTT instrument definitions with GM program changes. While is still has gaps, it has been verified to provide reasonable output with the whole of DOTT and the Sam & Max demo.
* Program change messages cause IMuseAdlib to use the _glob_instr table ONLY if it has determined that anything was ever loaded into it (through SysEx command 0x11). Otherwise, it draws off the GM-to-FM mapping table.
Some attention areas:
* Percussion is not implemented. If IMuseAdlib detects anything coming in on the percussion channel, it throws it out. NOTE that this may actually be too indiscriminatory, i.e. actual Adlib tracks don't have a predefined percussion track and may use that channel legitimately. Probably need a way for IMuseAdlib to determine if it's a GM or Adlib track and filter channels accordingly. I didn't notice it kicking out Adlib parts, but I'm not certain that it NEVER does that.
* The mapping table currently provides definitions for about 70 out of 128 possible programs. If you want to help in making it complete, run ScummVM with Sam & Max full version, using debug level 2, and capture the output and send it to me. Program changes recorded in the debug output will tell me which programs are being used that are not implemented yet.
Hope this helps bring Sam & Max to life on those Linux systems! :-)
Ticket imported from: #615745. Ticket imported from: patches/172.