mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 18:41:12 +00:00
SCUMM: Fix regression that caused "pops" in MI1 jungle music
Properly treat rests as rests, not notes. Otherwise, it would try to play a really low note which just came out as a "pop".
This commit is contained in:
parent
34a8b5049e
commit
ae823b5c6a
@ -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]);
|
uint16 duration = READ_BE_UINT16(&_channel[ch]._data[_channel[ch]._pos]);
|
||||||
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
|
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
|
||||||
samples = durationToSamples(duration);
|
samples = durationToSamples(duration);
|
||||||
|
if (note > 0) {
|
||||||
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
|
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
|
||||||
velocity = 127;
|
velocity = 127;
|
||||||
|
} else {
|
||||||
|
pitchModifier = 0;
|
||||||
|
velocity = 0;
|
||||||
|
}
|
||||||
_channel[ch]._pos += 3;
|
_channel[ch]._pos += 3;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -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]);
|
uint16 duration = READ_BE_UINT16(&_channel[ch]._data[_channel[ch]._pos]);
|
||||||
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
|
byte note = _channel[ch]._data[_channel[ch]._pos + 2];
|
||||||
samples = durationToSamples(duration);
|
samples = durationToSamples(duration);
|
||||||
|
|
||||||
|
if (note > 1) {
|
||||||
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
|
pitchModifier = noteToPitchModifier(note, &_channel[ch]._instrument);
|
||||||
velocity = _channel[ch]._data[_channel[ch]._pos + 3];
|
velocity = _channel[ch]._data[_channel[ch]._pos + 3];
|
||||||
|
} else {
|
||||||
|
pitchModifier = 0;
|
||||||
|
velocity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
_channel[ch]._pos += 4;
|
_channel[ch]._pos += 4;
|
||||||
|
|
||||||
if (_channel[ch]._pos >= _channel[ch]._length) {
|
if (_channel[ch]._pos >= _channel[ch]._length) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user