Skip to content

Commit

Permalink
SCUMM: Fix regression that caused "pops" in MI1 jungle music
Browse files Browse the repository at this point in the history
Properly treat rests as rests, not notes. Otherwise, it would try
to play a really low note which just came out as a "pop".
  • Loading branch information
Torbjörn Andersson committed Nov 18, 2012
1 parent 34a8b50 commit ae823b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 7 additions & 2 deletions engines/scumm/player_v3m.cpp
Expand Up @@ -168,8 +168,13 @@ bool Player_V3M::getNextNote(int ch, uint32 &samples, int &pitchModifier, byte &
uint16 duration = READ_BE_UINT16(&_channel[ch]._data[_channel[ch]._pos]);
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
samples = durationToSamples(duration);
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
velocity = 127;
if (note > 0) {
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
velocity = 127;
} else {
pitchModifier = 0;
velocity = 0;
}
_channel[ch]._pos += 3;
return true;
}
Expand Down
11 changes: 9 additions & 2 deletions engines/scumm/player_v5m.cpp
Expand Up @@ -186,8 +186,15 @@ bool Player_V5M::getNextNote(int ch, uint32 &samples, int &pitchModifier, byte &
uint16 duration = READ_BE_UINT16(&_channel[ch]._data[_channel[ch]._pos]);
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
samples = durationToSamples(duration);
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
velocity = _channel[ch]._data[_channel[ch]._pos + 3];

if (note > 1) {
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
velocity = _channel[ch]._data[_channel[ch]._pos + 3];
} else {
pitchModifier = 0;
velocity = 0;
}

_channel[ch]._pos += 4;

if (_channel[ch]._pos >= _channel[ch]._length) {
Expand Down

0 comments on commit ae823b5

Please sign in to comment.