aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/imuse.cpp10
-rw-r--r--scumm/instrument.cpp9
-rw-r--r--scumm/instrument.h1
3 files changed, 18 insertions, 2 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index f4492acd45..2f12865ff1 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -1531,8 +1531,14 @@ void Part::noteOn(byte note, byte velocity) {
mc = _player->getMidiDriver()->getPercussionChannel();
if (!mc)
return;
- mc->volume(_vol_eff);
-// mc->programChange(_bank);
+ static byte prev_vol_eff = 128;
+ if (_vol_eff != prev_vol_eff){
+ mc->volume(_vol_eff);
+ prev_vol_eff = _vol_eff;
+ }
+ if ((note < 35) && (!_player->_se->isNativeMT32()))
+ note = Instrument::_gmRhythmMap[note];
+
mc->noteOn(note, velocity);
}
}
diff --git a/scumm/instrument.cpp b/scumm/instrument.cpp
index 03145cb6d9..e2d78d815c 100644
--- a/scumm/instrument.cpp
+++ b/scumm/instrument.cpp
@@ -114,6 +114,15 @@ roland_to_gm_map [] = {
// { "trickle4 ", ??? }
};
+const byte Instrument::_gmRhythmMap[35] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 36, 37, 38, 39, 40, 41, 66, 47,
+ 65, 48, 56};
+ // This emulates the percussion bank setup LEC used with the MT-32,
+ // where notes 24 - 34 were assigned instruments without reverb.
+ // It also fixes problems on GS devices that map sounds to these
+ // notes by default.
+
class Instrument_Program : public InstrumentInternal {
private:
byte _program;
diff --git a/scumm/instrument.h b/scumm/instrument.h
index 1d8c84a5d2..b51160f418 100644
--- a/scumm/instrument.h
+++ b/scumm/instrument.h
@@ -57,6 +57,7 @@ public:
Instrument() : _type (0), _instrument (0) { }
~Instrument() { delete _instrument; }
static void nativeMT32 (bool native);
+ static const byte _gmRhythmMap[35];
void clear();
void copy_to (Instrument *dest) { if (_instrument) _instrument->copy_to (dest); else dest->clear(); }