From: <sv...@op...> - 2024-12-21 21:43:11
|
Author: sagamusix Date: Sat Dec 21 22:43:00 2024 New Revision: 22603 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22603 Log: [Fix] We need a compatibility flag for the new NNA behaviour, it breaks files relying on the old NNA=Continue behaviour that didn't really act as expected, because notes kept being associated with the pattern channel. Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/UpgradeModule.cpp Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp Sat Dec 21 21:48:51 2024 (r22602) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp Sat Dec 21 22:43:00 2024 (r22603) @@ -764,6 +764,7 @@ case kS3MIgnoreCombinedFineSlides: desc =_T("Ignore combined fine slides (Kxy / Lxy)"); break; 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; default: MPT_ASSERT_NOTREACHED(); } Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Sat Dec 21 21:48:51 2024 (r22602) +++ trunk/OpenMPT/soundlib/Snd_defs.h Sat Dec 21 22:43:00 2024 (r22603) @@ -614,6 +614,7 @@ kS3MIgnoreCombinedFineSlides, // S3M commands Kxy and Lxy ignore fine slides 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. // Add new play behaviours here. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 21 21:48:51 2024 (r22602) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat Dec 21 22:43:00 2024 (r22603) @@ -2501,7 +2501,7 @@ // If there's no NNA channels available, avoid the note lingering on forever if(nnaChn == CHANNELINDEX_INVALID) SendMIDINote(nChn, NOTE_KEYOFF, 0, m_playBehaviour[kMIDINotesFromChannelPlugin] ? pPlugin : nullptr); - else + else if(!m_playBehaviour[kLegacyPluginNNABehaviour]) pPlugin->MoveChannel(nChn, nnaChn); break; } @@ -5300,7 +5300,7 @@ IMixPlugin *pPlugin; if(pIns != nullptr && pIns->nMixPlug && (pPlugin = m_MixPlugins[pIns->nMixPlug - 1].pMixPlugin) != nullptr) { - pPlugin->MidiCommand(*pIns, bkChn.nNote | IMixPlugin::MIDI_NOTE_OFF, 0, nChn); + pPlugin->MidiCommand(*pIns, bkChn.nNote | IMixPlugin::MIDI_NOTE_OFF, 0, m_playBehaviour[kLegacyPluginNNABehaviour] ? nChn : i); } #endif // NO_PLUGINS } Modified: trunk/OpenMPT/soundlib/UpgradeModule.cpp ============================================================================== --- trunk/OpenMPT/soundlib/UpgradeModule.cpp Sat Dec 21 21:48:51 2024 (r22602) +++ trunk/OpenMPT/soundlib/UpgradeModule.cpp Sat Dec 21 22:43:00 2024 (r22603) @@ -805,6 +805,18 @@ } } } + + if(m_dwLastSavedWithVersion < MPT_V("1.32.00.38") && hasAnyPlugins) + { + for(const auto &plugin : m_MixPlugins) + { + if(plugin.Info.dwPluginId1 == PLUGMAGIC('V', 's', 't', 'P')) + { + m_playBehaviour.set(kLegacyPluginNNABehaviour); + break; + } + } + } #endif } |