From: <sv...@op...> - 2025-05-24 21:56:49
|
Author: sagamusix Date: Sat May 24 23:56:37 2025 New Revision: 23169 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23169 Log: Merged revision(s) 23168 from trunk/OpenMPT: [Imp] Avoid clicks on sample transition e.g. when doing a portamento between two different samples. The old note doesn't get an NNA channel assigned in this case, so the end-of-sample fade-out was missing. ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.32/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.32/soundlib/Snd_fx.cpp Sat May 24 23:56:21 2025 (r23168) +++ branches/OpenMPT-1.32/soundlib/Snd_fx.cpp Sat May 24 23:56:37 2025 (r23169) @@ -3098,6 +3098,15 @@ if(!m_playBehaviour[kITInstrWithNoteOff] || ModCommand::IsNote(note)) chn.nNewIns = 0; } + // When swapping samples without explicit note change (e.g. during portamento), avoid clicks at end of sample (as there won't be an NNA channel to fade the sample out) + if(oldSample != nullptr && oldSample != chn.pModSample) + { + m_dryLOfsVol += chn.nLOfs; + m_dryROfsVol += chn.nROfs; + chn.nLOfs = 0; + chn.nROfs = 0; + } + if(m_playBehaviour[kITPortamentoSwapResetsPos]) { // Test cases: PortaInsNum.it, PortaSample.it |