aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sci/sound/music.cpp2
-rw-r--r--sound/midiparser.cpp15
-rw-r--r--sound/midiparser.h2
3 files changed, 14 insertions, 5 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 6628c175c6..d92669de39 100644
--- a/engines/sci/sound/music.cpp
+++ b/engines/sci/sound/music.cpp
@@ -416,7 +416,7 @@ void SciMusic::soundPlay(MusicEntry *pSnd) {
uint16 prevLoop = pSnd->loop;
pSnd->loop = 0;
// Fast forward to the last position and perform associated events when loading
- pSnd->pMidiParser->jumpToTick(pSnd->ticker, true);
+ pSnd->pMidiParser->jumpToTick(pSnd->ticker, true, true, true);
// Restore looping
pSnd->loop = prevLoop;
}
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp
index 929b1d8b12..6559e07468 100644
--- a/sound/midiparser.cpp
+++ b/sound/midiparser.cpp
@@ -361,7 +361,7 @@ void MidiParser::hangAllActiveNotes() {
}
}
-bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes) {
+bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes, bool dontSendNoteOn) {
if (_active_track >= _num_tracks)
return false;
@@ -402,8 +402,17 @@ bool MidiParser::jumpToTick(uint32 tick, bool fireEvents, bool stopNotes) {
_driver->sysEx(info.ext.data, (uint16)info.length-1);
else
_driver->sysEx(info.ext.data, (uint16)info.length);
- } else
- sendToDriver(info.event, info.basic.param1, info.basic.param2);
+ } else {
+ if (info.command() == 0x9 && dontSendNoteOn) {
+ // Don't send note on; doing so creates a "warble" with some instruments on the MT-32.
+ // Refer to patch #3117577
+
+ // TODO: this is currently done by SCI only, but it seems sensible enough to do this
+ // for all engines
+ } else {
+ sendToDriver(info.event, info.basic.param1, info.basic.param2);
+ }
+ }
}
parseNextEvent(_next_event);
diff --git a/sound/midiparser.h b/sound/midiparser.h
index 3ef99fcd6e..9ebcae7a07 100644
--- a/sound/midiparser.h
+++ b/sound/midiparser.h
@@ -383,7 +383,7 @@ public:
void stopPlaying();
bool setTrack(int track);
- bool jumpToTick(uint32 tick, bool fireEvents = false, bool stopNotes = true);
+ bool jumpToTick(uint32 tick, bool fireEvents = false, bool stopNotes = true, bool dontSendNoteOn = false);
uint32 getPPQN() { return _ppqn; }
virtual uint32 getTick() { return _position._play_tick; }