From: <sv...@op...> - 2024-08-09 18:10:14
|
Author: sagamusix Date: Fri Aug 9 20:10:02 2024 New Revision: 21375 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21375 Log: [Fix] MED: For MOD-style vibrato, a speed parameter of 0 was not treated as effect memory, and the speed "fixup" was incorrect anyway. For both vibrato types, the speed is now correct (position incremented on every tick). Modified: trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Fri Aug 9 19:39:56 2024 (r21374) +++ trunk/OpenMPT/soundlib/Load_med.cpp Fri Aug 9 20:10:02 2024 (r21375) @@ -434,7 +434,7 @@ switch(command) { case 0x04: // Vibrato (twice as deep as in ProTracker) - m.SetEffectCommand(CMD_VIBRATO, (std::min<uint8>(param >> 3, 0x0F) << 4) | std::min<uint8>((param & 0x0F) * 2, 0x0F)); + m.SetEffectCommand(CMD_VIBRATO, (param & 0xF0) | std::min<uint8>((param & 0x0F) * 2, 0x0F)); break; case 0x08: // Hold and decay break; @@ -514,7 +514,7 @@ m.SetEffectCommand(CMD_MODCMDEX, 0x20 | nibbleLo); break; case 0x14: // Vibrato (ProTracker compatible depth, but faster) - m.SetEffectCommand(CMD_VIBRATO, (std::min<uint8>((param >> 4) + 1, 0x0F) << 4) | (param & 0x0F)); + m.SetEffectCommand(CMD_VIBRATO, param); break; case 0x15: // Set finetune m.SetEffectCommand(CMD_MODCMDEX, 0x50 | (param & 0x0F)); Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Fri Aug 9 19:39:56 2024 (r21374) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Fri Aug 9 20:10:02 2024 (r21375) @@ -1646,7 +1646,7 @@ if(chn.dwFlags[CHN_VIBRATO]) { - const bool advancePosition = !m_PlayState.m_flags[SONG_FIRSTTICK] || ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && !(m_SongFlags[SONG_ITOLDEFFECTS])); + const bool advancePosition = !m_PlayState.m_flags[SONG_FIRSTTICK] || ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_MED)) && !(m_SongFlags[SONG_ITOLDEFFECTS])); if(GetType() == MOD_TYPE_669) { |