From: <rel...@us...> - 2009-06-24 15:54:23
|
Revision: 275 http://modplug.svn.sourceforge.net/modplug/?rev=275&view=rev Author: relabsoluness Date: 2009-06-24 15:54:18 +0000 (Wed, 24 Jun 2009) Log Message: ----------- (Patch from Jojo) . Playback: 4-Bit panning didn't disable surround sound (merge edit: now uses compatibility flag for IT/MPTM/XM). Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-06-23 19:53:05 UTC (rev 274) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-06-24 15:54:18 UTC (rev 275) @@ -2277,7 +2277,16 @@ // E7x: Set Tremolo WaveForm case 0x70: pChn->nTremoloType = param & 0x07; break; // E8x: Set 4-bit Panning - case 0x80: if (!m_nTickCount) { pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; } break; + //case 0x80: if (!m_nTickCount) { pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; } break; + case 0x80: if (!m_nTickCount) + { + if( TypeIsIT_MPT_XM() == false || GetModFlag(MSF_COMPATIBLE_PLAY) ) + { + if (!(m_dwSongFlags & SONG_SURROUNDPAN)) pChn->dwFlags &= ~CHN_SURROUND; + } + pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; + } + break; // E9x: Retrig case 0x90: RetrigNote(nChn, param); break; // EAx: Fine Volume Up @@ -2352,7 +2361,16 @@ } break; // S8x: Set 4-bit Panning - case 0x80: if (!m_nTickCount) { pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; } break; + //case 0x80: if (!m_nTickCount) { pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; } break; + case 0x80: if (!m_nTickCount) + { + if( TypeIsIT_MPT_XM() == false || GetModFlag(MSF_COMPATIBLE_PLAY) ) + { + if (!(m_dwSongFlags & SONG_SURROUNDPAN)) pChn->dwFlags &= ~CHN_SURROUND; + } + pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; + } + break; // S9x: Set Surround case 0x90: ExtendedChannelEffect(pChn, param & 0x0F); break; // SAx: Set 64k Offset This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2009-07-12 23:13:06
|
Revision: 295 http://modplug.svn.sourceforge.net/modplug/?rev=295&view=rev Author: saga-games Date: 2009-07-12 22:21:08 +0000 (Sun, 12 Jul 2009) Log Message: ----------- [Fix] SD0: Fix for S3M in rev. 294 also affected MPTm files [Fix] IT compatibility: Panning fx (Xxx, S8x, pxx) override pan swing (test #20) - Maybe a more elegant solution can be found here, since the same code exists in at least three places here. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-07-12 14:17:41 UTC (rev 294) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-07-12 22:21:08 UTC (rev 295) @@ -1172,7 +1172,7 @@ if(GetModFlag(MSF_COMPATIBLE_PLAY) && (m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) nStartTick = 1; //ST3 ignores notes with SD0 completely - else if(m_nType & MOD_TYPE_S3M|MOD_TYPE_MPT) + else if(m_nType & MOD_TYPE_S3M) nStartTick = m_nMusicSpeed; } @@ -1344,6 +1344,9 @@ pChn->nPan = vol << 2; pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nRestorePanOnNewNote = 0; + //IT compatibility 20. Set pan overrides random pan + if(GetModFlag(MSF_COMPATIBLE_PLAY) && (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) + pChn->nPanSwing = 0; } //rewbs.VSTnoteDelay @@ -1620,6 +1623,9 @@ } pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nRestorePanOnNewNote = 0; + //IT compatibility 20. Set pan overrides random pan + if(GetModFlag(MSF_COMPATIBLE_PLAY) && (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) + pChn->nPanSwing = 0; break; // Panning Slide @@ -2494,6 +2500,10 @@ if (!(m_dwSongFlags & SONG_SURROUNDPAN)) pChn->dwFlags &= ~CHN_SURROUND; } pChn->nPan = (param << 4) + 8; pChn->dwFlags |= CHN_FASTVOLRAMP; + + //IT compatibility 20. Set pan overrides random pan + if(GetModFlag(MSF_COMPATIBLE_PLAY) && (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT))) + pChn->nPanSwing = 0; } break; // S9x: Sound Control This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-15 21:56:04
|
Revision: 496 http://modplug.svn.sourceforge.net/modplug/?rev=496&view=rev Author: saga-games Date: 2010-02-15 21:55:55 +0000 (Mon, 15 Feb 2010) Log Message: ----------- [Fix] S3M compatibility: Slightly better handling of vibrato/tremolo waveform types (although the ST3 help screen says that continuous vibrato/tremolo is possible, it does actually not work.) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-15 21:05:01 UTC (rev 495) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-15 21:55:55 UTC (rev 496) @@ -734,8 +734,17 @@ pChn->nPos = 0; pChn->nPosLo = 0; // Handle "retrigger" waveform type - if (pChn->nVibratoType < 4) pChn->nVibratoPos = ((!IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER)) && (m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!(m_dwSongFlags & SONG_ITOLDEFFECTS))) ? 0x10 : 0; - if(!IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER) && pChn->nTremoloType < 4) pChn->nTremoloPos = 0; + if (pChn->nVibratoType < 4) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) && (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!(m_dwSongFlags & SONG_ITOLDEFFECTS))) + pChn->nVibratoPos = 0x10; + else + pChn->nVibratoPos = 0; + } + if(!IsCompatibleMode(TRK_IMPULSETRACKER) && pChn->nTremoloType < 4) + { + pChn->nTremoloPos = 0; + } } if (pChn->nPos >= pChn->nLength) pChn->nPos = pChn->nLoopStart; } @@ -2592,11 +2601,25 @@ pChn->nFineTune = MOD2XMFineTune(param); if (pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); break; - // S3x: Set Vibrato WaveForm - case 0x30: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nVibratoType = param & 0x07; break; - // S4x: Set Tremolo WaveForm - case 0x40: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nTremoloType = param & 0x07; break; - // S5x: Set Panbrello WaveForm + // S3x: Set Vibrato Waveform + case 0x30: if(GetType() == MOD_TYPE_S3M) + { + pChn->nVibratoType = param & 0x03; + } else + { + if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nVibratoType = param & 0x07; + } + break; + // S4x: Set Tremolo Waveform + case 0x40: if(GetType() == MOD_TYPE_S3M) + { + pChn->nTremoloType = param & 0x03; + } else + { + if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nTremoloType = param & 0x07; + } + break; + // S5x: Set Panbrello Waveform case 0x50: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPanbrelloType = param & 0x07; break; // S6x: Pattern Delay for x frames case 0x60: m_nFrameDelay = param; break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-02-17 09:10:23
|
Revision: 497 http://modplug.svn.sourceforge.net/modplug/?rev=497&view=rev Author: saga-games Date: 2010-02-17 09:10:14 +0000 (Wed, 17 Feb 2010) Log Message: ----------- [Fix] IT Compatibility: Default Vibrato/Tremolo/Panbrello values to sine if out of range (e.g. S35) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-15 21:55:55 UTC (rev 496) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-02-17 09:10:14 UTC (rev 497) @@ -2570,7 +2570,7 @@ // EDx: Note Delay // EEx: Pattern Delay case 0xF0: - if((m_nType & MOD_TYPE_MOD) != 0) // MOD: Invert Loop + if(GetType() == MOD_TYPE_MOD) // MOD: Invert Loop { pChn->nEFxSpeed = param; if(m_dwSongFlags & SONG_FIRSTTICK) InvertLoop(pChn); @@ -2607,7 +2607,10 @@ pChn->nVibratoType = param & 0x03; } else { - if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nVibratoType = param & 0x07; + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + pChn->nVibratoType = (param < 0x04) ? param : 0; + else + pChn->nVibratoType = param & 0x07; } break; // S4x: Set Tremolo Waveform @@ -2616,11 +2619,18 @@ pChn->nTremoloType = param & 0x03; } else { - if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nTremoloType = param & 0x07; + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + pChn->nTremoloType = (param < 0x04) ? param : 0; + else + pChn->nTremoloType = param & 0x07; } break; // S5x: Set Panbrello Waveform - case 0x50: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPanbrelloType = param & 0x07; break; + case 0x50: if(IsCompatibleMode(TRK_IMPULSETRACKER)) + pChn->nPanbrelloType = (param < 0x04) ? param : 0; + else + pChn->nPanbrelloType = param & 0x07; + break; // S6x: Pattern Delay for x frames case 0x60: m_nFrameDelay = param; break; // S7x: Envelope Control / Instrument Control @@ -3290,7 +3300,11 @@ bool bResetEnv = false; if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) { - if ((pChn->nRowInstr) && (param < 0x100)) { InstrumentChange(pChn, pChn->nRowInstr, FALSE, FALSE); bResetEnv = true; } + if ((pChn->nRowInstr) && (param < 0x100)) + { + InstrumentChange(pChn, pChn->nRowInstr, FALSE, FALSE); + bResetEnv = true; + } if (param < 0x100) bResetEnv = true; } NoteChange(nChn, nNote, IsCompatibleMode(TRK_IMPULSETRACKER) ? true : false, bResetEnv); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-03-09 20:25:49
|
Revision: 522 http://modplug.svn.sourceforge.net/modplug/?rev=522&view=rev Author: saga-games Date: 2010-03-09 20:25:43 +0000 (Tue, 09 Mar 2010) Log Message: ----------- [Fix] Just because a variable is called "dwSomething", doesn't mean that it's supposed to be DWORD... Fixed a few variable conversions in GetLength() - Now, OpenMPT reports that Paul Legovitch's Intro.it is 58785320 minutes long instead of 0 seconds, which is not exactly correct, but the previous length was not correct either... Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 18:42:49 UTC (rev 521) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-09 20:25:43 UTC (rev 522) @@ -90,7 +90,7 @@ ORDERINDEX nCurrentPattern = 0; ORDERINDEX nNextPattern = 0; PATTERNINDEX nPattern = Order[0]; - DOUBLE dwElapsedTime=0.0; + double dElapsedTime=0.0; // -! NEW_FEATURE#0022 UINT nMusicSpeed=m_nDefaultSpeed, nMusicTempo=m_nDefaultTempo, nNextRow=0; UINT nMaxRow = 0, nMaxPattern = 0; @@ -101,7 +101,7 @@ BYTE vols[MAX_CHANNELS]; BYTE oldparam[MAX_CHANNELS]; UINT chnvols[MAX_CHANNELS]; - DWORD patloop[MAX_CHANNELS]; + double patloop[MAX_CHANNELS]; memset(instr, 0, sizeof(instr)); memset(notes, 0, sizeof(notes)); @@ -209,7 +209,7 @@ if (!nRow) { for(UINT ipck = 0; ipck < m_nChannels; ipck++) - patloop[ipck] = (DWORD)dwElapsedTime; + patloop[ipck] = dElapsedTime; } if (!bTotal) { @@ -316,8 +316,8 @@ if ((param & 0xF0) == 0xE0) nSpeedCount = (param & 0x0F) * nMusicSpeed; else if ((param & 0xF0) == 0x60) { - if (param & 0x0F) dwElapsedTime += (dwElapsedTime - patloop[nChn]) * (param & 0x0F); - else patloop[nChn] = (DWORD)dwElapsedTime; + if (param & 0x0F) dElapsedTime += (dElapsedTime - patloop[nChn]) * (double)(param & 0x0F); + else patloop[nChn] = dElapsedTime; } break; case CMD_XFINEPORTAUPDOWN: @@ -432,11 +432,11 @@ nSpeedCount += nMusicSpeed; switch(m_nTempoMode) { case tempo_mode_alternative: - dwElapsedTime += 60000.0 / (1.65625 * (double)(nMusicSpeed * nMusicTempo)); break; + dElapsedTime += 60000.0 / (1.65625 * (double)(nMusicSpeed * nMusicTempo)); break; case tempo_mode_modern: - dwElapsedTime += 60000.0/(double)nMusicTempo / (double)m_nRowsPerBeat; break; + dElapsedTime += 60000.0/(double)nMusicTempo / (double)m_nRowsPerBeat; break; case tempo_mode_classic: default: - dwElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo; + dElapsedTime += (2500.0 * (double)nSpeedCount) / (double)nMusicTempo; } } @@ -457,7 +457,7 @@ } } - return dwElapsedTime / 1000.0; + return dElapsedTime / 1000.0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-03-13 22:34:58
|
Revision: 530 http://modplug.svn.sourceforge.net/modplug/?rev=530&view=rev Author: saga-games Date: 2010-03-13 22:34:51 +0000 (Sat, 13 Mar 2010) Log Message: ----------- [Fix] IT compatibility: ignore slide commands with both nibbles set (f.e. D55, PA1, ...) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 16:02:46 UTC (rev 529) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-03-13 22:34:51 UTC (rev 530) @@ -2408,7 +2408,10 @@ void CSoundFile::VolumeSlide(MODCHANNEL *pChn, UINT param) //-------------------------------------------------------- { - if (param) pChn->nOldVolumeSlide = param; else param = pChn->nOldVolumeSlide; + if (param) + pChn->nOldVolumeSlide = param; + else + param = pChn->nOldVolumeSlide; LONG newvolume = pChn->nVolume; if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM|MOD_TYPE_AMF)) { @@ -2443,9 +2446,18 @@ } if ((!(m_dwSongFlags & SONG_FIRSTTICK)) || (m_dwSongFlags & SONG_FASTVOLSLIDES)) { - if (param & 0x0F) newvolume -= (int)((param & 0x0F) * 4); - else newvolume += (int)((param & 0xF0) >> 2); - if (m_nType & MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; + // IT compatibility: Ignore slide commands with both nibbles set. + if (param & 0x0F) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0) + newvolume -= (int)((param & 0x0F) * 4); + } + else + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) + newvolume += (int)((param & 0xF0) >> 2); + } + if (m_nType == MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; } newvolume = CLAMP(newvolume, 0, 256); @@ -2457,7 +2469,10 @@ //--------------------------------------------------------- { LONG nPanSlide = 0; - if (param) pChn->nOldPanSlide = param; else param = pChn->nOldPanSlide; + if (param) + pChn->nOldPanSlide = param; + else + param = pChn->nOldPanSlide; if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM)) { if (((param & 0x0F) == 0x0F) && (param & 0xF0)) @@ -2486,8 +2501,17 @@ { if (!(m_dwSongFlags & SONG_FIRSTTICK)) { - if (param & 0x0F) nPanSlide = -(int)((param & 0x0F) << 2); - else nPanSlide = (int)((param & 0xF0) >> 2); + // IT compatibility: Ignore slide commands with both nibbles set. + if (param & 0x0F) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0) + nPanSlide = -(int)((param & 0x0F) << 2); + } + else + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) + nPanSlide = (int)((param & 0xF0) >> 2); + } // XM compatibility: FT2's panning slide is not as deep if(IsCompatibleMode(TRK_FASTTRACKER2)) nPanSlide >>= 2; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-04-18 20:21:54
|
Revision: 571 http://modplug.svn.sourceforge.net/modplug/?rev=571&view=rev Author: saga-games Date: 2010-04-18 20:21:47 +0000 (Sun, 18 Apr 2010) Log Message: ----------- [Fix] Song Length Estimation: In some special cases (f.e. the order +++, ---, 0), the length estimation was running into an infinite loop. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-18 14:46:44 UTC (rev 570) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-04-18 20:21:47 UTC (rev 571) @@ -132,13 +132,13 @@ // Check if pattern is valid nPattern = Order[nCurrentPattern]; - bool positionJumpOnThisRow=false; - bool patternBreakOnThisRow=false; + bool positionJumpOnThisRow = false; + bool patternBreakOnThisRow = false; - while (nPattern >= Patterns.Size()) + while(nPattern >= Patterns.Size()) { - // End of song ? - if ((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size())) + // End of song? + if((nPattern == Order.GetInvalidPatIndex()) || (nCurrentPattern >= Order.size())) { if(nCurrentPattern == m_nRestartPos) break; @@ -150,6 +150,8 @@ } nPattern = (nCurrentPattern < Order.size()) ? Order[nCurrentPattern] : Order.GetInvalidPatIndex(); nNextPattern = nCurrentPattern; + if(IsRowVisited(nCurrentPattern, 0, true)) + break; } // Skip non-existing patterns if ((nPattern >= Patterns.Size()) || (!Patterns[nPattern])) @@ -220,9 +222,9 @@ positionJumpOnThisRow=true; nNextPattern = (ORDERINDEX)param; // see http://lpchip.com/modplug/viewtopic.php?t=2769 - FastTracker resets Dxx if Bxx is called _after_ Dxx - if (!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM)) { + if(!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM)) nNextRow = 0; - } + if (bAdjust) { pChn->nPatternLoopCount = 0; @@ -1923,7 +1925,8 @@ //occurs also when pattern loop is enabled. } // see http://lpchip.com/modplug/viewtopic.php?t=2769 - FastTracker resets Dxx if Bxx is called _after_ Dxx - if(GetType() == MOD_TYPE_XM) nBreakRow = 0; + if(GetType() == MOD_TYPE_XM) + nBreakRow = 0; break; // Pattern Break @@ -4156,5 +4159,5 @@ if(Patterns.IsValidPat(nPat)) return (size_t)(Patterns[nPat].GetNumRows()); else - return 0; + return 1; // invalid patterns consist of a "fake" row. } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-03 16:15:17
|
Revision: 731 http://modplug.svn.sourceforge.net/modplug/?rev=731&view=rev Author: saga-games Date: 2010-10-03 16:15:11 +0000 (Sun, 03 Oct 2010) Log Message: ----------- [Fix] IT Compatibility: Fixed a combination of multisample instruments and Gxx (fixes the guitars in "Ultima Ratio" by Nebularia and some subtle things in spx-shuttledeparture.it) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:13:09 UTC (rev 730) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:15:11 UTC (rev 731) @@ -475,9 +475,38 @@ if ((pIns) && (note) && (note <= 128)) { - if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return; - UINT n = pIns->Keyboard[note-1]; - pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : NULL; + if(bPorta && pIns == pChn->pModInstrument && pChn->pModSample->pSample != nullptr && IsCompatibleMode(TRK_IMPULSETRACKER)) + { +#ifdef DEBUG + { + // Check if original behaviour would have been used here + if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) + { + ASSERT(false); + return; + } + UINT n = pIns->Keyboard[note-1]; + pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; + if(pSmp != pChn->pModSample) + { + ASSERT(false); + } + } +#endif // DEBUG + // Impulse Tracker doesn't seem to look up the sample for new notes when in instrument mode and it encounters a situation like this: + // G-6 01 ... ... <-- G-6 is bound to sample 01 + // F-6 01 ... GFF <-- F-6 is bound to sample 02, but sample 01 will be played + // This behaviour is not used if sample 01 has no actual sample data (hence the "pChn->pModSample->pSample != nullptr") + // and it is also ignored when the instrument number changes. This fixes f.e. the guitars in "Ultima Ratio" by Nebularia + // and some slides in spx-shuttledeparture.it. + pSmp = pChn->pModSample; + } else + { + // Original behaviour + if (pIns->NoteMap[note-1] >= NOTE_MIN_SPECIAL) return; + UINT n = pIns->Keyboard[note-1]; + pSmp = ((n) && (n < MAX_SAMPLES)) ? &Samples[n] : nullptr; + } } else if (m_nInstruments) { @@ -656,7 +685,6 @@ } - pChn->pSample = pSmp->pSample; pChn->nTranspose = pSmp->RelativeTone; @@ -738,7 +766,7 @@ pChn->nFineTune = pSmp->nFineTune; } } - // IT Compatibility: Update multisample instruments frequency even if instrument is not specified + // IT Compatibility: Update multisample instruments frequency even if instrument is not specified (fixes the guitars in spx-shuttledeparture.it) if(!bPorta && pSmp && IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nC5Speed = pSmp->nC5Speed; // XM Compatibility: Ignore notes with portamento if there was no note playing. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-03 21:22:54
|
Revision: 732 http://modplug.svn.sourceforge.net/modplug/?rev=732&view=rev Author: saga-games Date: 2010-10-03 21:22:48 +0000 (Sun, 03 Oct 2010) Log Message: ----------- [Fix] Do you know what a null pointer is? Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 16:15:11 UTC (rev 731) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-03 21:22:48 UTC (rev 732) @@ -475,7 +475,7 @@ if ((pIns) && (note) && (note <= 128)) { - if(bPorta && pIns == pChn->pModInstrument && pChn->pModSample->pSample != nullptr && IsCompatibleMode(TRK_IMPULSETRACKER)) + if(bPorta && pIns == pChn->pModInstrument && (pChn->pModSample != nullptr && pChn->pModSample->pSample != nullptr) && IsCompatibleMode(TRK_IMPULSETRACKER)) { #ifdef DEBUG { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-15 17:59:31
|
Revision: 740 http://modplug.svn.sourceforge.net/modplug/?rev=740&view=rev Author: saga-games Date: 2010-10-15 17:59:23 +0000 (Fri, 15 Oct 2010) Log Message: ----------- [Fix] XM Compatibility: Fixing many mind-boggling EDx testcases in one sweep Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 14:52:26 UTC (rev 739) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 17:59:23 UTC (rev 740) @@ -1385,9 +1385,21 @@ } // XM: Rogue note delays cause retrig - if ((note == NOTE_NONE) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK)) + if ((note == NOTE_NONE || instr == 0) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK)) { note = pChn->nNote - pChn->nTranspose; + // Stupid HACK to retrieve the last used instrument *number* + if(instr == 0) + { + for(INSTRUMENTINDEX nIns = 1; nIns <= m_nInstruments; nIns++) + { + if(Instruments[nIns] == pChn->pModInstrument) + { + instr = nIns; + break; + } + } + } } } if ((!note) && (instr)) //Case: instrument with no note data. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-15 20:50:58
|
Revision: 741 http://modplug.svn.sourceforge.net/modplug/?rev=741&view=rev Author: saga-games Date: 2010-10-15 20:50:52 +0000 (Fri, 15 Oct 2010) Log Message: ----------- [Fix] I can't believe I'm fixing more of these EDx idiosyncrasies... Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 17:59:23 UTC (rev 740) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-15 20:50:52 UTC (rev 741) @@ -1368,12 +1368,16 @@ { UINT note = pChn->nRowNote; if (instr) pChn->nNewIns = instr; + bool retrigEnv = (!note) && (instr); + + // Now it's time for some FT2 crap... if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) { // XM: FT2 ignores a note next to a K00 effect, and a fade-out seems to be done when no volume envelope is present (not exactly the Kxx behaviour) if(cmd == CMD_KEYOFF && param == 0 && IsCompatibleMode(TRK_FASTTRACKER2)) { note = instr = 0; + retrigEnv = false; } // XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number or volume effect is present!) @@ -1382,15 +1386,25 @@ pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nVolume = 0; note = instr = 0; - } + retrigEnv = false; + } else if(IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK)) + { + // XM Compatibility: Some special hacks for rogue note delays... (EDx with x > 0) + // Apparently anything that is next to a note delay behaves totally unpredictable in FT2. Swedish tracker logic. :) - // XM: Rogue note delays cause retrig - if ((note == NOTE_NONE || instr == 0) && IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK)) - { - note = pChn->nNote - pChn->nTranspose; - // Stupid HACK to retrieve the last used instrument *number* - if(instr == 0) + // If there's a note delay but no note, retrig the last note. + if(note == NOTE_NONE) { + note = pChn->nNote - pChn->nTranspose; + } else if(note >= NOTE_MIN_SPECIAL) + { + // Gah! Note Off + Note Delay will cause envelopes to *retrigger*! How stupid is that? + retrigEnv = true; + } + // Stupid HACK to retrieve the last used instrument *number* for rouge note delays in XM + // This is only applied if the instrument column is empty and if there is either no note or a "normal" note (e.g. no note off) + if(instr == 0 && note <= NOTE_MAX) + { for(INSTRUMENTINDEX nIns = 1; nIns <= m_nInstruments; nIns++) { if(Instruments[nIns] == pChn->pModInstrument) @@ -1402,7 +1416,7 @@ } } } - if ((!note) && (instr)) //Case: instrument with no note data. + if (retrigEnv) //Case: instrument with no note data. { //IT compatibility: Instrument with no note. if(IsCompatibleMode(TRK_IMPULSETRACKER) || (m_dwSongFlags & SONG_PT1XMODE)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-25 19:28:22
|
Revision: 751 http://modplug.svn.sourceforge.net/modplug/?rev=751&view=rev Author: saga-games Date: 2010-10-25 19:28:16 +0000 (Mon, 25 Oct 2010) Log Message: ----------- [Fix] XM compatibility: Portamento combined with an Offset command results in the offset command being ignored. I have commented out some code related to Offset that didn't make sense at all, but left a debug assertion there, in case it *did* make sense (which I doubt) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-23 13:59:13 UTC (rev 750) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-25 19:28:16 UTC (rev 751) @@ -3334,12 +3334,22 @@ } // -! NEW_FEATURE#0010 - if ((pChn->nRowNote) && (pChn->nRowNote < 0x80)) + if ((pChn->nRowNote >= NOTE_MIN) && (pChn->nRowNote <= NOTE_MAX)) { - if (bPorta) + /* if (bPorta) pChn->nPos = param; else - pChn->nPos += param; + pChn->nPos += param; */ + // The code above doesn't make sense at all. If there's a note and no porta, how on earth could nPos be something else than 0? + // Anyway, keeping a debug assert here, just in case... + ASSERT(bPorta || pChn->nPos == 0); + + // XM compatibility: Portamento + Offset = Ignore offset + if(bPorta && IsCompatibleMode(TRK_FASTTRACKER2)) + { + return; + } + if (pChn->nPos >= pChn->nLength) { // Offset beyond sample size This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-10-25 19:49:56
|
Revision: 753 http://modplug.svn.sourceforge.net/modplug/?rev=753&view=rev Author: saga-games Date: 2010-10-25 19:49:49 +0000 (Mon, 25 Oct 2010) Log Message: ----------- [Fix] It would help to actually set the offset... Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-25 19:31:16 UTC (rev 752) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-10-25 19:49:49 UTC (rev 753) @@ -3349,6 +3349,7 @@ { return; } + pChn->nPos = param; if (pChn->nPos >= pChn->nLength) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-11-06 16:11:03
|
Revision: 757 http://modplug.svn.sourceforge.net/modplug/?rev=757&view=rev Author: saga-games Date: 2010-11-06 16:10:57 +0000 (Sat, 06 Nov 2010) Log Message: ----------- [Imp] Order list: When jumpin to an order that is never played, tempo/speed/global volume are now reset. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-05 23:06:56 UTC (rev 756) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-06 16:10:57 UTC (rev 757) @@ -431,22 +431,32 @@ } // Store final variables - if (bAdjust && (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID)) + if (bAdjust) { - m_nGlobalVolume = nGlbVol; - m_nOldGlbVolSlide = nOldGlbVolSlide; - m_nMusicSpeed = nMusicSpeed; - m_nMusicTempo = nMusicTempo; - for (CHANNELINDEX n = 0; n < m_nChannels; n++) + if (targetReached || endOrder == ORDERINDEX_INVALID || endRow == ROWINDEX_INVALID) { - Chn[n].nGlobalVol = chnvols[n]; - if (notes[n]) Chn[n].nNewNote = notes[n]; - if (instr[n]) Chn[n].nNewIns = instr[n]; - if (vols[n] != 0xFF) + // Target found, or there is no target (i.e. play whole song)... + m_nGlobalVolume = nGlbVol; + m_nOldGlbVolSlide = nOldGlbVolSlide; + m_nMusicSpeed = nMusicSpeed; + m_nMusicTempo = nMusicTempo; + for (CHANNELINDEX n = 0; n < m_nChannels; n++) { - if (vols[n] > 64) vols[n] = 64; - Chn[n].nVolume = vols[n] << 2; + Chn[n].nGlobalVol = chnvols[n]; + if (notes[n]) Chn[n].nNewNote = notes[n]; + if (instr[n]) Chn[n].nNewIns = instr[n]; + if (vols[n] != 0xFF) + { + if (vols[n] > 64) vols[n] = 64; + Chn[n].nVolume = vols[n] << 2; + } } + } else + { + // Target not found (f.e. when jumping to a hidden sub song), reset global variables... + m_nMusicSpeed = m_nDefaultSpeed; + m_nMusicTempo = m_nDefaultTempo; + m_nGlobalVolume = m_nDefaultGlobalVolume; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2010-11-20 20:55:39
|
Revision: 764 http://modplug.svn.sourceforge.net/modplug/?rev=764&view=rev Author: saga-games Date: 2010-11-20 20:55:32 +0000 (Sat, 20 Nov 2010) Log Message: ----------- [Fix] IT Compatibility: Further fixes to autovibrato handling. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-17 21:07:55 UTC (rev 763) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-20 20:55:32 UTC (rev 764) @@ -611,7 +611,7 @@ { resetEnvelopes(pChn); } - // IT Compatibility: Always reset autovibrato settings when there's an instrument number + // IT Compatibility: Autovibrato reset if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { pChn->nAutoVibDepth = 0; @@ -630,13 +630,6 @@ return; } - // IT Compatibility: Always reset autovibrato settings when there's an instrument number - if(IsCompatibleMode(TRK_IMPULSETRACKER)) - { - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; - } - // Tone-Portamento doesn't reset the pingpong direction flag if ((bPorta) && (pSmp == pChn->pModSample)) { @@ -681,6 +674,13 @@ pChn->nLoopStart = pSmp->nLoopStart; pChn->nLoopEnd = pSmp->nLoopEnd; + // IT Compatibility: Autovibrato reset + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } + if(bNewTuning) { pChn->nC5Speed = pSmp->nC5Speed; @@ -714,7 +714,7 @@ void CSoundFile::NoteChange(UINT nChn, int note, bool bPorta, bool bResetEnv, bool bManual) //----------------------------------------------------------------------------------------- { - if (note < 1) return; + if (note < NOTE_MIN) return; MODCHANNEL * const pChn = &Chn[nChn]; MODSAMPLE *pSmp = pChn->pModSample; MODINSTRUMENT *pIns = pChn->pModInstrument; @@ -786,7 +786,7 @@ } if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2|MOD_TYPE_MED)) note += pChn->nTranspose; - note = CLAMP(note, 1, 132); + note = CLAMP(note, NOTE_MIN, NOTE_MAX); pChn->nNote = note; pChn->m_CalculateFreq = true; @@ -852,8 +852,12 @@ if ((m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (pChn->dwFlags & CHN_NOTEFADE) && (!pChn->nFadeOutVol)) { resetEnvelopes(pChn); - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; + // IT Compatibility: Autovibrato reset + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } pChn->dwFlags &= ~CHN_NOTEFADE; pChn->nFadeOutVol = 65536; } @@ -874,6 +878,13 @@ pChn->nLeftVU = pChn->nRightVU = 0xFF; pChn->dwFlags &= ~CHN_FILTER; pChn->dwFlags |= CHN_FASTVOLRAMP; + // IT Compatibility: Autovibrato reset + if(bResetEnv && IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + pChn->nVibratoPos = 0; + } //IT compatibility 15. Retrigger will not be reset (Tremor doesn't store anything here, so we just don't reset this as well) if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { @@ -939,8 +950,12 @@ } } } - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; + // IT Compatibility: Autovibrato reset + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } } pChn->nLeftVol = pChn->nRightVol = 0; bool bFlt = (m_dwSongFlags & SONG_MPTFILTERMODE) ? false : true; @@ -1447,8 +1462,12 @@ { pChn->dwFlags |= CHN_FASTVOLRAMP; resetEnvelopes(pChn); - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; + // IT Compatibility: Autovibrato reset + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } pChn->dwFlags &= ~CHN_NOTEFADE; pChn->nFadeOutVol = 65536; } @@ -1524,8 +1543,12 @@ { pChn->dwFlags |= CHN_FASTVOLRAMP; resetEnvelopes(pChn); - pChn->nAutoVibDepth = 0; - pChn->nAutoVibPos = 0; + // IT Compatibility: Autovibrato reset + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nAutoVibDepth = 0; + pChn->nAutoVibPos = 0; + } } } // Tick-0 only volume commands @@ -2005,7 +2028,9 @@ } // see http://forum.openmpt.org/index.php?topic=2769.0 - FastTracker resets Dxx if Bxx is called _after_ Dxx if(GetType() == MOD_TYPE_XM) + { nBreakRow = 0; + } break; // Pattern Break @@ -2018,7 +2043,7 @@ } if (m && m->command == CMD_XPARAM) { - nBreakRow = (param<<8) + m->param; + nBreakRow = (param << 8) + m->param; } else { nBreakRow = param; @@ -2118,7 +2143,7 @@ } } m_nNextPattern = nPosJump; - m_nNextRow = (UINT)nBreakRow; + m_nNextRow = nBreakRow; m_bPatternTransitionOccurred = true; } } //Ends condition (nBreakRow >= 0) || (nPosJump >= 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-09-01 17:57:39
|
Revision: 1004 http://modplug.svn.sourceforge.net/modplug/?rev=1004&view=rev Author: saga-games Date: 2011-09-01 17:57:33 +0000 (Thu, 01 Sep 2011) Log Message: ----------- [Fix] IT Compatibility: Multiple fine pattern delays on the same row weren't added up. [Fix] IT Compatibility: A high offset effect next to a note should not apply the offset automatically. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-08-31 18:00:14 UTC (rev 1003) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-09-01 17:57:33 UTC (rev 1004) @@ -2881,7 +2881,17 @@ pChn->nPanbrelloType = param & 0x07; break; // S6x: Pattern Delay for x frames - case 0x60: m_nFrameDelay = param; break; + case 0x60: + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + if(!(m_dwSongFlags & SONG_FIRSTTICK) || m_nTickCount > 0) break; + m_nFrameDelay += param; + } + else + { + m_nFrameDelay = param; + } + break; // S7x: Envelope Control / Instrument Control case 0x70: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; switch(param) @@ -2957,7 +2967,7 @@ case 0xA0: if(m_dwSongFlags & SONG_FIRSTTICK) { pChn->nOldHiOffset = param; - if ((pChn->nRowNote) && (pChn->nRowNote < 0x80)) + if (!IsCompatibleMode(TRK_IMPULSETRACKER) && (pChn->nRowNote != NOTE_NONE) && NOTE_IS_VALID(pChn->nRowNote)) { DWORD pos = param << 16; if (pos < pChn->nLength) pChn->nPos = pos; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-09-20 18:26:06
|
Revision: 1049 http://modplug.svn.sourceforge.net/modplug/?rev=1049&view=rev Author: saga-games Date: 2011-09-20 18:26:00 +0000 (Tue, 20 Sep 2011) Log Message: ----------- [Fix] Volume swing range in non-compatible mode broke in the previous revisions. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-09-20 01:00:58 UTC (rev 1048) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-09-20 18:26:00 UTC (rev 1049) @@ -960,7 +960,7 @@ if (pIns->nVolSwing) { const double delta = 2 * (((double) rand()) / RAND_MAX) - 1; - pChn->nVolSwing = (LONG)std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? pChn->nInsVol : (pChn->nVolume + 1)) * pIns->nVolSwing / 100.0); + pChn->nVolSwing = (LONG)std::floor(delta * (IsCompatibleMode(TRK_IMPULSETRACKER) ? pChn->nInsVol : ((pChn->nVolume + 1) / 2)) * pIns->nVolSwing / 100.0); } // Pan Swing if (pIns->nPanSwing) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-10-05 18:52:14
|
Revision: 1087 http://modplug.svn.sourceforge.net/modplug/?rev=1087&view=rev Author: saga-games Date: 2011-10-05 18:52:07 +0000 (Wed, 05 Oct 2011) Log Message: ----------- [Fix] IT Compatibility: Channel and global volume slides with both nibbles set were not ignored. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-05 17:32:06 UTC (rev 1086) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-05 18:52:07 UTC (rev 1087) @@ -2603,8 +2603,7 @@ } else { - if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) - newvolume += (int)((param & 0xF0) >> 2); + newvolume += (int)((param & 0xF0) >> 2); } if (m_nType == MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; } @@ -2649,9 +2648,7 @@ nPanSlide = (int)((param & 0x0F) << 2); } else { - // IT compatibility: Ignore slide commands with both nibbles set. - if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) - nPanSlide = -(int)((param & 0xF0) >> 2); + nPanSlide = -(int)((param & 0xF0) >> 2); } } } @@ -2732,8 +2729,14 @@ { if (!(m_dwSongFlags & SONG_FIRSTTICK)) { - if (param & 0x0F) nChnSlide = -(int)(param & 0x0F); - else nChnSlide = (int)((param & 0xF0) >> 4); + if (param & 0x0F) + { + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0xF0) == 0) + nChnSlide = -(int)(param & 0x0F); + } else + { + nChnSlide = (int)((param & 0xF0) >> 4); + } } } if (nChnSlide) @@ -3876,8 +3879,15 @@ { if (!(m_dwSongFlags & SONG_FIRSTTICK)) { - if (param & 0xF0) nGlbSlide = (int)((param & 0xF0) >> 4) * 2; - else nGlbSlide = -(int)((param & 0x0F) * 2); + if (param & 0xF0) + { + // IT compatibility: Ignore slide commands with both nibbles set. + if(!IsCompatibleMode(TRK_IMPULSETRACKER) || (param & 0x0F) == 0) + nGlbSlide = (int)((param & 0xF0) >> 4) * 2; + } else + { + nGlbSlide = -(int)((param & 0x0F) * 2); + } } } if (nGlbSlide) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-10-20 00:11:38
|
Revision: 1109 http://modplug.svn.sourceforge.net/modplug/?rev=1109&view=rev Author: saga-games Date: 2011-10-20 00:11:31 +0000 (Thu, 20 Oct 2011) Log Message: ----------- [Fix] IT Compatibility: Fixed SCx behaviour for resuming notes (fixed scx.it) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-19 15:41:03 UTC (rev 1108) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-20 00:11:31 UTC (rev 1109) @@ -662,6 +662,10 @@ return; } + pChn->nLength = pSmp->nLength; + pChn->nLoopStart = pSmp->nLoopStart; + pChn->nLoopEnd = pSmp->nLoopEnd; + // Tone-Portamento doesn't reset the pingpong direction flag if ((bPorta) && (pSmp == pChn->pModSample)) { @@ -697,9 +701,6 @@ pChn->nResSwing = pChn->nCutSwing = 0; } pChn->pModSample = pSmp; - pChn->nLength = pSmp->nLength; - pChn->nLoopStart = pSmp->nLoopStart; - pChn->nLoopEnd = pSmp->nLoopEnd; // IT Compatibility: Autovibrato reset if(IsCompatibleMode(TRK_IMPULSETRACKER)) @@ -1456,7 +1457,7 @@ // Apparently, any note number in a pattern causes instruments to recall their original volume settings - no matter if there's a Note Off next to it or whatever. // Test cases: keyoff+instr.xm, delay.xm bool reloadSampleSettings = (IsCompatibleMode(TRK_FASTTRACKER2) && instr != 0); - bool keepInstr = (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)); + bool keepInstr = (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) != 0; // Now it's time for some FT2 crap... if (GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2)) @@ -3731,9 +3732,11 @@ // if (m_nInstruments) KeyOff(pChn); ? pChn->nVolume = 0; // S3M/IT compatibility: Note Cut really cuts notes and does not just mute them (so that following volume commands could restore the sample) + // Test case: scx.it if(IsCompatibleMode(TRK_IMPULSETRACKER|TRK_SCREAMTRACKER)) { - pChn->nPeriod = 0; + pChn->nLength = 0; + pChn->nPos = pChn->nPosLo = 0; } pChn->dwFlags |= CHN_FASTVOLRAMP; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2011-10-30 12:40:13
|
Revision: 1127 http://modplug.svn.sourceforge.net/modplug/?rev=1127&view=rev Author: saga-games Date: 2011-10-30 12:40:06 +0000 (Sun, 30 Oct 2011) Log Message: ----------- [Fix] Resonant filters broke in rev.1124. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-29 19:03:03 UTC (rev 1126) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-10-30 12:40:06 UTC (rev 1127) @@ -1037,8 +1037,16 @@ // Setup Initial Filter for this note if (pIns) { - if (pIns->IsResonanceEnabled()) { pChn->nResonance = pIns->GetResonance(); bFlt = true; } - if (pIns->IsResonanceEnabled()) { pChn->nCutOff = pIns->GetCutoff(); bFlt = true; } + if (pIns->IsResonanceEnabled()) + { + pChn->nResonance = pIns->GetResonance(); + bFlt = true; + } + if (pIns->IsCutoffEnabled()) + { + pChn->nCutOff = pIns->GetCutoff(); + bFlt = true; + } if (bFlt && (pIns->nFilterMode != FLTMODE_UNCHANGED)) { pChn->nFilterMode = pIns->nFilterMode; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-04-21 23:08:30
|
Revision: 1253 http://modplug.svn.sourceforge.net/modplug/?rev=1253&view=rev Author: saga-games Date: 2012-04-21 23:08:23 +0000 (Sat, 21 Apr 2012) Log Message: ----------- [Fix] FT2 compatibility: Semi-fixed global volume (not applied on first tick anymore). Test case: GlobalVolume.xm Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-04-21 17:39:42 UTC (rev 1252) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-04-21 23:08:23 UTC (rev 1253) @@ -2153,6 +2153,14 @@ // break; // } + // FT2 compatibility: Global volume is applied *after* the first tick. + // This is not emulated quite correctly for speed 1 (because there is no second tick), but it should be close enough. + // Test case: GlobalVolume.xm + if(IsCompatibleMode(TRK_FASTTRACKER2) && (m_dwSongFlags & SONG_FIRSTTICK) && m_nMusicSpeed > 1) + { + break; + } + if (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) param *= 2; // IT compatibility 16. FT2, ST3 and IT ignore out-of-range values. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-05-25 17:04:34
|
Revision: 1281 http://modplug.svn.sourceforge.net/modplug/?rev=1281&view=rev Author: saga-games Date: 2012-05-25 17:04:28 +0000 (Fri, 25 May 2012) Log Message: ----------- [Fix] Removed portamento speed A01 "fix" Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-24 17:30:56 UTC (rev 1280) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-25 17:04:28 UTC (rev 1281) @@ -2521,7 +2521,7 @@ return; } // Regular Slide - if (!(m_dwSongFlags & SONG_FIRSTTICK) || (m_nMusicSpeed == 1)) //rewbs.PortaA01fix + if (!(m_dwSongFlags & SONG_FIRSTTICK)) { DoFreqSlide(pChn, -int(param) * 4); } @@ -2563,7 +2563,7 @@ } return; } - if (!(m_dwSongFlags & SONG_FIRSTTICK) || (m_nMusicSpeed == 1)) //rewbs.PortaA01fix + if (!(m_dwSongFlags & SONG_FIRSTTICK)) { DoFreqSlide(pChn, int(param) * 4); } @@ -2799,12 +2799,12 @@ } //End candidate MPT behavior. if (param) pChn->nPortamentoSlide = param * 4; - if ((pChn->nPeriod) && (pChn->nPortamentoDest) && ((m_nMusicSpeed == 1) || !(m_dwSongFlags & SONG_FIRSTTICK))) //rewbs.PortaA01fix + if (pChn->nPeriod && pChn->nPortamentoDest && !(m_dwSongFlags & SONG_FIRSTTICK)) { if (pChn->nPeriod < pChn->nPortamentoDest) { LONG delta = (int)pChn->nPortamentoSlide; - if ((m_dwSongFlags & SONG_LINEARSLIDES) && (!(m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)))) + if ((m_dwSongFlags & SONG_LINEARSLIDES) && (!(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)))) { UINT n = pChn->nPortamentoSlide >> 2; if (n > 255) n = 255; @@ -2819,7 +2819,7 @@ if (pChn->nPeriod > pChn->nPortamentoDest) { LONG delta = - (int)pChn->nPortamentoSlide; - if ((m_dwSongFlags & SONG_LINEARSLIDES) && (!(m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)))) + if ((m_dwSongFlags & SONG_LINEARSLIDES) && (!(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)))) { UINT n = pChn->nPortamentoSlide >> 2; if (n > 255) n = 255; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-05-25 20:44:05
|
Revision: 1283 http://modplug.svn.sourceforge.net/modplug/?rev=1283&view=rev Author: saga-games Date: 2012-05-25 20:43:57 +0000 (Fri, 25 May 2012) Log Message: ----------- [Fix] XM Compatibility: Set Finetune should now work properly. Set Finetune for MOD is now also "almost" fixed. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-25 18:04:20 UTC (rev 1282) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-25 20:43:57 UTC (rev 1283) @@ -864,8 +864,13 @@ pChn->nFineTune = 0; } else { - pChn->nC5Speed = pSmp->nC5Speed; - pChn->nFineTune = pSmp->nFineTune; + if((!bPorta && GetType() == MOD_TYPE_XM) + || (pChn->rowCommand.instr != 0 && GetType() == MOD_TYPE_MOD) + || !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM))) + { + pChn->nC5Speed = pSmp->nC5Speed; + pChn->nFineTune = pSmp->nFineTune; + } } @@ -965,7 +970,7 @@ } } - if ((!bPorta) && (GetType() & (MOD_TYPE_XM|MOD_TYPE_MED|MOD_TYPE_MT2))) + if (!bPorta && (GetType() & (MOD_TYPE_XM | MOD_TYPE_MED | MOD_TYPE_MT2))) { if (pSmp) { @@ -3121,13 +3126,28 @@ // E4x: Set Vibrato WaveForm case 0x40: pChn->nVibratoType = param & 0x07; break; // E5x: Set FineTune - case 0x50: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; - pChn->nC5Speed = S3MFineTuneTable[param]; - if (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) - pChn->nFineTune = param*2; + case 0x50: if(!(m_dwSongFlags & SONG_FIRSTTICK)) + { + break; + } + if(GetType() == MOD_TYPE_MOD) + { + pChn->nFineTune = MOD2XMFineTune(param); + if(pChn->nPeriod && pChn->rowCommand.IsNote()) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); + } else if(pChn->rowCommand.IsNote()) + { + pChn->nFineTune = MOD2XMFineTune(param - 8); + if(pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); + + } + + + /*if(!(m_dwSongFlags & SONG_FIRSTTICK) || !pChn->rowCommand.IsNote()) break; + if((GetType() & MOD_TYPE_MOD)) + pChn->nFineTune = MOD2XMFineTune(param); else - pChn->nFineTune = MOD2XMFineTune(param); - if (pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed); + pChn->nFineTune = MOD2XMFineTune(param - 8); + if (pChn->nPeriod) pChn->nPeriod = GetPeriodFromNote(pChn->nNote, pChn->nFineTune, pChn->nC5Speed);*/ break; // E6x: Pattern Loop // E7x: Set Tremolo WaveForm This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-07-01 17:23:37
|
Revision: 1313 http://modplug.svn.sourceforge.net/modplug/?rev=1313&view=rev Author: saga-games Date: 2012-07-01 17:23:31 +0000 (Sun, 01 Jul 2012) Log Message: ----------- [Fix] FT2 Compatibility: Volume column pan slide left with param 0 actually sets the panning to full left non every non-row tick. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-06-30 23:41:35 UTC (rev 1312) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-01 17:23:31 UTC (rev 1313) @@ -691,7 +691,7 @@ instrumentChanged = true; } - // XM compatibility: new instrument + portamento = ignore new instrument number, but reload old instrument settings (the world of XM is upside down...) + // FT2 compatibility: new instrument + portamento = ignore new instrument number, but reload old instrument settings (the world of XM is upside down...) // And this does *not* happen if volume column portamento is used together with note delay... (handled in ProcessEffects(), where all the other note delay stuff is.) // Test case: porta-delay.xm if(instrumentChanged && bPorta && IsCompatibleMode(TRK_FASTTRACKER2)) @@ -985,7 +985,7 @@ { if(IsCompatibleMode(TRK_FASTTRACKER2)) { - // XM Compatibility: Ignore notes with portamento if there was no note playing. + // FT2 Compatibility: Ignore notes with portamento if there was no note playing. // Test case: 3xx-no-old-samp.xm pChn->nPeriod = 0; return; @@ -1121,7 +1121,7 @@ //IT compatibility 15. Retrigger will not be reset (Tremor doesn't store anything here, so we just don't reset this as well) if(!IsCompatibleMode(TRK_IMPULSETRACKER)) { - // XM compatibility: FT2 also doesn't reset retrigger + // FT2 compatibility: FT2 also doesn't reset retrigger if(!IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nRetrigCount = 0; pChn->nTremorCount = 0; } @@ -1732,7 +1732,7 @@ retrigEnv = false; } else if(IsCompatibleMode(TRK_FASTTRACKER2) && !(m_dwSongFlags & SONG_FIRSTTICK)) { - // XM Compatibility: Some special hacks for rogue note delays... (EDx with x > 0) + // FT2 Compatibility: Some special hacks for rogue note delays... (EDx with x > 0) // Apparently anything that is next to a note delay behaves totally unpredictable in FT2. Swedish tracker logic. :) retrigEnv = true; @@ -1945,7 +1945,7 @@ TonePortamento(pChn, param); } else { - // XM Compatibility: FT2 ignores some volume commands with parameter = 0. + // FT2 Compatibility: FT2 ignores some volume commands with parameter = 0. if(IsCompatibleMode(TRK_FASTTRACKER2) && vol == 0) { switch(volcmd) @@ -1954,6 +1954,13 @@ case VOLCMD_PANNING: case VOLCMD_VIBRATODEPTH: break; + case VOLCMD_PANSLIDELEFT: + // FT2 Compatibility: Pan slide left with zero parameter causes panning to be set to full left on every non-row tick. + if(!(m_dwSongFlags & SONG_FIRSTTICK)) + { + pChn->nPan = 0; + } + break; default: // no memory here. volcmd = VOLCMD_NONE; @@ -2119,7 +2126,7 @@ // Set Offset case CMD_OFFSET: if (m_nTickCount) break; - // XM compatibility: Portamento + Offset = Ignore offset + // FT2 compatibility: Portamento + Offset = Ignore offset if(bPorta && GetType() == MOD_TYPE_XM) { break; @@ -2356,7 +2363,7 @@ { pChn->VolEnv.nEnvPosition = param; - // XM compatibility: FT2 only sets the position of the Volume envelope + // FT2 compatibility: FT2 only sets the position of the Volume envelope if(!IsCompatibleMode(TRK_FASTTRACKER2)) { pChn->PanEnv.nEnvPosition = param; @@ -3035,7 +3042,7 @@ { nPanSlide = -(int)((param & 0x0F) << 2); } - // XM compatibility: FT2's panning slide is like IT's fine panning slide (not as deep) + // FT2 compatibility: FT2's panning slide is like IT's fine panning slide (not as deep) if(IsCompatibleMode(TRK_FASTTRACKER2)) nPanSlide >>= 2; } @@ -3866,7 +3873,7 @@ } } else if(IsCompatibleMode(TRK_FASTTRACKER2)) { - // XM Compatibility: Don't play note if offset is beyond sample length + // FT2 Compatibility: Don't play note if offset is beyond sample length // Test case: 3xx-no-old-samp.xm pChn->dwFlags |= CHN_FASTVOLRAMP; pChn->nVolume = pChn->nPeriod = 0; @@ -3962,7 +3969,7 @@ { int vol = pChn->nVolume; - // XM compatibility: Retrig + volume will not change volume of retrigged notes + // FT2 compatibility: Retrig + volume will not change volume of retrigged notes if(!IsCompatibleMode(TRK_FASTTRACKER2) || !(pChn->rowCommand.volcmd == VOLCMD_VOLUME)) { if (retrigTable1[dv]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-08-20 23:42:55
|
Revision: 1344 http://modplug.svn.sourceforge.net/modplug/?rev=1344&view=rev Author: saga-games Date: 2012-08-20 23:42:49 +0000 (Mon, 20 Aug 2012) Log Message: ----------- [Fix] IT compatibility: Note-off effect is not reset with portamento'ed notes anymore (fixed Off-Porta.it). Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-08-20 13:24:10 UTC (rev 1343) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-08-20 23:42:49 UTC (rev 1344) @@ -16,12 +16,9 @@ #include "stdafx.h" #include "sndfile.h" -// -> CODE#0022 -// -> DESC="alternative BPM/Speed interpretation method" -#include "../mptrack/mptrack.h" +#ifdef MODPLUG_TRACKER #include "../mptrack/moddoc.h" -#include "../common/misc_util.h" -// -! NEW_FEATURE#0022 +#endif // MODPLUG_TRACKER #include "tuning.h" #pragma warning(disable:4244) @@ -750,7 +747,7 @@ } // Default sample panning - if((pSmp->uFlags & CHN_PANNING) || (GetType() & MOD_TYPE_XM)) + if(pSmp->uFlags[CHN_PANNING] || (GetType() & MOD_TYPE_XM)) { pChn->nPan = pSmp->nPan; // IT compatibility: Sample and instrument panning overrides channel surround status. @@ -766,10 +763,10 @@ // Reset envelopes if (bResetEnv) { - if (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] - || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) - // IT compatibility tentative fix: Reset envelopes when instrument changes. - || (IsCompatibleMode(TRK_IMPULSETRACKER) && instrumentChanged)) + if(!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] + || !pChn->nLength || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) + // IT compatibility tentative fix: Reset envelopes when instrument changes. + || (IsCompatibleMode(TRK_IMPULSETRACKER) && instrumentChanged)) { pChn->dwFlags.set(CHN_FASTVOLRAMP); @@ -1110,7 +1107,12 @@ } } - pChn->dwFlags.reset(CHN_EXTRALOUD | CHN_KEYOFF); + // IT compatibility: Don't reset key-off flag on porta notes + // Test case: Off-Porta.it + if(IsCompatibleMode(TRK_IMPULSETRACKER) && bPorta) + pChn->dwFlags.reset(CHN_EXTRALOUD); + else + pChn->dwFlags.reset(CHN_EXTRALOUD | CHN_KEYOFF); // Enable Ramping if (!bPorta) @@ -1225,7 +1227,7 @@ // Special case for MPT if (bManual) pChn->dwFlags.reset(CHN_MUTE); if((pChn->dwFlags[CHN_MUTE] && (gdwSoundSetup & SNDMIX_MUTECHNMODE)) - || (pChn->pModSample != nullptr && (pChn->pModSample->uFlags & CHN_MUTE) && !bManual) + || (pChn->pModSample != nullptr && pChn->pModSample->uFlags[CHN_MUTE] && !bManual) || (pChn->pModInstrument != nullptr && pChn->pModInstrument->dwFlags[INS_MUTE] && !bManual)) { if (!bManual) pChn->nPeriod = 0; @@ -1374,7 +1376,9 @@ //switch off duplicated note played on this plugin IMixPlugin *pPlugin = m_MixPlugins[pIns->nMixPlug-1].pMixPlugin; if(pPlugin && p->nNote != NOTE_NONE) - pPlugin->MidiCommand(GetBestMidiChannel(i), p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote + NOTE_KEYOFF, 0, i); + { + pPlugin->MidiCommand(GetBestMidiChannel(i), p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nLastNote + NOTE_MAX_SPECIAL, 0, i); + } break; } } @@ -1525,7 +1529,7 @@ const PlugParamIndex plugparam = ModCommand::GetValueVolCol(pChn->rowCommand.volcmd, pChn->rowCommand.vol); const PlugParamValue value = ModCommand::GetValueEffectCol(pChn->rowCommand.command, pChn->rowCommand.param) / PlugParamValue(ModCommand::maxColumnValue); - if(plug > 0 && plug <= MAX_MIXPLUGINS && m_MixPlugins[plug-1].pMixPlugin) + if(plug > 0 && plug <= MAX_MIXPLUGINS && m_MixPlugins[plug - 1].pMixPlugin) m_MixPlugins[plug-1].pMixPlugin->SetParameter(plugparam, value); } @@ -3485,7 +3489,7 @@ // we obviously also need a sample for this ModSample *pModSample = pChn->pModSample; - if(pModSample == nullptr || pModSample->pSample == nullptr || !(pModSample->uFlags & CHN_LOOP) || (pModSample->uFlags & CHN_16BIT)) return; + if(pModSample == nullptr || pModSample->pSample == nullptr || !pModSample->uFlags[CHN_LOOP] || pModSample->uFlags[CHN_16BIT]) return; pChn->nEFxDelay += ModEFxTable[pChn->nEFxSpeed & 0x0F]; if((pChn->nEFxDelay & 0x80) == 0) return; // only applied if the "delay" reaches 128 @@ -4173,9 +4177,9 @@ if (pChn->dwFlags[CHN_SUSTAINLOOP] && pChn->pModSample && bKeyOn) { const ModSample *pSmp = pChn->pModSample; - if(pSmp->uFlags & CHN_LOOP) + if(pSmp->uFlags[CHN_LOOP]) { - if (pSmp->uFlags & CHN_PINGPONGLOOP) + if (pSmp->uFlags[CHN_PINGPONGLOOP]) pChn->dwFlags.set(CHN_PINGPONGLOOP); else pChn->dwFlags.reset(CHN_PINGPONGLOOP | CHN_PINGPONGFLAG); @@ -4207,7 +4211,7 @@ if (pIns->VolEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET) { - pChn->VolEnv.nEnvValueAtReleaseJump = Util::Round<LONG>(pIns->VolEnv.GetValueFromPosition(pChn->VolEnv.nEnvPosition) * 256.0f); + pChn->VolEnv.nEnvValueAtReleaseJump = Util::Round<int32>(pIns->VolEnv.GetValueFromPosition(pChn->VolEnv.nEnvPosition) * 256.0f); pChn->VolEnv.nEnvPosition = pIns->VolEnv.Ticks[pIns->VolEnv.nReleaseNode]; } @@ -4304,7 +4308,7 @@ if(!IsCompatibleMode(TRK_IMPULSETRACKER | TRK_FASTTRACKER2 | TRK_PROTRACKER | TRK_SCREAMTRACKER)) { ModChannel *p = Chn; - for (CHANNELINDEX i = 0; i < GetNumChannels(); i++, p++) if (p != pChn) + for(CHANNELINDEX i = 0; i < GetNumChannels(); i++, p++) if (p != pChn) { // Loop already done if (p->nPatternLoopCount) return ROWINDEX_INVALID; @@ -4610,7 +4614,7 @@ PLUGINDEX plug = 0; if(Chn[nChn].pModInstrument != nullptr) { - if (respectMutes == RespectMutes && Chn[nChn].pModSample && (Chn[nChn].pModSample->uFlags & CHN_MUTE)) + if (respectMutes == RespectMutes && Chn[nChn].pModSample && Chn[nChn].pModSample->uFlags[CHN_MUTE]) { plug = 0; } else @@ -4691,6 +4695,7 @@ } // Channel mutes +#ifdef MODPLUG_TRACKER for (CHANNELINDEX chan = 0; chan < GetNumChannels(); chan++) { if (m_bChannelMuteTogglePending[chan]) @@ -4702,6 +4707,7 @@ m_bChannelMuteTogglePending[chan] = false; } } +#endif // MODPLUG_TRACKER m_bPatternTransitionOccurred = false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |