From: <sv...@op...> - 2024-05-28 16:30:24
|
Author: sagamusix Date: Sun May 26 18:31:11 2024 New Revision: 20854 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20854 Log: [Fix] MDL: Slide depth broke when introducing Hertz instead of periods in non-linear mode. Modified: trunk/OpenMPT/soundlib/Load_dtm.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Load_dtm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_dtm.cpp Sun May 26 00:52:48 2024 (r20853) +++ trunk/OpenMPT/soundlib/Load_dtm.cpp Sun May 26 18:31:11 2024 (r20854) @@ -231,6 +231,7 @@ InitializeGlobals(MOD_TYPE_DTM); InitializeChannels(); m_SongFlags.set(SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS | SONG_FASTPORTAS); + m_playBehaviour.reset(kPeriodsAreHertz); m_playBehaviour.reset(kITVibratoTremoloPanbrello); // Various files have a default speed or tempo of 0 if(fileHeader.tempo) Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_mdl.cpp Sun May 26 00:52:48 2024 (r20853) +++ trunk/OpenMPT/soundlib/Load_mdl.cpp Sun May 26 18:31:11 2024 (r20854) @@ -477,6 +477,7 @@ m_SongFlags = SONG_ITCOMPATGXX; m_playBehaviour.set(kPerChannelGlobalVolSlide); m_playBehaviour.set(kApplyOffsetWithoutNote); + m_playBehaviour.reset(kPeriodsAreHertz); m_playBehaviour.reset(kITVibratoTremoloPanbrello); m_playBehaviour.reset(kITSCxStopsSample); // Gate effect in underbeat.mdl Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sun May 26 00:52:48 2024 (r20853) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sun May 26 18:31:11 2024 (r20854) @@ -6395,6 +6395,7 @@ if(GetType() & (MOD_TYPE_MDL | MOD_TYPE_DTM)) { // MDL uses non-linear slides, but their effectiveness does not depend on the middle-C frequency. + MPT_ASSERT(!PeriodsAreFrequencies()); return (FreqS3MTable[note % 12u] << 4) >> (note / 12); } if(!nC5Speed) @@ -6513,6 +6514,7 @@ return (period + c5speed - 8363) << FREQ_FRACBITS; } else if(GetType() & (MOD_TYPE_MDL | MOD_TYPE_DTM)) { + MPT_ASSERT(!PeriodsAreFrequencies()); LimitMax(period, Util::MaxValueOfType(period) >> 8); if (!c5speed) c5speed = 8363; return Util::muldiv_unsigned(c5speed, (1712L << 7) << FREQ_FRACBITS, (period << 8) + nPeriodFrac); |