From: <sag...@us...> - 2014-01-04 15:57:15
|
Revision: 3555 http://sourceforge.net/p/modplug/code/3555 Author: saga-games Date: 2014-01-04 15:57:09 +0000 (Sat, 04 Jan 2014) Log Message: ----------- [Fix] DBM (libopenmpt only): Tone Portamento is applied on all ticks in DigiBoosterPro. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-04 07:39:11 UTC (rev 3554) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-04 15:57:09 UTC (rev 3555) @@ -818,9 +818,9 @@ resetAlways = (!pChn->nFadeOutVol || instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); } else { - reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] + reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_DBM)) || m_SongFlags[SONG_ITCOMPATGXX] || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol)); - resetAlways = !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || instrumentChanged || pIns == nullptr || pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]; + resetAlways = !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_DBM)) || instrumentChanged || pIns == nullptr || pChn->dwFlags[CHN_KEYOFF | CHN_NOTEFADE]; } if(reset) @@ -1163,11 +1163,11 @@ } if (!bPorta - || (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) + || (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_DBM))) || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) || (m_SongFlags[SONG_ITCOMPATGXX] && pChn->rowCommand.instr != 0)) { - if((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) + if((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_DBM)) && pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) { pChn->ResetEnvelopes(); // IT Compatibility: Autovibrato reset @@ -1227,39 +1227,36 @@ if(!pIns->PanEnv.dwFlags[ENV_CARRY]) pChn->PanEnv.Reset(); if(!pIns->PitchEnv.dwFlags[ENV_CARRY]) pChn->PitchEnv.Reset(); - if(GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) + // Volume Swing + if(pIns->nVolSwing) { - // Volume Swing - if(pIns->nVolSwing) + const double delta = 2 * (((double) rand()) / RAND_MAX) - 1; + pChn->nVolSwing = static_cast<int32>(std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? pChn->nInsVol : ((pChn->nVolume + 1) / 2)) * pIns->nVolSwing / 100.0)); + } + // Pan Swing + if(pIns->nPanSwing) + { + const double delta = 2 * (((double) rand()) / RAND_MAX) - 1; + pChn->nPanSwing = static_cast<int32>(std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? 4 : 1) * pIns->nPanSwing)); + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { - const double delta = 2 * (((double) rand()) / RAND_MAX) - 1; - pChn->nVolSwing = static_cast<int32>(std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? pChn->nInsVol : ((pChn->nVolume + 1) / 2)) * pIns->nVolSwing / 100.0)); + pChn->nRestorePanOnNewNote = pChn->nPan + 1; } - // Pan Swing - if(pIns->nPanSwing) - { - const double delta = 2 * (((double) rand()) / RAND_MAX) - 1; - pChn->nPanSwing = static_cast<int32>(std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? 4 : 1) * pIns->nPanSwing)); - if(!IsCompatibleMode(TRK_IMPULSETRACKER)) - { - pChn->nRestorePanOnNewNote = pChn->nPan + 1; - } - } - // Cutoff Swing - if(pIns->nCutSwing) - { - int32 d = ((int32)pIns->nCutSwing * (int32)((rand() & 0xFF) - 0x7F)) / 128; - pChn->nCutSwing = (int16)((d * pChn->nCutOff + 1) / 128); - pChn->nRestoreCutoffOnNewNote = pChn->nCutOff + 1; - } - // Resonance Swing - if(pIns->nResSwing) - { - int32 d = ((int32)pIns->nResSwing * (int32)((rand() & 0xFF) - 0x7F)) / 128; - pChn->nResSwing = (int16)((d * pChn->nResonance + 1) / 128); - pChn->nRestoreResonanceOnNewNote = pChn->nResonance + 1; - } } + // Cutoff Swing + if(pIns->nCutSwing) + { + int32 d = ((int32)pIns->nCutSwing * (int32)((rand() & 0xFF) - 0x7F)) / 128; + pChn->nCutSwing = (int16)((d * pChn->nCutOff + 1) / 128); + pChn->nRestoreCutoffOnNewNote = pChn->nCutOff + 1; + } + // Resonance Swing + if(pIns->nResSwing) + { + int32 d = ((int32)pIns->nResSwing * (int32)((rand() & 0xFF) - 0x7F)) / 128; + pChn->nResSwing = (int16)((d * pChn->nResonance + 1) / 128); + pChn->nRestoreResonanceOnNewNote = pChn->nResonance + 1; + } } pChn->nAutoVibDepth = 0; pChn->nAutoVibPos = 0; @@ -3120,7 +3117,7 @@ } //End candidate MPT behavior. if(param) pChn->nPortamentoSlide = param * 4; - if(pChn->nPeriod && pChn->nPortamentoDest && !pChn->isFirstTick) + if(pChn->nPeriod && pChn->nPortamentoDest && (!pChn->isFirstTick || GetType() == MOD_TYPE_DBM)) { if (pChn->nPeriod < pChn->nPortamentoDest) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |