|
From: <sag...@us...> - 2014-02-28 23:46:56
|
Revision: 3800
http://sourceforge.net/p/modplug/code/3800
Author: saga-games
Date: 2014-02-28 23:46:47 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
[Fix] FT2 compatibility: Output period should be clamped to 1...31999 (very theoretical range that should only be exceeded with overflowing portamentos)
[Fix] Compatibility mode: Glissando should now behave more as one expects it to behave and not reset after portamentos.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/ModChannel.h
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/ModChannel.h
===================================================================
--- trunk/OpenMPT/soundlib/ModChannel.h 2014-02-28 23:45:24 UTC (rev 3799)
+++ trunk/OpenMPT/soundlib/ModChannel.h 2014-02-28 23:46:47 UTC (rev 3800)
@@ -68,6 +68,7 @@
int32 nRealVolume, nRealPan;
int32 nVolume, nPan, nFadeOutVol;
int32 nPeriod, nC5Speed, nPortamentoDest;
+ int32 cachedPeriod, glissandoPeriod;
int32 nCalcVolume; // Calculated channel volume, 14-Bit (without global volume, pre-amp etc applied) - for MIDI macros
EnvInfo VolEnv, PanEnv, PitchEnv; // Envelope playback info
int32 nGlobalVol; // Channel volume (CV in ITTECH.TXT)
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-28 23:45:24 UTC (rev 3799)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2014-02-28 23:46:47 UTC (rev 3800)
@@ -1812,11 +1812,20 @@
pChn->nCalcVolume = vol; // Update calculated volume for MIDI macros
if (pChn->nPeriod < m_nMinPeriod) pChn->nPeriod = m_nMinPeriod;
+ if(IsCompatibleMode(TRK_FASTTRACKER2)) Clamp(pChn->nPeriod, 1, 31999);
period = pChn->nPeriod;
- // TODO Glissando effect is reset after portamento! What would this sound like without the CHN_PORTAMENTO flag?
- if((pChn->dwFlags & (CHN_GLISSANDO | CHN_PORTAMENTO)) == (CHN_GLISSANDO | CHN_PORTAMENTO))
+
+ // When glissando mode is set to semitones, clamp to the next halftone.
+ if((pChn->dwFlags[CHN_GLISSANDO] && IsCompatibleMode(TRK_ALLTRACKERS))
+ || ((pChn->dwFlags & (CHN_GLISSANDO | CHN_PORTAMENTO)) == (CHN_GLISSANDO | CHN_PORTAMENTO) && !IsCompatibleMode(TRK_ALLTRACKERS)))
{
- period = GetPeriodFromNote(GetNoteFromPeriod(period), pChn->nFineTune, pChn->nC5Speed);
+ if(period != pChn->cachedPeriod)
+ {
+ // Only recompute this whole thing in case the base period has changed.
+ pChn->cachedPeriod = period;
+ pChn->glissandoPeriod = GetPeriodFromNote(GetNoteFromPeriod(period), pChn->nFineTune, pChn->nC5Speed);
+ }
+ period = pChn->glissandoPeriod;
}
ProcessArpeggio(nChn, period, arpeggioSteps);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|