From: <sv...@op...> - 2025-01-08 17:17:35
|
Author: sagamusix Date: Wed Jan 8 18:17:22 2025 New Revision: 22849 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22849 Log: [Fix] IT compatibility: Envelope Carry should not be influenced by a previous note-off. Fixes bridge.it by rs3 (https://www.un4seen.com/forum/?topic=15448.msg144272#msg144272). [Mod] OpenMPT: Version is now 1.32.00.40 Modified: trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/UpgradeModule.cpp Modified: trunk/OpenMPT/common/versionNumber.h ============================================================================== --- trunk/OpenMPT/common/versionNumber.h Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/common/versionNumber.h Wed Jan 8 18:17:22 2025 (r22849) @@ -16,4 +16,4 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 32 #define VER_MINOR 00 -#define VER_MINORMINOR 39 +#define VER_MINORMINOR 40 Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp Wed Jan 8 18:17:22 2025 (r22849) @@ -752,6 +752,7 @@ case kFT2AutoVibratoAbortSweep: desc = _T("Key-off before auto-vibrato sweep-in is complete resets auto-vibrato depth"); break; case kLegacyPPQpos: desc = _T("Report inaccurate PPQ position to VST plugins (like OpenMPT 1.31 and older)"); break; case kLegacyPluginNNABehaviour: desc = _T("Plugin notes with New Note Action set to Continue are affected by note-offs (like OpenMPT 1.31 and older)"); break; + case kITCarryAfterNoteOff: desc = _T("Note-Off status does not influence Envelope Carry behaviour"); break; default: MPT_ASSERT_NOTREACHED(); } Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/soundlib/Snd_defs.h Wed Jan 8 18:17:22 2025 (r22849) @@ -615,6 +615,7 @@ kFT2AutoVibratoAbortSweep, // Key-off before auto-vibrato sweep-in is complete resets auto-vibrato depth kLegacyPPQpos, // Report fake PPQ position to VST plugins kLegacyPluginNNABehaviour, // Plugin notes with NNA=continue are affected by note-offs etc. + kITCarryAfterNoteOff, // Envelope Carry continues to function as normal even after note-off // Add new play behaviours here. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Wed Jan 8 18:17:22 2025 (r22849) @@ -1643,10 +1643,12 @@ reset = (!chn.nLength || (insNumber && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) || (insNumber && !bPorta && chn.dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); - // NOTE: IT2.14 with SB/GUS/etc. output is different. We are going after IT's WAV writer here. - // For SB/GUS/etc. emulation, envelope carry should only apply when the NNA isn't set to "Note Cut". + // NOTE: Carry behaviour is not consistent between IT drivers. + // If NNA is set to "Note Cut", carry only works if the driver uses volume ramping on cut notes. + // This means that the normal SB and GUS drivers behave differently than what is implemented here. + // We emulate IT's WAV writer and SB16 MMX driver instead. // Test case: CarryNNA.it - resetAlways = (!chn.nFadeOutVol || instrumentChanged || chn.dwFlags[CHN_KEYOFF]); + resetAlways = !chn.nFadeOutVol || instrumentChanged || (m_playBehaviour[kITCarryAfterNoteOff] ? !chn.rowCommand.IsNote() : chn.dwFlags[CHN_KEYOFF]); } else { reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_DBM)) || m_SongFlags[SONG_ITCOMPATGXX] Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Wed Jan 8 18:17:22 2025 (r22849) @@ -1224,6 +1224,7 @@ playBehaviour.set(kITEmptyNoteMapSlotIgnoreCell); playBehaviour.set(kITOffsetWithInstrNumber); playBehaviour.set(kITDoublePortamentoSlides); + playBehaviour.set(kITCarryAfterNoteOff); break; case MOD_TYPE_XM: Modified: trunk/OpenMPT/soundlib/UpgradeModule.cpp ============================================================================== --- trunk/OpenMPT/soundlib/UpgradeModule.cpp Wed Jan 8 16:40:37 2025 (r22848) +++ trunk/OpenMPT/soundlib/UpgradeModule.cpp Wed Jan 8 18:17:22 2025 (r22849) @@ -602,6 +602,7 @@ { kITEmptyNoteMapSlotIgnoreCell, MPT_V("1.32.00.13") }, { kITOffsetWithInstrNumber, MPT_V("1.32.00.15") }, { kITDoublePortamentoSlides, MPT_V("1.32.00.27") }, + { kITCarryAfterNoteOff, MPT_V("1.32.00.40") }, }; for(const auto &b : behaviours) |