diff options
author | Eugene Sandulenko | 2005-04-12 22:41:25 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-04-12 22:41:25 +0000 |
commit | 7c831c9c4c555db5d9a39d0d9abeed075a58a5fd (patch) | |
tree | 83913443fea2935e0db8df7b9997bd713cc32f2a | |
parent | 003b3a3f487500e17788590ea1c5e75b55221765 (diff) | |
download | scummvm-rg350-7c831c9c4c555db5d9a39d0d9abeed075a58a5fd.tar.gz scummvm-rg350-7c831c9c4c555db5d9a39d0d9abeed075a58a5fd.tar.bz2 scummvm-rg350-7c831c9c4c555db5d9a39d0d9abeed075a58a5fd.zip |
Patch #1180882 "GM/GS Percussion Remapping"
svn-id: r17569
-rw-r--r-- | scumm/imuse.cpp | 10 | ||||
-rw-r--r-- | scumm/instrument.cpp | 9 | ||||
-rw-r--r-- | scumm/instrument.h | 1 |
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(); } |