As a safety check...
Also throw out some warnings when loading savegames
with instrument data for a different device (the savegame
incompatibility would be very nice to be fixed, but it is not
trivial.
Currently, Roland MT-32 sound is broken for
SAMNMAX. Just try the intro song with shut off
speech. It is very obvious that it plays with a quite
reduced number of channels compared to the
original interpreter.
Now, due to the not-so-helpful code design (much
of the iMuse code has been drawn into the common
code) it has become increasingly difficult to fix Midi
related thing in iMuse. I have added more and more
crude hacks over time.
SAMNMAX requires more elaborate channel
allocation. To make it happen I have added driver
wrappers for Midi to the iMuse code.
Other than that, I have done only minor cleanup here.
Actually, I would have liked to withdraw much more
of the iMuse code from the common code and move
it to SCUMM (basically all the MidiChannel
stuff which is exclusively used by iMuse. But it turns
out that it is so thoroughly intertwined (the major
blocker here being the AdLib driver) that it requires
more thought and effort and would just distract me
from fixing the SAMNMAX sound.
This will actually read out of bounds in the orginal interpreter, too. I have fixed it to be more in line with the original (the value in question is always treated as unsigned here), but still not do anything harmful.
Continued bug fixing for ticket no. 13460 ("Incorrect MIDI
pitch bending"). This time the AdLib part (which applies
to FM-Towns, too, since it is more or less the same driver).
This fixes the sound when the bird is dropping from the
sky in the DOTT intro.
Also separate the GM code for SAMNMAX a bit after
checking the original code.
The pitch bend in Sam & Max was exaggerated when using the OPL3 driver. The
OPL3 functionality was apparently implemented by examining just the original
driver code and not the MIDI processing code in the interpreter. The pitch bend
values sent to the driver are not standard MIDI pitch bend values, but have
been processed by the interpreter, so the driver logic cannot be directly
applied to the pitch bend values from the MIDI data.
This commit fixes the pitch bend calculations to produce the same results as
the original interpreter. It also restores the pitch bend range functionality.
This was disabled for OPL3, probably because it is implemented in the
interpreter instead of the driver. It is used in several Sam & Max MIDI tracks.
As discussed on the mailing list we should use title capitalization
only for push buttons and tabs and use sentence capitalization for
everything else.