You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
(213) |
Aug
(184) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-05-31 13:50:52
|
Author: sagamusix Date: Fri May 31 15:50:38 2024 New Revision: 20882 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20882 Log: [Ref] Turn channel states into std::array, and provide convenience wrappers that just return the pattern channels or just the background channels. Modified: trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/PlayState.cpp trunk/OpenMPT/soundlib/PlayState.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/mptrack/MainFrm.cpp Fri May 31 15:50:38 2024 (r20882) @@ -1383,12 +1383,12 @@ } else { // Stop sample preview channels - for(CHANNELINDEX i = m_pSndFile->m_nChannels; i < MAX_CHANNELS; i++) + for(ModChannel &chn : m_pSndFile->m_PlayState.BackgroundChannels(*m_pSndFile)) { - if(m_pSndFile->m_PlayState.Chn[i].isPreviewNote) + if(chn.isPreviewNote) { - m_pSndFile->m_PlayState.Chn[i].nLength = 0; - m_pSndFile->m_PlayState.Chn[i].position.Set(0); + chn.nLength = 0; + chn.position.Set(0); } } } Modified: trunk/OpenMPT/mptrack/Moddoc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/mptrack/Moddoc.cpp Fri May 31 15:50:38 2024 (r20882) @@ -1155,9 +1155,8 @@ CriticalSection cs; // Apply note cut / off / fade (also on preview channels) m_SndFile.NoteChange(m_SndFile.m_PlayState.Chn[channel], note); - for(CHANNELINDEX c = m_SndFile.GetNumChannels(); c < MAX_CHANNELS; c++) + for(ModChannel &chn : m_SndFile.m_PlayState.BackgroundChannels(m_SndFile)) { - ModChannel &chn = m_SndFile.m_PlayState.Chn[c]; if(chn.isPreviewNote && (chn.pModSample || chn.pModInstrument)) { m_SndFile.NoteChange(chn, note); @@ -1263,13 +1262,13 @@ // If note == 0, just check if an instrument or sample is playing. bool CModDoc::IsNotePlaying(UINT note, SAMPLEINDEX nsmp, INSTRUMENTINDEX nins) { - ModChannel *pChn = &m_SndFile.m_PlayState.Chn[m_SndFile.GetNumChannels()]; - for (CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++, pChn++) if (pChn->isPreviewNote) + for(ModChannel &chn : m_SndFile.m_PlayState.BackgroundChannels(m_SndFile)) { - if(pChn->nLength != 0 && !pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF| CHN_MUTE] - && (note == pChn->nNewNote || note == NOTE_NONE) - && (pChn->pModSample == &m_SndFile.GetSample(nsmp) || !nsmp) - && (pChn->pModInstrument == m_SndFile.Instruments[nins] || !nins)) return true; + if(chn.isPreviewNote && chn.nLength != 0 && !chn.dwFlags[CHN_NOTEFADE | CHN_KEYOFF| CHN_MUTE] + && (note == chn.nNewNote || note == NOTE_NONE) + && (chn.pModSample == &m_SndFile.GetSample(nsmp) || !nsmp) + && (chn.pModInstrument == m_SndFile.Instruments[nins] || !nins)) + return true; } return false; } @@ -2140,10 +2139,14 @@ CriticalSection cs; // Kill editor voices - for(CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++) if (m_SndFile.m_PlayState.Chn[i].isPreviewNote) + for(ModChannel &chn : m_SndFile.m_PlayState.BackgroundChannels(m_SndFile)) { - m_SndFile.m_PlayState.Chn[i].dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); - if (!isPlaying) m_SndFile.m_PlayState.Chn[i].nLength = 0; + if(chn.isPreviewNote) + { + chn.dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); + if(!isPlaying) + chn.nLength = 0; + } } m_SndFile.m_PlayState.m_flags.set(SONG_POSITIONCHANGED); @@ -2585,9 +2588,9 @@ CriticalSection cs; // Cut instruments/samples - for(CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++) + for(ModChannel &chn : m_SndFile.m_PlayState.BackgroundChannels(m_SndFile)) { - m_SndFile.m_PlayState.Chn[i].dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); + chn.dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); } if ((nOrd < m_SndFile.Order().size()) && (m_SndFile.Order()[nOrd] == nPat)) m_SndFile.m_PlayState.m_nCurrentOrder = m_SndFile.m_PlayState.m_nNextOrder = nOrd; m_SndFile.m_PlayState.m_flags.reset(SONG_PAUSED | SONG_STEP); @@ -2635,9 +2638,9 @@ CriticalSection cs; // Cut instruments/samples - for(CHANNELINDEX i = m_SndFile.GetNumChannels(); i < MAX_CHANNELS; i++) + for(ModChannel &chn : m_SndFile.m_PlayState.BackgroundChannels(m_SndFile)) { - m_SndFile.m_PlayState.Chn[i].dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); + chn.dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); } m_SndFile.m_PlayState.m_flags.reset(SONG_PAUSED | SONG_STEP); m_SndFile.SetCurrentOrder(nOrd); @@ -2876,7 +2879,7 @@ SetPathName(newPath, FALSE); } - UpdateAllViews(NULL, UpdateHint().ModType()); + UpdateAllViews(nullptr, UpdateHint().ModType()); } Modified: trunk/OpenMPT/mptrack/Modedit.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/mptrack/Modedit.cpp Fri May 31 15:50:38 2024 (r20882) @@ -86,10 +86,7 @@ // Increasing number of channels BeginWaitCursor(); std::vector<CHANNELINDEX> channels(nNewChannels, CHANNELINDEX_INVALID); - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) - { - channels[chn] = chn; - } + std::iota(channels.begin(), channels.begin() + GetNumChannels(), CHANNELINDEX(0)); bool success = (ReArrangeChannels(channels) == nNewChannels); if(success) @@ -107,11 +104,12 @@ // Return true on success. bool CModDoc::RemoveChannels(const std::vector<bool> &keepMask, bool verbose) { + MPT_ASSERT(keepMask.size() == GetNumChannels()); CHANNELINDEX nRemainingChannels = 0; //First calculating how many channels are to be left - for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) + for(bool keep : keepMask) { - if(keepMask[chn]) + if(keep) nRemainingChannels++; } if(nRemainingChannels == GetNumChannels() || nRemainingChannels < m_SndFile.GetModSpecifications().channelsMin) @@ -135,9 +133,7 @@ for(CHANNELINDEX chn = 0; chn < GetNumChannels(); chn++) { if(keepMask[chn]) - { channels[i++] = chn; - } } const bool success = (ReArrangeChannels(channels) == nRemainingChannels); if(success) @@ -255,7 +251,7 @@ channel.Reset(ModChannel::resetTotal, m_SndFile, chn, muteFlag); } - std::vector<ModChannel> chns(std::begin(m_SndFile.m_PlayState.Chn), std::begin(m_SndFile.m_PlayState.Chn) + oldNumChannels); + std::vector<ModChannel> chns(m_SndFile.m_PlayState.Chn.begin(), m_SndFile.m_PlayState.Chn.begin() + oldNumChannels); std::vector<ModChannelSettings> settings(std::begin(m_SndFile.ChnSettings), std::begin(m_SndFile.ChnSettings) + oldNumChannels); std::vector<RecordGroup> recordStates(oldNumChannels); auto chnMutePendings = m_SndFile.m_bChannelMuteTogglePending; @@ -377,7 +373,7 @@ GetSampleUndo().RearrangeSamples(newIndex); const auto muteFlag = CSoundFile::GetChannelMuteFlag(); - for(CHANNELINDEX c = 0; c < std::size(m_SndFile.m_PlayState.Chn); c++) + for(CHANNELINDEX c = 0; c < m_SndFile.m_PlayState.Chn.size(); c++) { ModChannel &chn = m_SndFile.m_PlayState.Chn[c]; for(SAMPLEINDEX i = 1; i <= oldNumSamples; i++) Modified: trunk/OpenMPT/mptrack/View_pat.cpp ============================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/mptrack/View_pat.cpp Fri May 31 15:50:38 2024 (r20882) @@ -2234,9 +2234,9 @@ InvalidatePattern(true, true); // Cut instruments/samples in virtual channels - for(CHANNELINDEX i = sndFile.GetNumChannels(); i < MAX_CHANNELS; i++) + for(ModChannel &chn : sndFile.m_PlayState.BackgroundChannels(sndFile)) { - sndFile.m_PlayState.Chn[i].dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); + chn.dwFlags.set(CHN_NOTEFADE | CHN_KEYOFF); } sndFile.LoopPattern(m_nPattern); sndFile.m_PlayState.m_nNextRow = row == ROWINDEX_INVALID ? GetCurrentRow() : row; Modified: trunk/OpenMPT/soundlib/PlayState.cpp ============================================================================== --- trunk/OpenMPT/soundlib/PlayState.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/PlayState.cpp Fri May 31 15:50:38 2024 (r20882) @@ -12,6 +12,7 @@ #include "PlayState.h" #include "MIDIMacros.h" #include "Mixer.h" +#include "Sndfile.h" OPENMPT_NAMESPACE_BEGIN @@ -19,7 +20,7 @@ PlayState::PlayState() { - std::fill(std::begin(Chn), std::end(Chn), ModChannel{}); + Chn.fill({}); m_midiMacroScratchSpace.reserve(kMacroLength); // Note: If macros ever become variable-length, the scratch space needs to be at least one byte longer than the longest macro in the file for end-of-SysEx insertion to stay allocation-free in the mixer! } @@ -33,4 +34,16 @@ } +mpt::span<ModChannel> PlayState::PatternChannels(const CSoundFile &sndFile) noexcept +{ + return mpt::as_span(Chn).subspan(0, std::min(Chn.size(), static_cast<size_t>(sndFile.GetNumChannels()))); +} + + +mpt::span<ModChannel> PlayState::BackgroundChannels(const CSoundFile &sndFile) noexcept +{ + return mpt::as_span(Chn).subspan(std::min(Chn.size(), static_cast<size_t>(sndFile.GetNumChannels()))); +} + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/soundlib/PlayState.h ============================================================================== --- trunk/OpenMPT/soundlib/PlayState.h Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/PlayState.h Fri May 31 15:50:38 2024 (r20882) @@ -70,8 +70,8 @@ public: FlagSet<PlayFlags> m_flags = SONG_POSITIONCHANGED; - CHANNELINDEX ChnMix[MAX_CHANNELS]; // Index of channels in Chn to be actually mixed - ModChannel Chn[MAX_CHANNELS]; // Mixing channels... First m_nChannels channels are master channels (i.e. they are never NNA channels)! + std::array<CHANNELINDEX, MAX_CHANNELS> ChnMix; // Index of channels in Chn to be actually mixed + std::array<ModChannel, MAX_CHANNELS> Chn; // Mixing channels... First m_nChannels channels are directly mapped to pattern channels (i.e. they are never NNA channels)! GlobalScriptState m_globalScriptState; struct MIDIMacroEvaluationResults @@ -92,6 +92,18 @@ { return (m_nMusicSpeed + m_nFrameDelay) * std::max(m_nPatternDelay, uint32(1)); } + + mpt::span<ModChannel> PatternChannels(const CSoundFile &sndFile) noexcept; + mpt::span<const ModChannel> PatternChannels(const CSoundFile &sndFile) const noexcept + { + return const_cast<PlayState *>(this)->PatternChannels(sndFile); + } + + mpt::span<ModChannel> BackgroundChannels(const CSoundFile &sndFile) noexcept; + mpt::span<const ModChannel> BackgroundChannels(const CSoundFile &sndFile) const noexcept + { + return const_cast<PlayState *>(this)->PatternChannels(sndFile); + } }; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Fri May 31 15:50:38 2024 (r20882) @@ -2208,7 +2208,7 @@ CHANNELINDEX CSoundFile::GetNNAChannel(CHANNELINDEX nChn) const { // Check for empty channel - for(CHANNELINDEX i = m_nChannels; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = m_nChannels; i < m_PlayState.Chn.size(); i++) { const ModChannel &c = m_PlayState.Chn[i]; // No sample and no plugin playing @@ -2231,7 +2231,7 @@ // All channels are used: check for lowest volume CHANNELINDEX result = CHANNELINDEX_INVALID; uint32 envpos = 0; - for(CHANNELINDEX i = m_nChannels; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = m_nChannels; i < m_PlayState.Chn.size(); i++) { const ModChannel &c = m_PlayState.Chn[i]; // Stopped OPL channel @@ -2326,7 +2326,7 @@ if(srcChn.dwFlags[CHN_MUTE]) return CHANNELINDEX_INVALID; - for(CHANNELINDEX i = nChn; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = nChn; i < m_PlayState.Chn.size(); i++) { // Only apply to background channels, or the same pattern channel if(i < m_nChannels && i != nChn) @@ -4278,11 +4278,10 @@ { SetFinetune(pattern, row, channel, m_PlayState, isSmooth); // Also apply to notes played via CModDoc::PlayNote - for(CHANNELINDEX chn = GetNumChannels(); chn < MAX_CHANNELS; chn++) + for(ModChannel &chn : m_PlayState.BackgroundChannels(*this)) { - auto &modChn = m_PlayState.Chn[chn]; - if(modChn.nMasterChn == channel + 1 && modChn.isPreviewNote && !modChn.dwFlags[CHN_KEYOFF]) - modChn.microTuning = m_PlayState.Chn[channel].microTuning; + if(chn.nMasterChn == channel + 1 && chn.isPreviewNote && !chn.dwFlags[CHN_KEYOFF]) + chn.microTuning = m_PlayState.Chn[channel].microTuning; } } @@ -5109,7 +5108,7 @@ case 1: case 2: { - for (CHANNELINDEX i = m_nChannels; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = m_nChannels; i < m_PlayState.Chn.size(); i++) { ModChannel &bkChn = m_PlayState.Chn[i]; if (bkChn.nMasterChn == nChn + 1) @@ -6380,11 +6379,10 @@ // IT compatibility 10. Pattern loops (+ same fix for XM / MOD / S3M files) if(!m_playBehaviour[kITFT2PatternLoop] && !(GetType() & (MOD_TYPE_MOD | MOD_TYPE_S3M))) { - auto p = std::cbegin(state.Chn); - for(CHANNELINDEX i = 0; i < GetNumChannels(); i++, p++) + for(const ModChannel &otherChn : state.PatternChannels(*this)) { // Loop on other channel - if(p != &chn && p->nPatternLoopCount) + if(&otherChn != &chn && otherChn.nPatternLoopCount) return; } } @@ -6651,7 +6649,7 @@ PLUGINDEX CSoundFile::GetBestPlugin(const PlayState &playState, CHANNELINDEX nChn, PluginPriority priority, PluginMutePriority respectMutes) const { - if (nChn >= MAX_CHANNELS) //Check valid channel number + if (nChn >= m_PlayState.Chn.size()) //Check valid channel number { return 0; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Fri May 31 15:50:38 2024 (r20882) @@ -887,7 +887,7 @@ void CSoundFile::ResetPlayPos() { const auto muteFlag = GetChannelMuteFlag(); - for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = 0; i < m_PlayState.Chn.size(); i++) m_PlayState.Chn[i].Reset(ModChannel::resetSetPosFull, *this, i, muteFlag); m_visitedRows.Initialize(true); @@ -1033,15 +1033,13 @@ { m_PlayState.m_flags.reset(SONG_FADINGSONG | SONG_ENDREACHED); m_PlayState.m_nBufferCount = 0; - for(auto &chn : m_PlayState.Chn) + for(CHANNELINDEX channel = 0; channel < m_PlayState.Chn.size(); channel++) { + ModChannel &chn = m_PlayState.Chn[channel]; chn.nROfs = chn.nLOfs = 0; chn.nLength = 0; if(chn.dwFlags[CHN_ADLIB] && m_opl) - { - CHANNELINDEX c = static_cast<CHANNELINDEX>(std::distance(std::begin(m_PlayState.Chn), &chn)); - m_opl->NoteCut(c); - } + m_opl->NoteCut(channel); } } @@ -1901,10 +1899,8 @@ return static_cast<double>(2500 * speed) / tempo.ToDouble(); case TempoMode::Modern: - { - // If there are any row delay effects, the row length factor compensates for those. - return 60000.0 / tempo.ToDouble() / static_cast<double>(m_PlayState.m_nCurrentRowsPerBeat); - } + // If there are any row delay effects, the row length factor compensates for those. + return 60000.0 / tempo.ToDouble() / static_cast<double>(m_PlayState.m_nCurrentRowsPerBeat); case TempoMode::Alternative: return static_cast<double>(1000 * speed) / tempo.ToDouble(); Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/Sndfile.h Fri May 31 15:50:38 2024 (r20882) @@ -567,11 +567,9 @@ #endif // MODPLUG_TRACKER public: -#ifdef LIBOPENMPT_BUILD -#ifndef NO_PLUGINS +#if defined(LIBOPENMPT_BUILD) && !defined(NO_PLUGINS) std::unique_ptr<CVstPluginManager> m_PluginManager; #endif -#endif public: std::string m_songName; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Fri May 31 11:49:23 2024 (r20881) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Fri May 31 15:50:38 2024 (r20882) @@ -498,7 +498,7 @@ m_PlayState.m_nMusicSpeed = Order().GetDefaultSpeed(); m_PlayState.m_nMusicTempo = Order().GetDefaultTempo(); m_PlayState.m_nGlobalVolume = m_nDefaultGlobalVolume; - for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = 0; i < m_PlayState.Chn.size(); i++) { auto &chn = m_PlayState.Chn[i]; if(chn.dwFlags[CHN_ADLIB] && m_opl) @@ -639,7 +639,7 @@ } // When jumping to the next subsong, stop all playing notes from the previous song... const auto muteFlag = CSoundFile::GetChannelMuteFlag(); - for(CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + for(CHANNELINDEX i = 0; i < m_PlayState.Chn.size(); i++) m_PlayState.Chn[i].Reset(ModChannel::resetSetPosFull, *this, i, muteFlag); StopAllVsti(); // ...and the global playback information. @@ -667,55 +667,55 @@ // Reset channel values ModCommand *m = Patterns[m_PlayState.m_nPattern].GetpModCommand(m_PlayState.m_nRow, 0); - for (ModChannel *pChn = m_PlayState.Chn, *pEnd = pChn + m_nChannels; pChn != pEnd; pChn++, m++) + for(ModChannel &chn : m_PlayState.PatternChannels(*this)) { // First, handle some quirks that happen after the last tick of the previous row... if(m_playBehaviour[KST3PortaAfterArpeggio] - && pChn->nCommand == CMD_ARPEGGIO // Previous row state! + && chn.nCommand == CMD_ARPEGGIO // Previous row state! && (m->command == CMD_PORTAMENTOUP || m->command == CMD_PORTAMENTODOWN)) { // In ST3, a portamento immediately following an arpeggio continues where the arpeggio left off. // Test case: PortaAfterArp.s3m - pChn->nPeriod = GetPeriodFromNote(pChn->nArpeggioLastNote, pChn->nFineTune, pChn->nC5Speed); + chn.nPeriod = GetPeriodFromNote(chn.nArpeggioLastNote, chn.nFineTune, chn.nC5Speed); } if(m_playBehaviour[kMODOutOfRangeNoteDelay] && !m->IsNote() - && pChn->rowCommand.IsNote() - && pChn->rowCommand.command == CMD_MODCMDEX && (pChn->rowCommand.param & 0xF0) == 0xD0 - && (pChn->rowCommand.param & 0x0Fu) >= m_PlayState.m_nMusicSpeed) + && chn.rowCommand.IsNote() + && chn.rowCommand.command == CMD_MODCMDEX && (chn.rowCommand.param & 0xF0) == 0xD0 + && (chn.rowCommand.param & 0x0Fu) >= m_PlayState.m_nMusicSpeed) { // In ProTracker, a note triggered by an out-of-range note delay can be heard on the next row // if there is no new note on that row. // Test case: NoteDelay-NextRow.mod - pChn->nPeriod = GetPeriodFromNote(pChn->rowCommand.note, pChn->nFineTune, 0); + chn.nPeriod = GetPeriodFromNote(chn.rowCommand.note, chn.nFineTune, 0); } if(m_playBehaviour[kST3TonePortaWithAdlibNote] && !m->IsNote() - && pChn->dwFlags[CHN_ADLIB] - && pChn->nPortamentoDest - && pChn->rowCommand.IsNote() - && pChn->rowCommand.IsTonePortamento()) + && chn.dwFlags[CHN_ADLIB] + && chn.nPortamentoDest + && chn.rowCommand.IsNote() + && chn.rowCommand.IsTonePortamento()) { // ST3: Adlib Note + Tone Portamento does not execute the slide, but changes to the target note instantly on the next row (unless there is another note with tone portamento) // Test case: TonePortamentoWithAdlibNote.s3m - pChn->nPeriod = pChn->nPortamentoDest; + chn.nPeriod = chn.nPortamentoDest; } - if(m_playBehaviour[kMODTempoOnSecondTick] && !m_playBehaviour[kMODVBlankTiming] && m_PlayState.m_nMusicSpeed == 1 && pChn->rowCommand.command == CMD_TEMPO) + if(m_playBehaviour[kMODTempoOnSecondTick] && !m_playBehaviour[kMODVBlankTiming] && m_PlayState.m_nMusicSpeed == 1 && chn.rowCommand.command == CMD_TEMPO) { // ProTracker sets the tempo after the first tick. This block handles the case of one tick per row. // Test case: TempoChange.mod - m_PlayState.m_nMusicTempo = TEMPO(std::max(ModCommand::PARAM(1), pChn->rowCommand.param), 0); + m_PlayState.m_nMusicTempo = TEMPO(std::max(ModCommand::PARAM(1), chn.rowCommand.param), 0); } - pChn->rowCommand = *m; - - pChn->rightVol = pChn->newRightVol; - pChn->leftVol = pChn->newLeftVol; - pChn->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO); - if(!m_playBehaviour[kITVibratoTremoloPanbrello]) pChn->nPanbrelloOffset = 0; - pChn->nCommand = CMD_NONE; - pChn->m_plugParamValueStep = 0; + chn.rightVol = chn.newRightVol; + chn.leftVol = chn.newLeftVol; + chn.dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO); + if(!m_playBehaviour[kITVibratoTremoloPanbrello]) + chn.nPanbrelloOffset = 0; + chn.nCommand = CMD_NONE; + chn.m_plugParamValueStep = 0; + chn.rowCommand = *m++; } // Now that we know which pattern we're on, we can update time signatures (global or pattern-specific) @@ -2139,7 +2139,7 @@ //////////////////////////////////////////////////////////////////////////////////// // Update channels data m_nMixChannels = 0; - for (CHANNELINDEX nChn = 0; nChn < MAX_CHANNELS; nChn++) + for(CHANNELINDEX nChn = 0; nChn < m_PlayState.Chn.size(); nChn++) { ModChannel &chn = m_PlayState.Chn[nChn]; // FT2 Compatibility: Prevent notes to be stopped after a fadeout. This way, a portamento effect can pick up a faded instrument which is long enough. |
From: <sv...@op...> - 2024-05-31 09:49:36
|
Author: sagamusix Date: Fri May 31 11:49:23 2024 New Revision: 20881 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20881 Log: [Ref] Silence -Wconversion warnings. Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp trunk/OpenMPT/soundlib/Load_ftm.cpp Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentSynth.cpp Fri May 31 10:21:21 2024 (r20880) +++ trunk/OpenMPT/soundlib/InstrumentSynth.cpp Fri May 31 11:49:23 2024 (r20881) @@ -82,7 +82,7 @@ CHANNELINDEX FTMRealChannel(CHANNELINDEX channel, const CSoundFile &sndFile) const noexcept { if(m_ftmWorkTrack) - return (m_ftmWorkTrack - 1) % sndFile.GetNumChannels(); + return static_cast<CHANNELINDEX>(m_ftmWorkTrack - 1) % sndFile.GetNumChannels(); else return channel; } @@ -657,10 +657,10 @@ return false; case Event::Type::FTM_SetDetune: // Detune always applies to the first channel of a channel pair (and only if the other channel is playing a sample) - states.states[channel & ~1].m_ftmDetune = event.u16 * -8; + states.states[channel & ~1].m_ftmDetune = static_cast<int16>(event.u16 * -8); return false; case Event::Type::FTM_AddDetune: - states.states[channel & ~1].m_ftmDetune -= event.i16 * 8; + states.states[channel & ~1].m_ftmDetune -= static_cast<int16>(event.i16 * 8); return false; case Event::Type::FTM_AddPitch: if(event.i16) Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 10:21:21 2024 (r20880) +++ trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 11:49:23 2024 (r20881) @@ -62,7 +62,7 @@ uint32 GetHeaderMinimumAdditionalSize() const { - return numSamples * sizeof(FTMSampleHeader) + numEffects * 4; + return static_cast<uint32>(numSamples * sizeof(FTMSampleHeader) + numEffects * 4); } }; @@ -266,15 +266,15 @@ break; case 25: // DETUNE/PITCH ADD [dddppp] case 26: // DETUNE/PITCH SUB [dddppp] - events.push_back(InstrumentSynth::Event::FTM_AddDetune(u12hi * ((item.type == 26) ? -1 : 1))); - events.push_back(InstrumentSynth::Event::FTM_AddPitch(u12lo * ((item.type == 26) ? -1 : 1))); + events.push_back(InstrumentSynth::Event::FTM_AddDetune((item.type == 26) ? -static_cast<int16>(u12hi) : u12hi)); + events.push_back(InstrumentSynth::Event::FTM_AddPitch((item.type == 26) ? -static_cast<int16>(u12lo) : u12lo)); break; case 27: // VOLUME = [....vv] events.push_back(InstrumentSynth::Event::FTM_SetVolume(u8)); break; case 28: // VOLUME ADD [....vv] case 29: // VOLUME SUB [....vv] - events.push_back(InstrumentSynth::Event::FTM_AddVolume(u8 * ((item.type == 29) ? -1 : 1))); + events.push_back(InstrumentSynth::Event::FTM_AddVolume((item.type == 29) ? -static_cast<int16>(u8) : u8)); break; case 30: // CURRENT SAMPLE = [....ss] events.push_back(InstrumentSynth::Event::FTM_SetSample(u8)); @@ -304,7 +304,7 @@ case 47: // 2ND LFO START [mfssdd] case 50: // 3RD LFO START [mfssdd] case 53: // 4TH LFO START [mfssdd] - events.push_back(InstrumentSynth::Event::FTM_StartLFO((item.type - 44u) / 3u, item.data[0])); + events.push_back(InstrumentSynth::Event::FTM_StartLFO(static_cast<uint8>((item.type - 44u) / 3u), item.data[0])); [[fallthrough]]; case 45: // 1ST LFO SP/DE ADD [..ssdd] case 46: // 1ST LFO SP/DE SUB [..ssdd] @@ -314,7 +314,7 @@ case 52: // 3RD LFO SP/DE SUB [..ssdd] case 54: // 4TH LFO SP/DE ADD [..ssdd] case 55: // 4TH LFO SP/DE SUB [..ssdd] - events.push_back(InstrumentSynth::Event::FTM_LFOAddSub(((item.type - 44u) / 3u) | (((item.type - 44u) % 3u == 2) ? 4 : 0), item.data[1], item.data[2])); + events.push_back(InstrumentSynth::Event::FTM_LFOAddSub(static_cast<uint8>(((item.type - 44u) / 3u) | (((item.type - 44u) % 3u == 2) ? 4 : 0)), item.data[1], item.data[2])); break; case 56: // WORK ON TRACK t [.....t] case 57: // WORKTRACK ADD [.....t] @@ -399,7 +399,7 @@ m.SetEffectCommand(CMD_VOLUMEDOWN_DURATION, param); break; case 0xE0: // Loop - loopPoints.push_back({pat, param, chn, static_cast<uint8>(position.rem)}); + loopPoints.push_back({pat, static_cast<uint8>(param & 0x3F), static_cast<uint8>(chn & 0x07), static_cast<uint8>(position.rem & 0x7F)}); break; case 0xF0: // Already handled break; |
From: <sv...@op...> - 2024-05-31 08:21:29
|
Author: manx Date: Fri May 31 10:21:21 2024 New Revision: 20880 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20880 Log: [Var] 7-zip: Update to v24.06. [Imp] build: Set 7-zip 7z compatibility to v15.12. Remove explicit no-filters option. Modified: trunk/OpenMPT/build/auto/build_openmpt_release_packages_multiarch.py trunk/OpenMPT/build/auto/build_openmpt_release_packages_retro.py trunk/OpenMPT/build/auto/setup_arguments.cmd trunk/OpenMPT/build/download_externals.cmd Modified: trunk/OpenMPT/build/auto/build_openmpt_release_packages_multiarch.py ============================================================================== --- trunk/OpenMPT/build/auto/build_openmpt_release_packages_multiarch.py Fri May 31 02:26:13 2024 (r20879) +++ trunk/OpenMPT/build/auto/build_openmpt_release_packages_multiarch.py Fri May 31 10:21:21 2024 (r20880) @@ -296,7 +296,7 @@ if singleThreaded: p7zarm64.communicate() -p7zsymbols = Popen([path7z, "a", "-t7z", "-mx=9", "-mf=off", "../" + openmpt_version_name + "-symbols.7z", "."], cwd=openmpt_zip_symbols_basepath) +p7zsymbols = Popen([path7z, "a", "-t7z", "-mx=9", "-myv=1512", "../" + openmpt_version_name + "-symbols.7z", "."], cwd=openmpt_zip_symbols_basepath) if singleThreaded: p7zsymbols.communicate() Modified: trunk/OpenMPT/build/auto/build_openmpt_release_packages_retro.py ============================================================================== --- trunk/OpenMPT/build/auto/build_openmpt_release_packages_retro.py Fri May 31 02:26:13 2024 (r20879) +++ trunk/OpenMPT/build/auto/build_openmpt_release_packages_retro.py Fri May 31 10:21:21 2024 (r20880) @@ -217,7 +217,7 @@ if singleThreaded: p7zamd64.communicate() -p7zsymbols = Popen([path7z, "a", "-t7z", "-mx=9", "-mf=off", "../" + openmpt_version_name + "-RETRO-symbols.7z", "."], cwd=openmpt_zip_symbols_basepath) +p7zsymbols = Popen([path7z, "a", "-t7z", "-mx=9", "-myv=1512", "../" + openmpt_version_name + "-RETRO-symbols.7z", "."], cwd=openmpt_zip_symbols_basepath) if singleThreaded: p7zsymbols.communicate() Modified: trunk/OpenMPT/build/auto/setup_arguments.cmd ============================================================================== --- trunk/OpenMPT/build/auto/setup_arguments.cmd Fri May 31 02:26:13 2024 (r20879) +++ trunk/OpenMPT/build/auto/setup_arguments.cmd Fri May 31 10:21:21 2024 (r20880) @@ -166,7 +166,7 @@ if "%MPT_PKG_FORMAT%" == "7z" set MPT_PKG_FORMAT_SYMBOLS=xz if "%MPT_PKG_FORMAT%" == "zip" set MPT_PKG_FORMAT_SYMBOLS=zip -if "%MPT_PKG_FORMAT%" == "7z" set MPT_PKG_FORMAT_OPTIONS=-mf=off +if "%MPT_PKG_FORMAT%" == "7z" set MPT_PKG_FORMAT_OPTIONS=-myv=1512 if "%MPT_PKG_FORMAT%" == "zip" set MPT_PKG_FORMAT_OPTIONS= if "%MPT_PKG_FORMAT_SYMBOLS%" == "" set MPT_PKG_FORMAT_SYMBOLS=zip Modified: trunk/OpenMPT/build/download_externals.cmd ============================================================================== --- trunk/OpenMPT/build/download_externals.cmd Fri May 31 02:26:13 2024 (r20879) +++ trunk/OpenMPT/build/download_externals.cmd Fri May 31 10:21:21 2024 (r20880) @@ -31,9 +31,9 @@ call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://7-zip.org/a/7za920.zip" "build\externals\7za920.zip" 84e830c91a0e8ae499cc4814080da6569d8a6acbddc585c8b62abc86c809793aeb669b0a741063a379fd281ade85f120bc27efeb67d63bf961be893eec8bc3b3 384846 || goto error -call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://7-zip.org/a/7z2301-extra.7z" "build\externals\7z2301-extra.7z" c849c2cb489cf5b6eeb92bfbc27dcb37d0349c36971e1bc7ef32c7cde1b659e19e8b46d734ba90f47affe07fdfd5b4774cbfa0fdf4b681e9f60bb46bba1f7f9b 1027828 || goto error +call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://7-zip.org/a/7z2406-extra.7z" "build\externals\7z2406-extra.7z" 6b88a761f7cc8b8affc074b24750bcdc65cc3ab18d127c8bfdd1eca953d43e21558eb1137c4b934689990564d7d24cf14e249a773dc1e5ddb7316b10d73682f8 1610111 || goto error -call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://7-zip.org/a/7z2301-x64.exe" "build\externals\7z2301-x64.exe" 1f4da167ff2f1d34eeaf76c3003ba5fcabfc7a7da40e73e317aa99c6e1321cdf97e00f4feb9e79e1a72240e0376af0c3becb3d309e5bb0385e5192da17ea77ff 1589510 || goto error +call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://7-zip.org/a/7z2406-x64.exe" "build\externals\7z2406-x64.exe" b635b449f49aac29234f677e662be35f72a059401ea0786d956485d07134f9dd10ed284338503f08ff7aad16833cf034eb955ca34e1faf35a8177ccad1f20c75 1619556 || goto error call build\scriptlib\download.cmd %MPT_DOWNLOAD% x%1 "https://web.archive.org/web/20131217072017if_/http://download.nullsoft.com/winamp/plugin-dev/WA5.55_SDK.exe" "build\externals\WA5.55_SDK.exe" 394375db8a16bf155b5de9376f6290488ab339e503dbdfdc4e2f5bede967799e625c559cca363bc988324f1a8e86e5fd28a9f697422abd7bb3dcde4a766607b5 336166 || goto error @@ -63,10 +63,10 @@ rem Get old 7zip distributed as zip and unpack with built-in zip depacker rem Get current 7zip commandline version which can unpack 7zip and the 7zip installer but not other archive formats rem Get 7zip installer and unpack it with current commandline 7zip -rem This is a mess for automatic. Oh well. +rem This is a mess for automation. Oh well. cscript build\scriptlib\unpack-zip.vbs "build\externals\7za920.zip" "build\tools\7zipold" || goto error -build\tools\7zipold\7za.exe x -y -obuild\tools\7zipa "build\externals\7z2301-extra.7z" || goto error -build\tools\7zipa\7za.exe x -y -obuild\tools\7zip "build\externals\7z2301-x64.exe" || goto error +build\tools\7zipold\7za.exe x -y -obuild\tools\7zipa "build\externals\7z2406-extra.7z" || goto error +build\tools\7zipa\7za.exe x -y -obuild\tools\7zip "build\externals\7z2406-x64.exe" || goto error call build\scriptlib\unpack.cmd "build\tools\htmlhelp" "build\externals\htmlhelp.exe" "." || goto error |
From: <sv...@op...> - 2024-05-31 00:26:24
|
Author: sagamusix Date: Fri May 31 02:26:13 2024 New Revision: 20879 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20879 Log: [Var] Add FTM magic bytes to fuzzer dictionary. Modified: trunk/OpenMPT/contrib/fuzzing/all_formats.dict Modified: trunk/OpenMPT/contrib/fuzzing/all_formats.dict ============================================================================== --- trunk/OpenMPT/contrib/fuzzing/all_formats.dict Fri May 31 02:16:38 2024 (r20878) +++ trunk/OpenMPT/contrib/fuzzing/all_formats.dict Fri May 31 02:26:13 2024 (r20879) @@ -53,6 +53,8 @@ fmt="FMTracker\x01\x01" +ftm="FTMN\x03\x03\x00\08\x20\x20\x00\xFF\x3F\x03\x06\x10" + gdm="GDM\xFE" gdm="\x0D\x0A\x1AGMFS\x01\x00" |
From: <sv...@op...> - 2024-05-31 00:16:49
|
Author: sagamusix Date: Fri May 31 02:16:38 2024 New Revision: 20878 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20878 Log: [Fix] FTM: Pattern loops were not imported correctly. Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 02:05:20 2024 (r20877) +++ trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 02:16:38 2024 (r20878) @@ -438,7 +438,7 @@ { activeLoops--; const auto start = loopStart[activeLoops].first; - const std::vector<PATTERNINDEX> ordersToCopy(Order().begin() + start, Order().begin() + ord - start + 1); + const std::vector<PATTERNINDEX> ordersToCopy(Order().begin() + start, Order().begin() + ord + 1); for(uint8 rep = 1; rep < loopStart[activeLoops].second && canAddMore; rep++) { if(ORDERINDEX inserted = Order().insert(ord + 1, mpt::as_span(ordersToCopy)); inserted == ordersToCopy.size()) |
From: <sv...@op...> - 2024-05-31 00:05:27
|
Author: sagamusix Date: Fri May 31 02:05:20 2024 New Revision: 20877 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20877 Log: [Fix] FTM format was missing from file format table. Modified: trunk/OpenMPT/soundlib/Tables.cpp Modified: trunk/OpenMPT/soundlib/Tables.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp Fri May 31 02:01:25 2024 (r20876) +++ trunk/OpenMPT/soundlib/Tables.cpp Fri May 31 02:05:20 2024 (r20877) @@ -73,6 +73,7 @@ { UL_("Digital Tracker"), "dtm" }, { UL_("Farandole Composer"), "far" }, { UL_("FM Tracker"), "fmt" }, + { UL_("Face The Music"), "ftm" }, { UL_("Imago Orpheus"), "imf" }, { UL_("Images Music System"), "ims" }, { UL_("Ice Tracker"), "ice" }, |
From: <sv...@op...> - 2024-05-31 00:01:32
|
Author: sagamusix Date: Fri May 31 02:01:25 2024 New Revision: 20876 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20876 Log: [Fix] Another compile fix for libopenmpt builds. Modified: trunk/OpenMPT/soundlib/PlayState.h Modified: trunk/OpenMPT/soundlib/PlayState.h ============================================================================== --- trunk/OpenMPT/soundlib/PlayState.h Fri May 31 01:56:11 2024 (r20875) +++ trunk/OpenMPT/soundlib/PlayState.h Fri May 31 02:01:25 2024 (r20876) @@ -15,6 +15,10 @@ #include "plugins/PluginStructs.h" #include "Snd_defs.h" +#include <map> +#include <optional> +#include <vector> + OPENMPT_NAMESPACE_BEGIN struct PlayState |
From: <sv...@op...> - 2024-05-30 23:56:23
|
Author: sagamusix Date: Fri May 31 01:56:11 2024 New Revision: 20875 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20875 Log: [Fix] Another compile fix. Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 01:48:18 2024 (r20874) +++ trunk/OpenMPT/soundlib/Load_ftm.cpp Fri May 31 01:56:11 2024 (r20875) @@ -441,7 +441,7 @@ const std::vector<PATTERNINDEX> ordersToCopy(Order().begin() + start, Order().begin() + ord - start + 1); for(uint8 rep = 1; rep < loopStart[activeLoops].second && canAddMore; rep++) { - if(ORDERINDEX inserted = Order().insert(ord + 1, ordersToCopy); inserted == ordersToCopy.size()) + if(ORDERINDEX inserted = Order().insert(ord + 1, mpt::as_span(ordersToCopy)); inserted == ordersToCopy.size()) ordersInserted += inserted; else canAddMore = false; |
From: <sv...@op...> - 2024-05-30 23:48:25
|
Author: sagamusix Date: Fri May 31 01:48:18 2024 New Revision: 20874 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20874 Log: [Fix] Compile fix for pre-C++20 compilers. Modified: trunk/OpenMPT/soundlib/InstrumentSynth.h Modified: trunk/OpenMPT/soundlib/InstrumentSynth.h ============================================================================== --- trunk/OpenMPT/soundlib/InstrumentSynth.h Fri May 31 01:42:57 2024 (r20873) +++ trunk/OpenMPT/soundlib/InstrumentSynth.h Fri May 31 01:48:18 2024 (r20874) @@ -190,7 +190,7 @@ constexpr Event &operator=(const Event &other) noexcept = default; constexpr Event &operator=(Event &&other) noexcept = default; - constexpr bool IsJumpEvent() const noexcept + MPT_CONSTEXPR20_FUN bool IsJumpEvent() const noexcept { return mpt::contains(JumpEvents, type); } |
Author: sagamusix Date: Fri May 31 01:42:57 2024 New Revision: 20873 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20873 Log: [New] Can now read Face The Music (FTM) modules. [Ref] Move PlayState out of CSoundFile so that it can be forward-declared. [Mod] OpenMPT: Version is now 1.32.00.16 Added: trunk/OpenMPT/soundlib/Load_ftm.cpp (contents, props changed) trunk/OpenMPT/soundlib/PlayState.cpp - copied, changed from r20839, trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/PlayState.h - copied, changed from r20839, trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/build/android_ndk/Android.mk trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2019win10/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2019win10/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2019win10uwp/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2019win10uwp/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2019win10uwp/libopenmpt.vcxproj trunk/OpenMPT/build/vs2019win10uwp/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2019win7/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2019win7/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2019win7/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2019win7/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2019win7/OpenMPT.vcxproj trunk/OpenMPT/build/vs2019win7/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2019win7/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2019win7/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2019win7/libopenmpt.vcxproj trunk/OpenMPT/build/vs2019win7/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2019win7/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2019win7/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2019win81/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2019win81/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2019win81/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2019win81/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2019win81/OpenMPT.vcxproj trunk/OpenMPT/build/vs2019win81/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2019win81/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2019win81/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2019win81/libopenmpt.vcxproj trunk/OpenMPT/build/vs2019win81/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2019win81/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2019win81/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2022win10/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2022win10/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2022win10/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2022win10/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2022win10/OpenMPT.vcxproj trunk/OpenMPT/build/vs2022win10/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2022win10/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2022win10/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2022win10/libopenmpt.vcxproj trunk/OpenMPT/build/vs2022win10/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2022win10/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2022win10/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2022win10clang/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2022win10clang/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/OpenMPT.vcxproj trunk/OpenMPT/build/vs2022win10clang/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2022win10clang/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/libopenmpt.vcxproj trunk/OpenMPT/build/vs2022win10clang/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2022win10clang/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2022win10clang/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2022win10uwp/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2022win10uwp/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2022win10uwp/libopenmpt.vcxproj trunk/OpenMPT/build/vs2022win10uwp/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2022win7/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2022win7/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2022win7/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2022win7/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2022win7/OpenMPT.vcxproj trunk/OpenMPT/build/vs2022win7/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2022win7/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2022win7/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2022win7/libopenmpt.vcxproj trunk/OpenMPT/build/vs2022win7/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2022win7/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2022win7/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/vs2022win81/OpenMPT-ANSI.vcxproj trunk/OpenMPT/build/vs2022win81/OpenMPT-ANSI.vcxproj.filters trunk/OpenMPT/build/vs2022win81/OpenMPT-UTF8.vcxproj trunk/OpenMPT/build/vs2022win81/OpenMPT-UTF8.vcxproj.filters trunk/OpenMPT/build/vs2022win81/OpenMPT.vcxproj trunk/OpenMPT/build/vs2022win81/OpenMPT.vcxproj.filters trunk/OpenMPT/build/vs2022win81/libopenmpt-small.vcxproj trunk/OpenMPT/build/vs2022win81/libopenmpt-small.vcxproj.filters trunk/OpenMPT/build/vs2022win81/libopenmpt.vcxproj trunk/OpenMPT/build/vs2022win81/libopenmpt.vcxproj.filters trunk/OpenMPT/build/vs2022win81/libopenmpt_test.vcxproj trunk/OpenMPT/build/vs2022win81/libopenmpt_test.vcxproj.filters trunk/OpenMPT/build/xcode-ios/libopenmpt.xcodeproj/project.pbxproj trunk/OpenMPT/build/xcode-macosx/libopenmpt.xcodeproj/project.pbxproj trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/installer/filetypes-multi-arch-per-arch-retro.iss trunk/OpenMPT/installer/filetypes-multi-arch-per-arch.iss trunk/OpenMPT/installer/filetypes-multi-arch-retro.iss trunk/OpenMPT/installer/filetypes-multi-arch.iss trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/soundlib/InstrumentSynth.cpp trunk/OpenMPT/soundlib/InstrumentSynth.h trunk/OpenMPT/soundlib/Load_gt2.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/ModSequence.h trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/modcommand.cpp trunk/OpenMPT/soundlib/modcommand.h trunk/OpenMPT/test/PlaybackTest.cpp Modified: trunk/OpenMPT/build/android_ndk/Android.mk ============================================================================== --- trunk/OpenMPT/build/android_ndk/Android.mk Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/android_ndk/Android.mk Fri May 31 01:42:57 2024 (r20873) @@ -125,6 +125,7 @@ soundlib/Load_dtm.cpp \ soundlib/Load_far.cpp \ soundlib/Load_fmt.cpp \ + soundlib/Load_ftm.cpp \ soundlib/Load_gdm.cpp \ soundlib/Load_gmc.cpp \ soundlib/Load_gt2.cpp \ @@ -180,6 +181,7 @@ soundlib/Paula.cpp \ soundlib/patternContainer.cpp \ soundlib/pattern.cpp \ + soundlib/PlayState.cpp \ soundlib/RowVisitor.cpp \ soundlib/S3MTools.cpp \ soundlib/SampleFormats.cpp \ Modified: trunk/OpenMPT/build/autotools/Makefile.am ============================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/autotools/Makefile.am Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,7 @@ MPT_FILES_SOUNDLIB += soundlib/Loaders.h MPT_FILES_SOUNDLIB += soundlib/Load_far.cpp MPT_FILES_SOUNDLIB += soundlib/Load_fmt.cpp +MPT_FILES_SOUNDLIB += soundlib/Load_ftm.cpp MPT_FILES_SOUNDLIB += soundlib/Load_gdm.cpp MPT_FILES_SOUNDLIB += soundlib/Load_gmc.cpp MPT_FILES_SOUNDLIB += soundlib/Load_gt2.cpp @@ -469,6 +470,8 @@ MPT_FILES_SOUNDLIB += soundlib/patternContainer.h MPT_FILES_SOUNDLIB += soundlib/pattern.cpp MPT_FILES_SOUNDLIB += soundlib/pattern.h +MPT_FILES_SOUNDLIB += soundlib/PlayState.cpp +MPT_FILES_SOUNDLIB += soundlib/PlayState.h MPT_FILES_SOUNDLIB += soundlib/Resampler.h MPT_FILES_SOUNDLIB += soundlib/RowVisitor.cpp MPT_FILES_SOUNDLIB += soundlib/RowVisitor.h Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT-ANSI.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT-UTF8.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/OpenMPT.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -719,6 +719,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -989,6 +990,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1038,6 +1040,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt-small.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -719,6 +719,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -989,6 +990,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1038,6 +1040,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -749,6 +749,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1029,6 +1030,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1078,6 +1080,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxp/libopenmpt_test.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -402,6 +402,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1238,6 +1241,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1385,6 +1391,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-ANSI.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT-UTF8.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -939,6 +939,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1362,6 +1363,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1411,6 +1413,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/OpenMPT.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -768,6 +768,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2033,6 +2036,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2180,6 +2186,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -719,6 +719,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -989,6 +990,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1038,6 +1040,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt-small.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -719,6 +719,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -989,6 +990,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1038,6 +1040,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -749,6 +749,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1029,6 +1030,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1078,6 +1080,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2017winxpansi/libopenmpt_test.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -402,6 +402,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1238,6 +1241,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1385,6 +1391,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -1714,6 +1714,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -2137,6 +2138,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -2186,6 +2188,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT-ANSI.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -810,6 +810,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2075,6 +2078,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2222,6 +2228,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -1714,6 +1714,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -2137,6 +2138,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -2186,6 +2188,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT-UTF8.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -810,6 +810,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2075,6 +2078,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2222,6 +2228,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -1714,6 +1714,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -2137,6 +2138,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -2186,6 +2188,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/OpenMPT.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -810,6 +810,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -2075,6 +2078,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -2222,6 +2228,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -1346,6 +1346,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1616,6 +1617,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1665,6 +1667,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/libopenmpt-small.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj ============================================================================== --- trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj Fri May 31 01:42:57 2024 (r20873) @@ -1346,6 +1346,7 @@ <ClInclude Include="..\..\soundlib\OPL.h" /> <ClInclude Include="..\..\soundlib\OggStream.h" /> <ClInclude Include="..\..\soundlib\Paula.h" /> + <ClInclude Include="..\..\soundlib\PlayState.h" /> <ClInclude Include="..\..\soundlib\Resampler.h" /> <ClInclude Include="..\..\soundlib\RowVisitor.h" /> <ClInclude Include="..\..\soundlib\S3MTools.h" /> @@ -1616,6 +1617,7 @@ <ClCompile Include="..\..\soundlib\Load_dtm.cpp" /> <ClCompile Include="..\..\soundlib\Load_far.cpp" /> <ClCompile Include="..\..\soundlib\Load_fmt.cpp" /> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gdm.cpp" /> <ClCompile Include="..\..\soundlib\Load_gmc.cpp" /> <ClCompile Include="..\..\soundlib\Load_gt2.cpp" /> @@ -1665,6 +1667,7 @@ <ClCompile Include="..\..\soundlib\OPL.cpp" /> <ClCompile Include="..\..\soundlib\OggStream.cpp" /> <ClCompile Include="..\..\soundlib\Paula.cpp" /> + <ClCompile Include="..\..\soundlib\PlayState.cpp" /> <ClCompile Include="..\..\soundlib\RowVisitor.cpp" /> <ClCompile Include="..\..\soundlib\S3MTools.cpp" /> <ClCompile Include="..\..\soundlib\SampleFormatBRR.cpp" /> Modified: trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj.filters ============================================================================== --- trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj.filters Thu May 30 23:32:20 2024 (r20872) +++ trunk/OpenMPT/build/vs2019win10/libopenmpt.vcxproj.filters Fri May 31 01:42:57 2024 (r20873) @@ -390,6 +390,9 @@ <ClInclude Include="..\..\soundlib\Paula.h"> <Filter>soundlib</Filter> </ClInclude> + <ClInclude Include="..\..\soundlib\PlayState.h"> + <Filter>soundlib</Filter> + </ClInclude> <ClInclude Include="..\..\soundlib\Resampler.h"> <Filter>soundlib</Filter> </ClInclude> @@ -1196,6 +1199,9 @@ <ClCompile Include="..\..\soundlib\Load_fmt.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\Load_ftm.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\Load_gdm.cpp"> <Filter>soundlib</Filter> </ClCompile> @@ -1343,6 +1349,9 @@ <ClCompile Include="..\..\soundlib\Paula.cpp"> <Filter>soundlib</Filter> </ClCompile> + <ClCompile Include="..\..\soundlib\PlayState.cpp"> + <Filter>soundlib</Filter> + </ClCompile> <ClCompile Include="..\..\soundlib\RowVisitor.cpp"> <Filter>soundlib</Filter> </ClCompile> Modified: trunk/OpenMPT/build/vs2019win10/libopenmpt_test.vcxproj ======================================... [truncated message content] |
From: <sv...@op...> - 2024-05-30 21:32:32
|
Author: sagamusix Date: Thu May 30 23:32:20 2024 New Revision: 20872 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20872 Log: [Fix] Also disable loop wrap-around buffer logic if the sample loop start doesn't match. Modified: trunk/OpenMPT/soundlib/Fastmix.cpp Modified: trunk/OpenMPT/soundlib/Fastmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Fastmix.cpp Thu May 30 23:30:33 2024 (r20871) +++ trunk/OpenMPT/soundlib/Fastmix.cpp Thu May 30 23:32:20 2024 (r20872) @@ -76,7 +76,7 @@ const bool inSustainLoop = chn.InSustainLoop() && chn.nLoopStart == chn.pModSample->nSustainStart && chn.nLoopEnd == chn.pModSample->nSustainEnd; // Do not enable wraparound magic if we're previewing a custom loop! - if(inSustainLoop || chn.nLoopEnd == chn.pModSample->nLoopEnd) + if(inSustainLoop || (chn.nLoopStart == chn.pModSample->nLoopStart && chn.nLoopEnd == chn.pModSample->nLoopEnd)) { SmpLength lookaheadOffset = 3 * InterpolationLookaheadBufferSize + chn.pModSample->nLength - chn.nLoopEnd; if(inSustainLoop) |
From: <sv...@op...> - 2024-05-30 21:30:39
|
Author: sagamusix Date: Thu May 30 23:30:33 2024 New Revision: 20871 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20871 Log: [Imp] S3M: For S3Ms made with Impulse Tracker, use sample swapping behaviour that is closer to Impulse Tracker itself. Fixes alien.s3m by Davers. Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp Thu May 30 23:16:31 2024 (r20870) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp Thu May 30 23:30:33 2024 (r20871) @@ -312,6 +312,9 @@ m_playBehaviour.set(kITRetrigger); m_playBehaviour.set(kITShortSampleRetrig); m_playBehaviour.set(kST3SampleSwap); // Not exactly like ST3, but close enough + // alien.s3m by Davers (pattern 13) needs these to play the Gxx with sample switch as intended + m_playBehaviour.set(kITPortaNoNote); + m_playBehaviour.set(kITPortamentoSwapResetsPos); m_nMinPeriod = 1; break; case S3MFileHeader::trkSchismTracker: @@ -371,7 +374,7 @@ { m_playBehaviour.reset(kST3NoMutedChannels); m_playBehaviour.reset(kST3EffectMemory); - m_playBehaviour.reset(kST3PortaSampleChange); + m_playBehaviour.set(kST3PortaSampleChange, (fileHeader.cwtv& S3MFileHeader::trackerMask) == S3MFileHeader::trkImpulseTracker); m_playBehaviour.reset(kST3VibratoMemory); m_playBehaviour.reset(KST3PortaAfterArpeggio); m_playBehaviour.reset(kST3OffsetWithoutInstrument); |
From: <sv...@op...> - 2024-05-30 21:16:44
|
Author: sagamusix Date: Thu May 30 23:16:31 2024 New Revision: 20870 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20870 Log: [Ref] Turn a few ModChannel/ModChannelSettings members into 8-bit members. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_ext_impl.cpp trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/ModChannel.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/libopenmpt/libopenmpt_ext_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_ext_impl.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/libopenmpt/libopenmpt_ext_impl.cpp Thu May 30 23:16:31 2024 (r20870) @@ -183,7 +183,7 @@ if ( volume < 0.0 || volume > 1.0 ) { throw openmpt::exception("invalid global volume"); } - m_sndFile->m_PlayState.Chn[channel].nGlobalVol = mpt::saturate_round<std::int32_t>(volume * 64.0); + m_sndFile->m_PlayState.Chn[channel].nGlobalVol = mpt::saturate_round<std::uint8_t>(volume * 64.0); } double module_ext_impl::get_channel_volume( std::int32_t channel ) const { Modified: trunk/OpenMPT/mptrack/Moddoc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/mptrack/Moddoc.cpp Thu May 30 23:16:31 2024 (r20870) @@ -1472,11 +1472,11 @@ if(nChn >= m_SndFile.GetNumChannels() || nVolume > 64) return false; if(m_SndFile.ChnSettings[nChn].nVolume != nVolume) { - m_SndFile.ChnSettings[nChn].nVolume = nVolume; + m_SndFile.ChnSettings[nChn].nVolume = static_cast<uint8>(nVolume); if(m_SndFile.GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) SetModified(); ok = true; } - m_SndFile.m_PlayState.Chn[nChn].nGlobalVol = nVolume; + m_SndFile.m_PlayState.Chn[nChn].nGlobalVol = static_cast<uint8>(nVolume); return ok; } Modified: trunk/OpenMPT/soundlib/Load_itp.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/soundlib/Load_itp.cpp Thu May 30 23:16:31 2024 (r20870) @@ -212,7 +212,7 @@ uint32 flags = file.ReadUint32LE(); if(flags & 0x100) ChnSettings[chn].dwFlags.set(CHN_MUTE); if(flags & 0x800) ChnSettings[chn].dwFlags.set(CHN_SURROUND); - ChnSettings[chn].nVolume = std::min(static_cast<uint16>(file.ReadUint32LE()), uint16(64)); + ChnSettings[chn].nVolume = std::min(static_cast<uint8>(file.ReadUint32LE()), uint8(64)); file.ReadString<mpt::String::maybeNullTerminated>(ChnSettings[chn].szName, size); } Modified: trunk/OpenMPT/soundlib/ModChannel.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/soundlib/ModChannel.cpp Thu May 30 23:16:31 2024 (r20870) @@ -125,9 +125,9 @@ { nInsVol = 64; if(smp != nullptr) - nInsVol = smp->nGlobalVol; + nInsVol = static_cast<uint8>(smp->nGlobalVol); if(ins != nullptr) - nInsVol = (nInsVol * ins->nGlobalVol) / 64; + nInsVol = static_cast<uint8>((nInsVol * ins->nGlobalVol) / 64); } Modified: trunk/OpenMPT/soundlib/ModChannel.h ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/soundlib/ModChannel.h Thu May 30 23:16:31 2024 (r20870) @@ -98,14 +98,11 @@ 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) 0...64 - int32 nInsVol; // Sample / Instrument volume (SV * IV in ITTECH.TXT) 0...64 int32 nAutoVibDepth; uint32 nEFxOffset; // Offset memory for Invert Loop (EFx, .MOD only) ROWINDEX nPatternLoop; AutoSlideStatus autoSlide; uint16 portamentoSlide; - int16 nTranspose; int16 nFineTune; int16 microTuning; // Micro-tuning / MIDI pitch wheel command int16 nVolSwing, nPanSwing; @@ -115,6 +112,9 @@ CHANNELINDEX nMasterChn; ModCommand rowCommand; // 8-bit members + uint8 nGlobalVol; // Channel volume (CV in ITTECH.TXT) 0...64 + uint8 nInsVol; // Sample / Instrument volume (SV * IV in ITTECH.TXT) 0...64 + int8 nTranspose; ResamplingMode resamplingMode; uint8 nRestoreResonanceOnNewNote; // See nRestorePanOnNewNote uint8 nRestoreCutoffOnNewNote; // ditto @@ -246,7 +246,7 @@ #endif // MODPLUG_TRACKER FlagSet<ChannelFlags> dwFlags; // Channel flags uint16 nPan = 128; // Initial pan (0...256) - uint16 nVolume = 64; // Initial channel volume (0...64) + uint8 nVolume = 64; // Initial channel volume (0...64) PLUGINDEX nMixPlugin = 0; // Assigned plugin mpt::charbuf<MAX_CHANNELNAME> szName; // Channel name Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Thu May 30 23:16:31 2024 (r20870) @@ -888,7 +888,7 @@ else // Up volume += ((param & 0xF0) >> 4) * nonRowTicks; Limit(volume, 0, 64); - chn.nGlobalVol = volume; + chn.nGlobalVol = static_cast<uint8>(volume); } break; case CMD_PANNING8: @@ -3573,7 +3573,7 @@ if(!m_PlayState.m_flags[SONG_FIRSTTICK]) break; if (param <= 64) { - chn.nGlobalVol = param; + chn.nGlobalVol = static_cast<uint8>(param); chn.dwFlags.set(CHN_FASTVOLRAMP); } break; @@ -4812,8 +4812,8 @@ if (nChnSlide) { nChnSlide += chn.nGlobalVol; - nChnSlide = Clamp(nChnSlide, 0, 64); - chn.nGlobalVol = nChnSlide; + Limit(nChnSlide, 0, 64); + chn.nGlobalVol = static_cast<uint8>(nChnSlide); } } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Thu May 30 22:56:07 2024 (r20869) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Thu May 30 23:16:31 2024 (r20870) @@ -585,7 +585,7 @@ const auto muteFlag = GetChannelMuteFlag(); for(CHANNELINDEX chn = 0; chn < MAX_BASECHANNELS; chn++) { - LimitMax(ChnSettings[chn].nVolume, uint16(64)); + LimitMax(ChnSettings[chn].nVolume, uint8(64)); if(ChnSettings[chn].nPan > 256) ChnSettings[chn].nPan = 128; if(ChnSettings[chn].nMixPlugin > MAX_MIXPLUGINS) |
From: <sv...@op...> - 2024-05-30 20:56:14
|
Author: sagamusix Date: Thu May 30 22:56:07 2024 New Revision: 20869 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20869 Log: [Mod] 8SVX: Add code to load a specific octave sample (currently unused). Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp Thu May 30 22:54:12 2024 (r20868) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp Thu May 30 22:56:07 2024 (r20869) @@ -2560,7 +2560,7 @@ MPT_BINARY_STRUCT(IFFSampleHeader, 20) -bool CSoundFile::ReadIFFSample(SAMPLEINDEX nSample, FileReader &file, bool allowLittleEndian) +bool CSoundFile::ReadIFFSample(SAMPLEINDEX nSample, FileReader &file, bool allowLittleEndian, uint8 octave) { file.Rewind(); @@ -2651,6 +2651,18 @@ sampleRate = sampleHeader.samplesPerSec; volume = sampleHeader.volume; numSamples = mpt::saturate_cast<SmpLength>(sampleData.GetLength() / bytesPerFrame); + + if(octave < sampleHeader.octave) + { + numSamples = sampleHeader.oneShotHiSamples + sampleHeader.repeatHiSamples; + for(uint8 o = 0; o < octave; o++) + { + sampleData.Skip(numSamples * bytesPerSample * numChannels); + numSamples *= 2; + loopStart *= 2; + loopLength *= 2; + } + } } DestroySampleThreadsafe(nSample); Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Thu May 30 22:54:12 2024 (r20868) +++ trunk/OpenMPT/soundlib/Sndfile.h Thu May 30 22:56:07 2024 (r20869) @@ -1246,7 +1246,7 @@ bool ReadXISample(SAMPLEINDEX nSample, FileReader &file); bool ReadITSSample(SAMPLEINDEX nSample, FileReader &file, bool rewind = true); bool ReadITISample(SAMPLEINDEX nSample, FileReader &file); - bool ReadIFFSample(SAMPLEINDEX sample, FileReader &file, bool allowLittleEndian = true); + bool ReadIFFSample(SAMPLEINDEX sample, FileReader &file, bool allowLittleEndian = true, uint8 octave = uint8_max); bool ReadBRRSample(SAMPLEINDEX sample, FileReader &file); bool ReadFLACSample(SAMPLEINDEX sample, FileReader &file); bool ReadOpusSample(SAMPLEINDEX sample, FileReader &file); |
From: <sv...@op...> - 2024-05-30 20:54:21
|
Author: sagamusix Date: Thu May 30 22:54:12 2024 New Revision: 20868 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20868 Log: [Ref] Move samplecount_t out of CSoundFile. Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mod2wave.cpp trunk/OpenMPT/mptrack/OPLExport.cpp trunk/OpenMPT/mptrack/mod2midi.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp ============================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp Thu May 30 22:54:12 2024 (r20868) @@ -512,7 +512,7 @@ OpenMPT::AudioTargetBufferWithGain<mpt::audio_span_planar<std::int16_t>> target( mpt::audio_span_planar<std::int16_t>( buffers, valid_channels( buffers, std::size( buffers ) ), count ), *m_Dithers, m_Gain ); while ( count > 0 ) { std::size_t count_chunk = m_sndFile->Read( - static_cast<OpenMPT::CSoundFile::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::CSoundFile::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels + static_cast<OpenMPT::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels target ); if ( count_chunk == 0 ) { @@ -535,7 +535,7 @@ OpenMPT::AudioTargetBufferWithGain<mpt::audio_span_planar<float>> target( mpt::audio_span_planar<float>( buffers, valid_channels( buffers, std::size( buffers ) ), count ), *m_Dithers, m_Gain ); while ( count > 0 ) { std::size_t count_chunk = m_sndFile->Read( - static_cast<OpenMPT::CSoundFile::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::CSoundFile::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels + static_cast<OpenMPT::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels target ); if ( count_chunk == 0 ) { @@ -557,7 +557,7 @@ OpenMPT::AudioTargetBufferWithGain<mpt::audio_span_interleaved<std::int16_t>> target( mpt::audio_span_interleaved<std::int16_t>( interleaved, channels, count ), *m_Dithers, m_Gain ); while ( count > 0 ) { std::size_t count_chunk = m_sndFile->Read( - static_cast<OpenMPT::CSoundFile::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::CSoundFile::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels + static_cast<OpenMPT::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels target ); if ( count_chunk == 0 ) { @@ -579,7 +579,7 @@ OpenMPT::AudioTargetBufferWithGain<mpt::audio_span_interleaved<float>> target( mpt::audio_span_interleaved<float>( interleaved, channels, count ), *m_Dithers, m_Gain ); while ( count > 0 ) { std::size_t count_chunk = m_sndFile->Read( - static_cast<OpenMPT::CSoundFile::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::CSoundFile::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels + static_cast<OpenMPT::samplecount_t>( std::min( static_cast<std::uint64_t>( count ), static_cast<std::uint64_t>( std::numeric_limits<OpenMPT::samplecount_t>::max() / 2 / 4 / 4 ) ) ), // safety margin / samplesize / channels target ); if ( count_chunk == 0 ) { Modified: trunk/OpenMPT/mptrack/MainFrm.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/mptrack/MainFrm.cpp Thu May 30 22:54:12 2024 (r20868) @@ -812,12 +812,12 @@ OPENMPT_PROFILE_FUNCTION(Profiler::Audio); BufferInputWrapper source(buffer); BufferOutputWrapper target(buffer); - MPT_ASSERT(buffer.GetNumFrames() <= std::numeric_limits<CSoundFile::samplecount_t>::max()); - CSoundFile::samplecount_t framesToRender = static_cast<CSoundFile::samplecount_t>(buffer.GetNumFrames()); + MPT_ASSERT(buffer.GetNumFrames() <= std::numeric_limits<samplecount_t>::max()); + samplecount_t framesToRender = static_cast<samplecount_t>(buffer.GetNumFrames()); MPT_ASSERT(framesToRender > 0); - CSoundFile::samplecount_t renderedFrames = m_pSndFile->Read(framesToRender, target, source, std::ref(m_VUMeterOutput), std::ref(m_VUMeterInput)); + samplecount_t renderedFrames = m_pSndFile->Read(framesToRender, target, source, std::ref(m_VUMeterOutput), std::ref(m_VUMeterInput)); MPT_ASSERT(renderedFrames <= framesToRender); - [[maybe_unused]] CSoundFile::samplecount_t remainingFrames = framesToRender - renderedFrames; + [[maybe_unused]] samplecount_t remainingFrames = framesToRender - renderedFrames; MPT_ASSERT(remainingFrames >= 0); // remaining buffer is filled with silence automatically } @@ -827,8 +827,8 @@ MPT_TRACE_SCOPE(); MPT_ASSERT(InAudioThread()); OPENMPT_PROFILE_FUNCTION(Profiler::Notify); - MPT_ASSERT((timeInfo.RenderStreamPositionAfter.Frames - timeInfo.RenderStreamPositionBefore.Frames) < std::numeric_limits<CSoundFile::samplecount_t>::max()); - CSoundFile::samplecount_t framesRendered = static_cast<CSoundFile::samplecount_t>(timeInfo.RenderStreamPositionAfter.Frames - timeInfo.RenderStreamPositionBefore.Frames); + MPT_ASSERT((timeInfo.RenderStreamPositionAfter.Frames - timeInfo.RenderStreamPositionBefore.Frames) < std::numeric_limits<samplecount_t>::max()); + samplecount_t framesRendered = static_cast<samplecount_t>(timeInfo.RenderStreamPositionAfter.Frames - timeInfo.RenderStreamPositionBefore.Frames); int64 streamPosition = timeInfo.RenderStreamPositionAfter.Frames; DoNotification(framesRendered, streamPosition); //m_pSndFile->m_TimingInfo = TimingInfo(); // reset @@ -2114,7 +2114,7 @@ IdleHandlerSounddevice(); // Display Time in status bar - CSoundFile::samplecount_t time = 0; + samplecount_t time = 0; if(m_pSndFile != nullptr && m_pSndFile->GetSampleRate() != 0) { time = m_pSndFile->GetTotalSampleCount() / m_pSndFile->GetSampleRate(); Modified: trunk/OpenMPT/mptrack/Mainfrm.h ============================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/mptrack/Mainfrm.h Thu May 30 22:54:12 2024 (r20868) @@ -183,7 +183,7 @@ CMainToolBar m_wndToolBar; CSoundFile *m_pSndFile = nullptr; // != NULL only when currently playing or rendering HWND m_hWndMidi = nullptr; - CSoundFile::samplecount_t m_dwTimeSec = 0; + samplecount_t m_dwTimeSec = 0; UINT_PTR m_nTimer = 0; UINT m_nAvgMixChn = 0, m_nMixChn = 0; // Misc @@ -281,7 +281,7 @@ void UpdateTree(CModDoc *pModDoc, UpdateHint hint, CObject *pHint = nullptr); void RefreshDlsBanks(); static CInputHandler* GetInputHandler() { return m_InputHandler; } - void SetElapsedTime(double t) { m_dwTimeSec = static_cast<CSoundFile::samplecount_t>(t); } + void SetElapsedTime(double t) { m_dwTimeSec = static_cast<samplecount_t>(t); } #if defined(MPT_ENABLE_UPDATE) bool ShowUpdateIndicator(const UpdateCheckResult &result, const CString &releaseVersion, const CString &infoURL, bool showHighlight); Modified: trunk/OpenMPT/mptrack/Mod2wave.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mod2wave.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/mptrack/Mod2wave.cpp Thu May 30 22:54:12 2024 (r20868) @@ -41,7 +41,7 @@ template <typename Tsample> -static CSoundFile::samplecount_t ReadInterleaved(CSoundFile &sndFile, Tsample *outputBuffer, std::size_t channels, CSoundFile::samplecount_t count, DithersOpenMPT &dithers) +static samplecount_t ReadInterleaved(CSoundFile &sndFile, Tsample *outputBuffer, std::size_t channels, samplecount_t count, DithersOpenMPT &dithers) { sndFile.ResetMixStat(); MPT_ASSERT(sndFile.m_MixerSettings.gnChannels == channels); Modified: trunk/OpenMPT/mptrack/OPLExport.cpp ============================================================================== --- trunk/OpenMPT/mptrack/OPLExport.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/mptrack/OPLExport.cpp Thu May 30 22:54:12 2024 (r20868) @@ -86,7 +86,7 @@ { struct RegisterDump { - CSoundFile::samplecount_t sampleOffset; + samplecount_t sampleOffset; uint8 regLo; uint8 regHi; uint8 value; @@ -124,7 +124,7 @@ mpt::IO::Write(f, header); - CSoundFile::samplecount_t prevOffset = 0, prevOffsetMs = 0; + samplecount_t prevOffset = 0, prevOffsetMs = 0; bool prevHigh = false; for(const auto ® : m_registerDump) { @@ -177,7 +177,7 @@ mpt::IO::Write(f, header); } - void WriteVGZ(std::ostream &f, const CSoundFile::samplecount_t loopStart, const FileTags &fileTags, const mpt::ustring &filename) const + void WriteVGZ(std::ostream &f, const samplecount_t loopStart, const FileTags &fileTags, const mpt::ustring &filename) const { std::ostringstream outStream; WriteVGM(outStream, loopStart, fileTags); @@ -186,7 +186,7 @@ WriteGzip(f, outData, filename); } - void WriteVGM(std::ostream &f, const CSoundFile::samplecount_t loopStart, const FileTags &fileTags) const + void WriteVGM(std::ostream &f, const samplecount_t loopStart, const FileTags &fileTags) const { VGMHeader header{}; memcpy(header.magic, VGMHeader::VgmMagic, 4); @@ -200,7 +200,7 @@ mpt::IO::Write(f, header); bool wroteLoopStart = (header.loopNumSamples == 0); - CSoundFile::samplecount_t prevOffset = 0; + samplecount_t prevOffset = 0; for(const auto ® : m_registerDump) { if(reg.sampleOffset >= loopStart && !wroteLoopStart) @@ -284,7 +284,7 @@ return bytesWritten; } - static void WriteVGMDelay(std::ostream &f, CSoundFile::samplecount_t delay) + static void WriteVGMDelay(std::ostream &f, samplecount_t delay) { while(delay) { @@ -524,7 +524,7 @@ m_sndFile.m_opl = std::make_unique<OPL>(m_oplLogger); auto prevTime = timeGetTime(); - CSoundFile::samplecount_t loopStart = std::numeric_limits<CSoundFile::samplecount_t>::max(), subsongSamples = 0; + samplecount_t loopStart = std::numeric_limits<samplecount_t>::max(), subsongSamples = 0; while(!m_abort) { auto count = m_sndFile.ReadOneTick(); Modified: trunk/OpenMPT/mptrack/mod2midi.cpp ============================================================================== --- trunk/OpenMPT/mptrack/mod2midi.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/mptrack/mod2midi.cpp Thu May 30 22:54:12 2024 (r20868) @@ -71,9 +71,9 @@ std::ostringstream f; double m_tempo = 0.0; - double m_ticks = 0.0; // MIDI ticks since previous event - CSoundFile::samplecount_t m_samplePos = 0; // Current sample position - CSoundFile::samplecount_t m_prevEventTime = 0; // Sample position of previous event + double m_ticks = 0.0; // MIDI ticks since previous event + samplecount_t m_samplePos = 0; // Current sample position + samplecount_t m_prevEventTime = 0; // Sample position of previous event uint32 m_sampleRate; uint32 m_oldSigNumerator = 0; int32 m_oldGlobalVol = -1; Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/soundlib/Snd_defs.h Thu May 30 22:54:12 2024 (r20868) @@ -57,6 +57,8 @@ enum { FREQ_FRACBITS = 4 }; // Number of fractional bits in return value of CSoundFile::GetFreqFromPeriod() +using samplecount_t = uint32; // Number of rendered samples + // String lengths (including trailing null char) enum { Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/soundlib/Sndfile.h Thu May 30 22:54:12 2024 (r20868) @@ -457,8 +457,6 @@ BitCrush m_BitCrush; #endif - using samplecount_t = uint32; // Number of rendered samples - static constexpr uint32 TICKS_ROW_FINISHED = uint32_max - 1u; public: // for Editing Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Thu May 30 20:45:22 2024 (r20867) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Thu May 30 22:54:12 2024 (r20868) @@ -196,7 +196,7 @@ // Read one tick but skip all expensive rendering options -CSoundFile::samplecount_t CSoundFile::ReadOneTick() +samplecount_t CSoundFile::ReadOneTick() { const auto origMaxMixChannels = m_MixerSettings.m_nMaxMixChannels; m_MixerSettings.m_nMaxMixChannels = 0; @@ -216,7 +216,7 @@ } -CSoundFile::samplecount_t CSoundFile::Read(samplecount_t count, IAudioTarget &target, IAudioSource &source, std::optional<std::reference_wrapper<IMonitorOutput>> outputMonitor, std::optional<std::reference_wrapper<IMonitorInput>> inputMonitor) +samplecount_t CSoundFile::Read(samplecount_t count, IAudioTarget &target, IAudioSource &source, std::optional<std::reference_wrapper<IMonitorOutput>> outputMonitor, std::optional<std::reference_wrapper<IMonitorInput>> inputMonitor) { MPT_ASSERT_ALWAYS(m_MixerSettings.IsValid()); |
From: <sv...@op...> - 2024-05-30 18:45:34
|
Author: sagamusix Date: Thu May 30 20:45:22 2024 New Revision: 20867 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20867 Log: [Fix] ModCommand::GetEffectWeight did not contain a weight for CMD_CHANNELVOLSLIDE. Modified: trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/soundlib/modcommand.cpp ============================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp Wed May 29 20:46:26 2024 (r20866) +++ trunk/OpenMPT/soundlib/modcommand.cpp Thu May 30 20:45:22 2024 (r20867) @@ -1199,7 +1199,7 @@ CMD_TONEPORTAMENTO, CMD_TONEPORTAVOL, CMD_DBMECHO, - CMD_GLOBALVOLSLIDE, + CMD_CHANNELVOLSLIDE, CMD_CHANNELVOLUME, CMD_GLOBALVOLSLIDE, CMD_GLOBALVOLUME, @@ -1218,6 +1218,7 @@ } } // Invalid / unknown command. + MPT_ASSERT_NOTREACHED(); return 0; } |
From: <sv...@op...> - 2024-05-29 18:46:34
|
Author: sagamusix Date: Wed May 29 20:46:26 2024 New Revision: 20866 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20866 Log: [Ref] IT: Convert Schism Tracker quirks collection into an array. Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Tue May 28 18:26:15 2024 (r20865) +++ trunk/OpenMPT/soundlib/Load_it.cpp Wed May 29 20:46:26 2024 (r20866) @@ -1246,67 +1246,40 @@ break; case 1: madeWithTracker = GetSchismTrackerVersion(fileHeader.cwtv, fileHeader.reserved); - // Hertz in linear mode: Added 2015-01-29, https://github.com/schismtracker/schismtracker/commit/671b30311082a0e7df041fca25f989b5d2478f69 - if(schismDateVersion < SchismVersionFromDate<2015, 01, 29>::date && m_SongFlags[SONG_LINEARSLIDES]) - m_playBehaviour.reset(kPeriodsAreHertz); + { + static constexpr std::pair<int32, PlayBehaviour> SchismQuirks[] = + { + {SchismVersionFromDate<2015, 1, 29>::date, kPeriodsAreHertz }, // https://github.com/schismtracker/schismtracker/commit/671b30311082a0e7df041fca25f989b5d2478f69 + {SchismVersionFromDate<2016, 5, 13>::date, kITShortSampleRetrig }, // https://github.com/schismtracker/schismtracker/commit/e7b1461fe751554309fd403713c2a1ef322105ca + {SchismVersionFromDate<2021, 5, 2>::date, kITDoNotOverrideChannelPan }, // https://github.com/schismtracker/schismtracker/commit/a34ec86dc819915debc9e06f4727b77bf2dd29ee + {SchismVersionFromDate<2021, 5, 2>::date, kITPanningReset }, // https://github.com/schismtracker/schismtracker/commit/648f5116f984815c69e11d018b32dfec53c6b97a + {SchismVersionFromDate<2021, 11, 1>::date, kITPitchPanSeparation }, // https://github.com/schismtracker/schismtracker/commit/6e9f1207015cae0fe1b829fff7bb867e02ec6dea + {SchismVersionFromDate<2022, 4, 30>::date, kITEmptyNoteMapSlot }, // https://github.com/schismtracker/schismtracker/commit/1b2f7d5522fcb971f134a6664182ca569f7c8008 + {SchismVersionFromDate<2022, 4, 30>::date, kITPortamentoSwapResetsPos }, // https://github.com/schismtracker/schismtracker/commit/1b2f7d5522fcb971f134a6664182ca569f7c8008 + {SchismVersionFromDate<2022, 4, 30>::date, kITMultiSampleInstrumentNumber}, // https://github.com/schismtracker/schismtracker/commit/1b2f7d5522fcb971f134a6664182ca569f7c8008 + {SchismVersionFromDate<2023, 3, 9>::date, kITInitialNoteMemory }, // https://github.com/schismtracker/schismtracker/commit/73e9d60676c2b48c8e94e582373e29517105b2b1 + {SchismVersionFromDate<2023, 10, 17>::date, kITDCTBehaviour }, // https://github.com/schismtracker/schismtracker/commit/31d36dc00013fc5ab0efa20c782af18e8b006e07 + {SchismVersionFromDate<2023, 10, 19>::date, kITSampleAndHoldPanbrello }, // https://github.com/schismtracker/schismtracker/commit/411ec16b190ba1a486d8b0907ad8d74f8fdc2840 + {SchismVersionFromDate<2023, 10, 19>::date, kITPortaNoNote }, // https://github.com/schismtracker/schismtracker/commit/8ff0a86a715efb50c89770fb9095d4c4089ff187 + {SchismVersionFromDate<2023, 10, 22>::date, kITFirstTickHandling }, // https://github.com/schismtracker/schismtracker/commit/b9609e4f827e1b6ce9ebe6573b85e69388ca0ea0 + {SchismVersionFromDate<2023, 10, 22>::date, kITMultiSampleInstrumentNumber}, // https://github.com/schismtracker/schismtracker/commit/a9e5df533ab52c35190fcc1cbfed4f0347b660bb + {SchismVersionFromDate<2024, 3, 9>::date, kITPanbrelloHold }, // https://github.com/schismtracker/schismtracker/commit/ebdebaa8c8a735a7bf49df55debded1b7aac3605 + {SchismVersionFromDate<2024, 5, 12>::date, kITNoSustainOnPortamento }, // https://github.com/schismtracker/schismtracker/commit/6f68f2855a7e5e4ffe825869244e631e15741037 + {SchismVersionFromDate<2024, 5, 12>::date, kITEmptyNoteMapSlotIgnoreCell }, // https://github.com/schismtracker/schismtracker/commit/aa84148e019a65f3d52ecd33fd84bfecfdb87bf4 + {SchismVersionFromDate<2024, 5, 27>::date, kITOffsetWithInstrNumber }, // https://github.com/schismtracker/schismtracker/commit/9237960d45079a54ad73f87bacfe5dd8ae82e273 + }; + for(const auto &quirk : SchismQuirks) + { + if(schismDateVersion < quirk.first) + m_playBehaviour.reset(quirk.second); + } + } // Hertz in Amiga mode: Added 2021-05-02, https://github.com/schismtracker/schismtracker/commit/c656a6cbd5aaf81198a7580faf81cb7960cb6afa - else if(schismDateVersion < SchismVersionFromDate<2021, 05, 02>::date && !m_SongFlags[SONG_LINEARSLIDES]) + if(schismDateVersion < SchismVersionFromDate<2021, 05, 02>::date && !m_SongFlags[SONG_LINEARSLIDES]) m_playBehaviour.reset(kPeriodsAreHertz); - // Qxx with short samples: Added 2016-05-13, https://github.com/schismtracker/schismtracker/commit/e7b1461fe751554309fd403713c2a1ef322105ca - if(schismDateVersion < SchismVersionFromDate<2016, 05, 13>::date) - m_playBehaviour.reset(kITShortSampleRetrig); - // Instrument pan doesn't override channel pan: Added 2021-05-02, https://github.com/schismtracker/schismtracker/commit/a34ec86dc819915debc9e06f4727b77bf2dd29ee - if(schismDateVersion < SchismVersionFromDate<2021, 05, 02>::date) - m_playBehaviour.reset(kITDoNotOverrideChannelPan); - // Notes set instrument panning, not instrument numbers: Added 2021-05-02, https://github.com/schismtracker/schismtracker/commit/648f5116f984815c69e11d018b32dfec53c6b97a - if(schismDateVersion < SchismVersionFromDate<2021, 05, 02>::date) - m_playBehaviour.reset(kITPanningReset); // Imprecise calculation of ping-pong loop wraparound: Added 2021-11-01, https://github.com/schismtracker/schismtracker/commit/22cbb9b676e9c2c9feb7a6a17deca7a17ac138cc if(schismDateVersion < SchismVersionFromDate<2021, 11, 01>::date) m_playBehaviour.set(kImprecisePingPongLoops); - // Pitch/Pan Separation can be overridden by panning commands: Added 2021-11-01, https://github.com/schismtracker/schismtracker/commit/6e9f1207015cae0fe1b829fff7bb867e02ec6dea - if(schismDateVersion < SchismVersionFromDate<2021, 11, 01>::date) - m_playBehaviour.reset(kITPitchPanSeparation); - // Various fixes to multisampled instruments: Added 2022-04-30, https://github.com/schismtracker/schismtracker/commit/1b2f7d5522fcb971f134a6664182ca569f7c8008 - if(schismDateVersion < SchismVersionFromDate<2022, 04, 30>::date) - { - m_playBehaviour.reset(kITEmptyNoteMapSlot); - m_playBehaviour.reset(kITPortamentoSwapResetsPos); - m_playBehaviour.reset(kITMultiSampleInstrumentNumber); - } - // Initial note memory for channel is C-0: Added 2023-03-09, https://github.com/schismtracker/schismtracker/commit/73e9d60676c2b48c8e94e582373e29517105b2b1 - if(schismDateVersion < SchismVersionFromDate<2023, 03, 9>::date) - m_playBehaviour.reset(kITInitialNoteMemory); - // DCT note comparison: Added 2023-10-17, https://github.com/schismtracker/schismtracker/commit/31d36dc00013fc5ab0efa20c782af18e8b006e07 - if(schismDateVersion < SchismVersionFromDate<2023, 10, 17>::date) - m_playBehaviour.reset(kITDCTBehaviour); - if(schismDateVersion < SchismVersionFromDate<2023, 10, 19>::date) - { - // Panbrello sample & hold random waveform: Added 2023-10-19, https://github.com/schismtracker/schismtracker/commit/411ec16b190ba1a486d8b0907ad8d74f8fdc2840 - m_playBehaviour.reset(kITSampleAndHoldPanbrello); - // Don't apply any portamento if no previous note is playing: Added 2023-10-19, https://github.com/schismtracker/schismtracker/commit/8ff0a86a715efb50c89770fb9095d4c4089ff187 - m_playBehaviour.reset(kITPortaNoNote); - } - if(schismDateVersion < SchismVersionFromDate<2023, 10, 22>::date) - { - // Note delay delays first-tick behaviour for slides: Added 2023-10-22, https://github.com/schismtracker/schismtracker/commit/b9609e4f827e1b6ce9ebe6573b85e69388ca0ea0 - m_playBehaviour.reset(kITFirstTickHandling); - // https://github.com/schismtracker/schismtracker/commit/a9e5df533ab52c35190fcc1cbfed4f0347b660bb - m_playBehaviour.reset(kITMultiSampleInstrumentNumber); - } - // Panbrello hold: Added 2024-03-09, https://github.com/schismtracker/schismtracker/commit/ebdebaa8c8a735a7bf49df55debded1b7aac3605 - if(schismDateVersion < SchismVersionFromDate<2024, 03, 9>::date) - m_playBehaviour.reset(kITPanbrelloHold); - if(schismDateVersion < SchismVersionFromDate<2024, 05, 12>::date) - { - // Do not re-enable sustain loop on portamento-ed note: Added 2024-05-12, https://github.com/schismtracker/schismtracker/commit/6f68f2855a7e5e4ffe825869244e631e15741037 - m_playBehaviour.reset(kITNoSustainOnPortamento); - // Empty instrument sample map slot ignores complete pattern cell: Added 2024-05-12, https://github.com/schismtracker/schismtracker/commit/aa84148e019a65f3d52ecd33fd84bfecfdb87bf4 - m_playBehaviour.reset(kITEmptyNoteMapSlotIgnoreCell); - } - // Offset without note: Added 2024-05-27, https://github.com/schismtracker/schismtracker/commit/9237960d45079a54ad73f87bacfe5dd8ae82e273 - if(schismDateVersion < SchismVersionFromDate<2024, 05, 27>::date) - m_playBehaviour.reset(kITOffsetWithInstrNumber); break; case 4: madeWithTracker = MPT_UFORMAT("pyIT {}.{}")((fileHeader.cwtv & 0x0F00) >> 8, mpt::ufmt::hex0<2>(fileHeader.cwtv & 0xFF)); |
From: <sv...@op...> - 2024-05-28 17:10:21
|
Author: sagamusix Date: Sun May 26 22:42:37 2024 New Revision: 20859 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20859 Log: [Fix] Compile fix. Modified: branches/OpenMPT-1.30/soundlib/Load_med.cpp Modified: branches/OpenMPT-1.30/soundlib/Load_med.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_med.cpp Sun May 26 22:39:54 2024 (r20858) +++ branches/OpenMPT-1.30/soundlib/Load_med.cpp Sun May 26 22:42:37 2024 (r20859) @@ -2,7 +2,7 @@ * Load_med.cpp * ------------ * Purpose: OctaMED / MED Soundstudio module loader - * Notes : (currently none) + * Notes : Support for synthesized instruments is still missing. * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -474,7 +474,8 @@ } break; case 0x10: // MIDI message - m.SetEffectCommand(CMD_MIDI, 0x80 | param); + m.command = CMD_MIDI; + m.param |= 0x80; break; case 0x11: // Slide pitch up m.command = CMD_MODCMDEX; |
From: <sv...@op...> - 2024-05-28 17:10:16
|
Author: sagamusix Date: Sun May 26 00:31:50 2024 New Revision: 20851 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20851 Log: [Fix] Compile fix. Modified: trunk/OpenMPT/soundlib/ModChannel.h Modified: trunk/OpenMPT/soundlib/ModChannel.h ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h Sun May 26 00:27:30 2024 (r20850) +++ trunk/OpenMPT/soundlib/ModChannel.h Sun May 26 00:31:50 2024 (r20851) @@ -18,6 +18,8 @@ #include "Paula.h" #include "tuningbase.h" +#include <bitset> + OPENMPT_NAMESPACE_BEGIN class CSoundFile; |
From: <sv...@op...> - 2024-05-28 17:05:22
|
Author: sagamusix Date: Sun May 26 22:39:54 2024 New Revision: 20858 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20858 Log: Merged revision(s) 20846-20848 from trunk/OpenMPT: [Mod] MED: Don't seek to and read pattern name position if the length is 0 anyway. ........ [Fix] STP: Volume slide nibbles are not just swapped, but they are always both executed (so up and down are added together). [Ref] Cleanup STP loader. ........ [Fix] S3M: Don't update effect memory from cells without a command. This could happen after editing a pattern. ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/soundlib/Load_med.cpp branches/OpenMPT-1.29/soundlib/Load_stp.cpp branches/OpenMPT-1.29/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.29/soundlib/Load_med.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/Load_med.cpp Sun May 26 22:38:43 2024 (r20857) +++ branches/OpenMPT-1.29/soundlib/Load_med.cpp Sun May 26 22:39:54 2024 (r20858) @@ -97,7 +97,7 @@ { FLAG_FILTERON = 0x01, // The hardware audio filter is on FLAG_JUMPINGON = 0x02, // Mouse pointer jumping on - FLAG_JUMP8TH = 0x04, // ump every 8th line (not in OctaMED Pro) + FLAG_JUMP8TH = 0x04, // Jump every 8th line (not in OctaMED Pro) FLAG_INSTRSATT = 0x08, // sng+samples indicator (not useful in MMDs) FLAG_VOLHEX = 0x10, // volumes are HEX FLAG_STSLIDE = 0x20, // use ST/NT/PT compatible sliding @@ -1316,7 +1316,9 @@ file.Seek(patHeader.blockInfoOffset); MMDBlockInfo blockInfo; file.ReadStruct(blockInfo); - if(file.Seek(blockInfo.nameOffset)) + if(blockInfo.nameLength + && blockInfo.nameOffset + && file.Seek(blockInfo.nameOffset)) { // We have now chased four pointers to get this far... lovely format. file.ReadString<mpt::String::maybeNullTerminated>(patName, blockInfo.nameLength); Modified: branches/OpenMPT-1.29/soundlib/Load_stp.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/Load_stp.cpp Sun May 26 22:38:43 2024 (r20857) +++ branches/OpenMPT-1.29/soundlib/Load_stp.cpp Sun May 26 22:39:54 2024 (r20858) @@ -441,18 +441,16 @@ const auto [instr, note, command, param] = file.ReadArray<uint8, 4>(); m.instr = instr; - m.note = note; m.param = param; - - if(m.note) + if(note) { - m.note += 24 + NOTE_MIN; + m.note = NOTE_MIDDLEC - 36 + note; chnMem = ChannelMemory(); } - // this is a nibble-swapped param value used for auto fine volside - // and auto global fine volside - uint8 swapped = (m.param >> 4) | (m.param << 4); + // Volume slides not only have their nibbles swapped, but the up and down parameters also add up + const int totalSlide = -static_cast<int>(m.param >> 4) + (m.param & 0x0F); + const uint8 slideParam = static_cast<uint8>((totalSlide > 0) ? totalSlide << 4 : -totalSlide); if((command & 0xF0) == 0xF0) { @@ -462,138 +460,93 @@ { m.param = mpt::saturate_round<ModCommand::PARAM>(ConvertTempo(ciaTempo).ToDouble()); m.command = CMD_TEMPO; - } else - { - m.command = CMD_NONE; } } else switch(command) { case 0x00: // arpeggio if(m.param) m.command = CMD_ARPEGGIO; - else - m.command = CMD_NONE; break; - case 0x01: // portamento up m.command = CMD_PORTAMENTOUP; break; - case 0x02: // portamento down m.command = CMD_PORTAMENTODOWN; break; - case 0x03: // auto fine portamento up chnMem.autoFinePorta = 0x10 | std::min(m.param, ModCommand::PARAM(15)); chnMem.autoPortaUp = 0; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x04: // auto fine portamento down chnMem.autoFinePorta = 0x20 | std::min(m.param, ModCommand::PARAM(15)); chnMem.autoPortaUp = 0; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x05: // auto portamento up chnMem.autoFinePorta = 0; chnMem.autoPortaUp = m.param; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x06: // auto portamento down chnMem.autoFinePorta = 0; chnMem.autoPortaUp = 0; chnMem.autoPortaDown = m.param; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x07: // set global volume m.command = CMD_GLOBALVOLUME; globalVolSlide = 0; break; - case 0x08: // auto global fine volume slide - globalVolSlide = swapped; - m.command = CMD_NONE; + globalVolSlide = slideParam; break; - case 0x09: // fine portamento up m.command = CMD_MODCMDEX; m.param = 0x10 | std::min(m.param, ModCommand::PARAM(15)); break; - case 0x0A: // fine portamento down m.command = CMD_MODCMDEX; m.param = 0x20 | std::min(m.param, ModCommand::PARAM(15)); break; - case 0x0B: // auto fine volume slide - chnMem.autoVolSlide = swapped; - m.command = CMD_NONE; + chnMem.autoVolSlide = slideParam; break; - case 0x0C: // set volume m.volcmd = VOLCMD_VOLUME; m.vol = m.param; chnMem.autoVolSlide = 0; - m.command = CMD_NONE; break; - case 0x0D: // volume slide (param is swapped compared to .mod) - if(m.param & 0xF0) - { - m.volcmd = VOLCMD_VOLSLIDEDOWN; - m.vol = m.param >> 4; - } else if(m.param & 0x0F) - { - m.volcmd = VOLCMD_VOLSLIDEUP; - m.vol = m.param & 0xF; - } + if(totalSlide < 0) + m.SetVolumeCommand(VOLCMD_VOLSLIDEDOWN, slideParam & 0x0F); + else if(totalSlide > 0) + m.SetVolumeCommand(VOLCMD_VOLSLIDEUP, slideParam >> 4); chnMem.autoVolSlide = 0; - m.command = CMD_NONE; break; - case 0x0E: // set filter (also uses opposite value compared to .mod) - m.command = CMD_MODCMDEX; - m.param = 1 ^ (m.param ? 1 : 0); + m.SetEffectCommand(CMD_MODCMDEX, 1 ^ (m.param ? 1 : 0)); break; - case 0x0F: // set speed - m.command = CMD_SPEED; speedFrac = m.param & 0x0F; - m.param >>= 4; + m.SetEffectCommand(CMD_SPEED, m.param >> 4); break; - case 0x10: // auto vibrato chnMem.autoVibrato = m.param; chnMem.vibratoMem = 0; - m.command = CMD_NONE; break; - case 0x11: // auto tremolo if(m.param & 0xF) chnMem.autoTremolo = m.param; else chnMem.autoTremolo = 0; - m.command = CMD_NONE; break; - case 0x12: // pattern break m.command = CMD_PATTERNBREAK; break; - case 0x13: // auto tone portamento chnMem.autoFinePorta = 0; chnMem.autoPortaUp = 0; @@ -601,13 +554,10 @@ chnMem.autoTonePorta = m.param; chnMem.tonePortaMem = 0; - m.command = CMD_NONE; break; - case 0x14: // position jump m.command = CMD_POSITIONJUMP; break; - case 0x16: // start loop sequence if(m.instr && m.instr <= loopInfo.size()) { @@ -620,10 +570,7 @@ m.vol = m.param; } } - - m.command = CMD_NONE; break; - case 0x17: // play only loop nn if(m.instr && m.instr <= loopInfo.size()) { @@ -637,10 +584,7 @@ m.instr = static_cast<ModCommand::INSTR>(loopList[m.param].looped); } } - - m.command = CMD_NONE; break; - case 0x18: // play sequence without loop if(m.instr && m.instr <= loopInfo.size()) { @@ -657,10 +601,7 @@ nonLooped[m.instr - 1] = ++m_nSamples; m.instr = static_cast<ModCommand::INSTR>(nonLooped[m.instr - 1]); } - - m.command = CMD_NONE; break; - case 0x19: // play only loop nn without loop if(m.instr && m.instr <= loopInfo.size()) { @@ -674,54 +615,37 @@ m.instr = static_cast<ModCommand::INSTR>(loopList[m.param].nonLooped); } } - - m.command = CMD_NONE; break; - case 0x1D: // fine volume slide (nibble order also swapped) - m.command = CMD_VOLUMESLIDE; - m.param = swapped; - if(m.param & 0xF0) // slide down - m.param |= 0x0F; - else if(m.param & 0x0F) - m.param |= 0xF0; + if(totalSlide < 0) // slide down + m.SetEffectCommand(CMD_MODCMDEX, 0xB0 | (slideParam & 0x0F)); + else if(totalSlide > 0) + m.SetEffectCommand(CMD_MODCMDEX, 0xA0 | (slideParam >> 4)); break; - case 0x20: // "delayed fade" // just behave like either a normal fade or a notecut // depending on the speed if(m.param & 0xF0) { chnMem.autoVolSlide = m.param >> 4; - m.command = CMD_NONE; } else { - m.command = CMD_MODCMDEX; - m.param = 0xC0 | (m.param & 0xF); + m.SetEffectCommand(CMD_MODCMDEX, 0xC0 | (m.param & 0xF)); } break; - case 0x21: // note delay - m.command = CMD_MODCMDEX; - m.param = 0xD0 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0xD0 | std::min(m.param, ModCommand::PARAM(15))); break; - case 0x22: // retrigger note - m.command = CMD_MODCMDEX; - m.param = 0x90 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0x90 | std::min(m.param, ModCommand::PARAM(15))); break; - case 0x49: // set sample offset m.command = CMD_OFFSET; break; - case 0x4E: // other protracker commands (pattern loop / delay) if((m.param & 0xF0) == 0x60 || (m.param & 0xF0) == 0xE0) m.command = CMD_MODCMDEX; - else - m.command = CMD_NONE; break; - case 0x4F: // set speed/tempo if(m.param < 0x20) { @@ -732,9 +656,7 @@ m.command = CMD_TEMPO; } break; - default: - m.command = CMD_NONE; break; } Modified: branches/OpenMPT-1.29/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.29/soundlib/Snd_fx.cpp Sun May 26 22:38:43 2024 (r20857) +++ branches/OpenMPT-1.29/soundlib/Snd_fx.cpp Sun May 26 22:39:54 2024 (r20858) @@ -976,7 +976,7 @@ break; } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && command != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, param); } @@ -3607,7 +3607,7 @@ #endif // NO_PLUGINS } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && cmd != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, static_cast<ModCommand::PARAM>(param)); } |
From: <sv...@op...> - 2024-05-28 17:05:21
|
Author: sagamusix Date: Sun May 26 22:38:43 2024 New Revision: 20857 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20857 Log: Merged revision(s) 20854 from trunk/OpenMPT: [Fix] MDL: Slide depth broke when introducing Hertz instead of periods in non-linear mode. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/Load_dtm.cpp branches/OpenMPT-1.30/soundlib/Load_mdl.cpp branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.30/soundlib/Load_dtm.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_dtm.cpp Sun May 26 22:38:23 2024 (r20856) +++ branches/OpenMPT-1.30/soundlib/Load_dtm.cpp Sun May 26 22:38:43 2024 (r20857) @@ -231,6 +231,7 @@ InitializeGlobals(MOD_TYPE_DTM); InitializeChannels(); m_SongFlags.set(SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS); + m_playBehaviour.reset(kPeriodsAreHertz); m_playBehaviour.reset(kITVibratoTremoloPanbrello); // Various files have a default speed or tempo of 0 if(fileHeader.tempo) Modified: branches/OpenMPT-1.30/soundlib/Load_mdl.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_mdl.cpp Sun May 26 22:38:23 2024 (r20856) +++ branches/OpenMPT-1.30/soundlib/Load_mdl.cpp Sun May 26 22:38:43 2024 (r20857) @@ -491,6 +491,7 @@ m_SongFlags = SONG_ITCOMPATGXX; m_playBehaviour.set(kPerChannelGlobalVolSlide); m_playBehaviour.set(kApplyOffsetWithoutNote); + m_playBehaviour.reset(kPeriodsAreHertz); m_playBehaviour.reset(kITVibratoTremoloPanbrello); m_playBehaviour.reset(kITSCxStopsSample); // Gate effect in underbeat.mdl Modified: branches/OpenMPT-1.30/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sun May 26 22:38:23 2024 (r20856) +++ branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sun May 26 22:38:43 2024 (r20857) @@ -5993,6 +5993,7 @@ if(GetType() & (MOD_TYPE_MDL | MOD_TYPE_DTM)) { // MDL uses non-linear slides, but their effectiveness does not depend on the middle-C frequency. + MPT_ASSERT(!PeriodsAreFrequencies()); return (FreqS3MTable[note % 12u] << 4) >> (note / 12); } if(!nC5Speed) @@ -6111,6 +6112,7 @@ return (period + c5speed - 8363) << FREQ_FRACBITS; } else if(GetType() & (MOD_TYPE_MDL | MOD_TYPE_DTM)) { + MPT_ASSERT(!PeriodsAreFrequencies()); LimitMax(period, Util::MaxValueOfType(period) >> 8); if (!c5speed) c5speed = 8363; return Util::muldiv_unsigned(c5speed, (1712L << 7) << FREQ_FRACBITS, (period << 8) + nPeriodFrac); |
From: <sv...@op...> - 2024-05-28 17:05:19
|
Author: sagamusix Date: Sun May 26 00:27:30 2024 New Revision: 20850 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20850 Log: [New] Better support for automatic slide commands in various formats (https://bugs.openmpt.org/view.php?id=1773). [Mod] OpenMPT: Version is now 1.32.00.14 Modified: trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_gmc.cpp trunk/OpenMPT/soundlib/Load_stk.cpp trunk/OpenMPT/soundlib/Load_stp.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/Load_xmf.cpp trunk/OpenMPT/soundlib/ModChannel.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/modcommand.cpp trunk/OpenMPT/soundlib/modcommand.h Modified: trunk/OpenMPT/common/versionNumber.h ============================================================================== --- trunk/OpenMPT/common/versionNumber.h Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/common/versionNumber.h Sun May 26 00:27:30 2024 (r20850) @@ -18,6 +18,6 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 32 #define VER_MINOR 00 -#define VER_MINORMINOR 13 +#define VER_MINORMINOR 14 OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/mptrack/EffectInfo.cpp ============================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/mptrack/EffectInfo.cpp Sun May 26 00:27:30 2024 (r20850) @@ -128,6 +128,11 @@ {CMD_VOLUME8, 0, 0, 0, MOD_TYPE_NONE, _T("Set 8-bit Volume")}, {CMD_HMN_MEGA_ARP, 0, 0, 0, MOD_TYPE_NONE, _T("His Master's Noise Mega-Arpeggio")}, {CMD_MED_SYNTH_JUMP, 0, 0, 0, MOD_TYPE_NONE, _T("MED Synth Jump / MIDI Panning")}, + {CMD_AUTO_VOLUMESLIDE, 0, 0, 0, MOD_TYPE_NONE, _T("Automatic Volume Slide")}, + {CMD_AUTO_PORTAUP, 0, 0, 0, MOD_TYPE_NONE, _T("Automatic Portamento Up")}, + {CMD_AUTO_PORTADOWN, 0, 0, 0, MOD_TYPE_NONE, _T("Automatic Portamento Down")}, + {CMD_AUTO_PORTAUP_FINE, 0, 0, 0, MOD_TYPE_NONE, _T("Automatic Fine Portamento Up")}, + {CMD_AUTO_PORTADOWN_FINE, 0, 0, 0, MOD_TYPE_NONE, _T("Automatic Fine Portamento Down")}, }; @@ -944,21 +949,21 @@ static constexpr MPTVolCmdInfo gVolCmdInfo[] = { - {VOLCMD_VOLUME, MOD_TYPE_NOMOD, _T("Set Volume")}, - {VOLCMD_PANNING, MOD_TYPE_NOMOD, _T("Set Panning")}, - {VOLCMD_VOLSLIDEUP, MOD_TYPE_XMITMPT, _T("Volume slide up")}, - {VOLCMD_VOLSLIDEDOWN, MOD_TYPE_XMITMPT, _T("Volume slide down")}, - {VOLCMD_FINEVOLUP, MOD_TYPE_XMITMPT, _T("Fine volume up")}, - {VOLCMD_FINEVOLDOWN, MOD_TYPE_XMITMPT, _T("Fine volume down")}, - {VOLCMD_VIBRATOSPEED, MOD_TYPE_XM, _T("Vibrato speed")}, - {VOLCMD_VIBRATODEPTH, MOD_TYPE_XMITMPT, _T("Vibrato depth")}, - {VOLCMD_PANSLIDELEFT, MOD_TYPE_XM, _T("Pan slide left")}, - {VOLCMD_PANSLIDERIGHT, MOD_TYPE_XM, _T("Pan slide right")}, - {VOLCMD_TONEPORTAMENTO, MOD_TYPE_XMITMPT, _T("Tone portamento")}, - {VOLCMD_PORTAUP, MOD_TYPE_ITMPT, _T("Portamento up")}, - {VOLCMD_PORTADOWN, MOD_TYPE_ITMPT, _T("Portamento down")}, - {VOLCMD_PLAYCONTROL, MOD_TYPE_NONE, _T("Play Control")}, - {VOLCMD_OFFSET, MOD_TYPE_MPT, _T("Sample Cue")}, + {VOLCMD_VOLUME, MOD_TYPE_NOMOD, _T("Set Volume")}, + {VOLCMD_PANNING, MOD_TYPE_NOMOD, _T("Set Panning")}, + {VOLCMD_VOLSLIDEUP, MOD_TYPE_XMITMPT, _T("Volume slide up")}, + {VOLCMD_VOLSLIDEDOWN, MOD_TYPE_XMITMPT, _T("Volume slide down")}, + {VOLCMD_FINEVOLUP, MOD_TYPE_XMITMPT, _T("Fine volume up")}, + {VOLCMD_FINEVOLDOWN, MOD_TYPE_XMITMPT, _T("Fine volume down")}, + {VOLCMD_VIBRATOSPEED, MOD_TYPE_XM, _T("Vibrato speed")}, + {VOLCMD_VIBRATODEPTH, MOD_TYPE_XMITMPT, _T("Vibrato depth")}, + {VOLCMD_PANSLIDELEFT, MOD_TYPE_XM, _T("Pan slide left")}, + {VOLCMD_PANSLIDERIGHT, MOD_TYPE_XM, _T("Pan slide right")}, + {VOLCMD_TONEPORTAMENTO, MOD_TYPE_XMITMPT, _T("Tone portamento")}, + {VOLCMD_PORTAUP, MOD_TYPE_ITMPT, _T("Portamento up")}, + {VOLCMD_PORTADOWN, MOD_TYPE_ITMPT, _T("Portamento down")}, + {VOLCMD_PLAYCONTROL, MOD_TYPE_NONE, _T("Play Control")}, + {VOLCMD_OFFSET, MOD_TYPE_MPT, _T("Sample Cue")}, }; static_assert(mpt::array_size<decltype(gVolCmdInfo)>::size == (MAX_VOLCMDS - 1)); Modified: trunk/OpenMPT/soundlib/Load_669.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_669.cpp Sun May 26 00:27:30 2024 (r20850) @@ -142,7 +142,7 @@ Order().SetDefaultSpeed(4); m_nChannels = 8; m_playBehaviour.set(kPeriodsAreHertz); - m_SongFlags.set(SONG_FASTPORTAS); + m_SongFlags.set(SONG_FASTPORTAS | SONG_AUTO_TONEPORTA); #ifdef MODPLUG_TRACKER // 669 uses frequencies rather than periods, so linear slides mode will sound better in the higher octaves. //m_SongFlags.set(SONG_LINEARSLIDES); @@ -195,8 +195,8 @@ static constexpr ModCommand::COMMAND effTrans[] = { - CMD_PORTAMENTOUP, // Slide up (param * 80) Hz on every tick - CMD_PORTAMENTODOWN, // Slide down (param * 80) Hz on every tick + CMD_AUTO_PORTAUP, // Slide up (param * 80) Hz on every tick + CMD_AUTO_PORTADOWN, // Slide down (param * 80) Hz on every tick CMD_TONEPORTAMENTO, // Slide to note by (param * 40) Hz on every tick CMD_S3MCMDEX, // Add (param * 80) Hz to sample frequency CMD_VIBRATO, // Add (param * 669) Hz on every other tick Modified: trunk/OpenMPT/soundlib/Load_far.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_far.cpp Sun May 26 00:27:30 2024 (r20850) @@ -168,7 +168,7 @@ Order().SetDefaultSpeed(fileHeader.defaultSpeed); Order().SetDefaultTempoInt(80); m_nDefaultGlobalVolume = MAX_GLOBAL_VOLUME; - m_SongFlags = SONG_LINEARSLIDES; + m_SongFlags = SONG_LINEARSLIDES | SONG_AUTO_TONEPORTA; m_playBehaviour.set(kPeriodsAreHertz); m_modFormat.formatName = U_("Farandole Composer"); @@ -244,12 +244,9 @@ ROWINDEX breakRow = patternChunk.ReadUint8(); patternChunk.Skip(1); if(breakRow > 0 && breakRow < numRows - 2) - { breakRow++; - } else - { + else breakRow = ROWINDEX_INVALID; - } // Read pattern data for(ROWINDEX row = 0; row < numRows; row++) @@ -277,24 +274,25 @@ case 0x02: m.param |= 0xF0; break; - case 0x03: // Porta to note (TODO: Parameter is number of rows the portamento should take) - m.param <<= 2; + case 0x03: // Porta to note (TODO: Parameter is number of rows the portamento should take) + if(m.param != 0) + m.param = 60 / m.param; break; - case 0x04: // Retrig - m.param = static_cast<ModCommand::PARAM>(6 / (1 + (m.param & 0xf)) + 1); // ugh? + case 0x04: // Retrig + m.param = static_cast<ModCommand::PARAM>(6 / (1 + (m.param & 0xf)) + 1); break; - case 0x06: // Vibrato speed - case 0x07: // Volume slide up + case 0x06: // Vibrato speed + case 0x07: // Volume slide up m.param *= 8; break; - case 0x0A: // Volume-portamento (what!) + case 0x0A: // Volume-portamento (what!) m.volcmd = VOLCMD_VOLUME; m.vol = static_cast<ModCommand::VOL>((m.param << 2) + 4); break; - case 0x0B: // Panning + case 0x0B: // Panning m.param |= 0x80; break; - case 0x0C: // Note offset + case 0x0C: // Note offset m.param = static_cast<ModCommand::PARAM>(6 / (1 + m.param) + 1); m.param |= 0x0D; } Modified: trunk/OpenMPT/soundlib/Load_gmc.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_gmc.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_gmc.cpp Sun May 26 00:27:30 2024 (r20850) @@ -152,7 +152,6 @@ continue; } - std::array<uint8, 4> portaOn = {0, 0, 0, 0}; for(ROWINDEX row = 0; row < 64; row++) { auto rowBase = Patterns[pat].GetRow(row); @@ -175,7 +174,6 @@ break; case 0x01: // Portamento up case 0x02: // Portamento down - portaOn[chn] = (param != 0) ? command : 0; break; case 0x03: // Volume command = 0x0C; @@ -207,16 +205,11 @@ ConvertModCommand(m, command, param); if(noteCut) m.note = NOTE_NOTECUT; - if(command != 1 && command != 2) - { - if(m.note != NOTE_NONE) - portaOn[chn] = 0; - else if(portaOn[chn] == 1) - m.volcmd = VOLCMD_PORTAUP; - else if(portaOn[chn] == 2) - m.volcmd = VOLCMD_PORTADOWN; - } - if(m.command == CMD_TEMPO) + if(m.command == CMD_PORTAMENTOUP) + m.command = CMD_AUTO_PORTAUP; + else if(m.command == CMD_PORTAMENTODOWN) + m.command = CMD_AUTO_PORTADOWN; + else if(m.command == CMD_TEMPO) m.command = CMD_SPEED; } } Modified: trunk/OpenMPT/soundlib/Load_stk.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stk.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_stk.cpp Sun May 26 00:27:30 2024 (r20850) @@ -228,7 +228,7 @@ m_nMinPeriod = 113 * 4; m_nMaxPeriod = 856 * 4; m_nSamplePreAmp = 64; - m_SongFlags.set(SONG_PT_MODE); + m_SongFlags.set(SONG_PT_MODE | SONG_AUTO_VOLSLIDE_STK); m_songName = mpt::String::ReadBuf(mpt::String::spacePadded, fileHeaders.songname); // Setup channel pan positions and volume @@ -359,7 +359,6 @@ continue; } - uint8 autoSlide[4] = {0, 0, 0, 0}; for(ROWINDEX row = 0; row < 64; row++) { auto rowBase = Patterns[pat].GetRow(row); @@ -368,24 +367,8 @@ ModCommand &m = rowBase[chn]; auto [command, param] = ReadMODPatternEntry(patternData[row][chn], m); - if(!param || command == 0x0E) - { - autoSlide[chn] = 0; - } if(command || param) { - if(autoSlide[chn] != 0) - { - if(autoSlide[chn] & 0xF0) - { - m.volcmd = VOLCMD_VOLSLIDEUP; - m.vol = autoSlide[chn] >> 4; - } else - { - m.volcmd = VOLCMD_VOLSLIDEDOWN; - m.vol = autoSlide[chn] & 0x0F; - } - } if(command == 0x0D) { if(minVersion != ST2_00) @@ -402,9 +385,9 @@ param &= 0x7F; } else if(command == 0x0E && (param > 0x01 || minVersion < ST_IX) && useAutoSlides) { - // Import auto-slides as normal slides and fake them using volume column slides. - command = 0x0A; - autoSlide[chn] = param; + m.command = CMD_AUTO_VOLUMESLIDE; + m.param = param; + continue; } else if(command == 0x0F) { // Only the low nibble is evaluated in Soundtracker. @@ -449,9 +432,6 @@ { ConvertModCommand(m, command, param); } - } else - { - autoSlide[chn] = 0; } } } Modified: trunk/OpenMPT/soundlib/Load_stp.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stp.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_stp.cpp Sun May 26 00:27:30 2024 (r20850) @@ -262,6 +262,7 @@ m_nChannels = 4; m_nSamples = 0; + m_SongFlags.set(SONG_AUTO_TONEPORTA | SONG_AUTO_GLOBALVOL | SONG_AUTO_VIBRATO | SONG_AUTO_TREMOLO); Order().SetDefaultSpeed(fileHeader.speed); Order().SetDefaultTempo(ConvertTempo(fileHeader.timerCount)); @@ -383,15 +384,7 @@ file.Seek(patOffset); } - struct ChannelMemory - { - uint8 autoFinePorta, autoPortaUp, autoPortaDown, autoVolSlide, autoVibrato; - uint8 vibratoMem, autoTremolo, autoTonePorta, tonePortaMem; - }; - std::vector<ChannelMemory> channelMemory(m_nChannels); - uint8 globalVolSlide = 0; uint8 speedFrac = static_cast<uint8>(fileHeader.speedFrac); - for(uint16 pat = 0; pat < numPatterns; pat++) { PATTERNINDEX actualPat = pat; @@ -419,8 +412,6 @@ { auto rowBase = Patterns[actualPat].GetRow(row); - bool didGlobalVolSlide = false; - // if a fractional speed value is in use then determine if we should stick a fine pattern delay somewhere bool shouldDelay; switch(speedFrac & 3) @@ -436,17 +427,13 @@ for(CHANNELINDEX chn = 0; chn < channels; chn++) { - ChannelMemory &chnMem = channelMemory[chn]; ModCommand &m = rowBase[chn]; const auto [instr, note, command, param] = file.ReadArray<uint8, 4>(); m.instr = instr; m.param = param; if(note) - { m.note = NOTE_MIDDLEC - 36 + note; - chnMem = ChannelMemory(); - } // Volume slides not only have their nibbles swapped, but the up and down parameters also add up const int totalSlide = -static_cast<int>(m.param >> 4) + (m.param & 0x0F); @@ -458,8 +445,7 @@ uint16 ciaTempo = (static_cast<uint16>(command & 0x0F) << 8) | m.param; if(ciaTempo) { - m.param = mpt::saturate_round<ModCommand::PARAM>(ConvertTempo(ciaTempo).ToDouble()); - m.command = CMD_TEMPO; + m.SetEffectCommand(CMD_TEMPO, mpt::saturate_round<ModCommand::PARAM>(ConvertTempo(ciaTempo).ToDouble())); } } else switch(command) { @@ -468,64 +454,51 @@ m.command = CMD_ARPEGGIO; break; case 0x01: // portamento up - m.command = CMD_PORTAMENTOUP; + if(m.param) + m.command = CMD_PORTAMENTOUP; break; case 0x02: // portamento down - m.command = CMD_PORTAMENTODOWN; + if(m.param) + m.command = CMD_PORTAMENTODOWN; break; case 0x03: // auto fine portamento up - chnMem.autoFinePorta = 0x10 | std::min(m.param, ModCommand::PARAM(15)); - chnMem.autoPortaUp = 0; - chnMem.autoPortaDown = 0; - chnMem.autoTonePorta = 0; + m.command = CMD_AUTO_PORTAUP_FINE; break; case 0x04: // auto fine portamento down - chnMem.autoFinePorta = 0x20 | std::min(m.param, ModCommand::PARAM(15)); - chnMem.autoPortaUp = 0; - chnMem.autoPortaDown = 0; - chnMem.autoTonePorta = 0; + m.command = CMD_AUTO_PORTADOWN_FINE; break; case 0x05: // auto portamento up - chnMem.autoFinePorta = 0; - chnMem.autoPortaUp = m.param; - chnMem.autoPortaDown = 0; - chnMem.autoTonePorta = 0; + m.command = CMD_AUTO_PORTAUP; break; case 0x06: // auto portamento down - chnMem.autoFinePorta = 0; - chnMem.autoPortaUp = 0; - chnMem.autoPortaDown = m.param; - chnMem.autoTonePorta = 0; + m.command = CMD_AUTO_PORTADOWN; break; case 0x07: // set global volume m.command = CMD_GLOBALVOLUME; - globalVolSlide = 0; break; case 0x08: // auto global fine volume slide - globalVolSlide = slideParam; + if(totalSlide < 0) + m.SetEffectCommand(CMD_GLOBALVOLSLIDE, 0xF0 | slideParam); + else if(totalSlide > 0) + m.SetEffectCommand(CMD_GLOBALVOLSLIDE, slideParam | 0x0F); break; case 0x09: // fine portamento up - m.command = CMD_MODCMDEX; - m.param = 0x10 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0x10 | std::min(m.param, ModCommand::PARAM(15))); break; case 0x0A: // fine portamento down - m.command = CMD_MODCMDEX; - m.param = 0x20 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0x20 | std::min(m.param, ModCommand::PARAM(15))); break; case 0x0B: // auto fine volume slide - chnMem.autoVolSlide = slideParam; + m.SetEffectCommand(CMD_AUTO_VOLUMESLIDE, slideParam); break; case 0x0C: // set volume - m.volcmd = VOLCMD_VOLUME; - m.vol = m.param; - chnMem.autoVolSlide = 0; + m.SetVolumeCommand(VOLCMD_VOLUME, std::min(m.param, ModCommand::PARAM(64))); break; case 0x0D: // volume slide (param is swapped compared to .mod) if(totalSlide < 0) m.SetVolumeCommand(VOLCMD_VOLSLIDEDOWN, slideParam & 0x0F); else if(totalSlide > 0) m.SetVolumeCommand(VOLCMD_VOLSLIDEUP, slideParam >> 4); - chnMem.autoVolSlide = 0; break; case 0x0E: // set filter (also uses opposite value compared to .mod) m.SetEffectCommand(CMD_MODCMDEX, 1 ^ (m.param ? 1 : 0)); @@ -535,25 +508,16 @@ m.SetEffectCommand(CMD_SPEED, m.param >> 4); break; case 0x10: // auto vibrato - chnMem.autoVibrato = m.param; - chnMem.vibratoMem = 0; + m.command = CMD_VIBRATO; break; case 0x11: // auto tremolo - if(m.param & 0xF) - chnMem.autoTremolo = m.param; - else - chnMem.autoTremolo = 0; + m.command = CMD_TREMOLO; break; case 0x12: // pattern break m.command = CMD_PATTERNBREAK; break; case 0x13: // auto tone portamento - chnMem.autoFinePorta = 0; - chnMem.autoPortaUp = 0; - chnMem.autoPortaDown = 0; - chnMem.autoTonePorta = m.param; - - chnMem.tonePortaMem = 0; + m.command = CMD_TONEPORTAMENTO; break; case 0x14: // position jump m.command = CMD_POSITIONJUMP; @@ -561,13 +525,11 @@ case 0x16: // start loop sequence if(m.instr && m.instr <= loopInfo.size()) { - STPLoopList &loopList = loopInfo[m.instr - 1]; - + const STPLoopList &loopList = loopInfo[m.instr - 1]; m.param--; if(m.param < std::min(std::size(ModSample().cues), loopList.size())) { - m.volcmd = VOLCMD_OFFSET; - m.vol = m.param; + m.SetVolumeCommand(VOLCMD_OFFSET, m.param); } } break; @@ -575,7 +537,6 @@ if(m.instr && m.instr <= loopInfo.size()) { STPLoopList &loopList = loopInfo[m.instr - 1]; - m.param--; if(m.param < loopList.size()) { @@ -588,13 +549,11 @@ case 0x18: // play sequence without loop if(m.instr && m.instr <= loopInfo.size()) { - STPLoopList &loopList = loopInfo[m.instr - 1]; - + const STPLoopList &loopList = loopInfo[m.instr - 1]; m.param--; if(m.param < std::min(std::size(ModSample().cues), loopList.size())) { - m.volcmd = VOLCMD_OFFSET; - m.vol = m.param; + m.SetVolumeCommand(VOLCMD_OFFSET, m.param); } // switch to non-looped version of sample and create it if needed if(!nonLooped[m.instr - 1] && CanAddMoreSamples()) @@ -606,7 +565,6 @@ if(m.instr && m.instr <= loopInfo.size()) { STPLoopList &loopList = loopInfo[m.instr - 1]; - m.param--; if(m.param < loopList.size()) { @@ -617,7 +575,7 @@ } break; case 0x1D: // fine volume slide (nibble order also swapped) - if(totalSlide < 0) // slide down + if(totalSlide < 0) // slide down m.SetEffectCommand(CMD_MODCMDEX, 0xB0 | (slideParam & 0x0F)); else if(totalSlide > 0) m.SetEffectCommand(CMD_MODCMDEX, 0xA0 | (slideParam >> 4)); @@ -626,12 +584,9 @@ // just behave like either a normal fade or a notecut // depending on the speed if(m.param & 0xF0) - { - chnMem.autoVolSlide = m.param >> 4; - } else - { - m.SetEffectCommand(CMD_MODCMDEX, 0xC0 | (m.param & 0xF)); - } + m.SetEffectCommand(CMD_AUTO_VOLUMESLIDE, m.param >> 4); + else + m.SetEffectCommand(CMD_MODCMDEX, 0xC0 | (m.param & 0x0F)); break; case 0x21: // note delay m.SetEffectCommand(CMD_MODCMDEX, 0xD0 | std::min(m.param, ModCommand::PARAM(15))); @@ -660,90 +615,16 @@ break; } - bool didVolSlide = false; - - // try to put volume slide in volume command - if(chnMem.autoVolSlide && m.volcmd == VOLCMD_NONE) - { - if(chnMem.autoVolSlide & 0xF0) - { - m.volcmd = VOLCMD_FINEVOLUP; - m.vol = chnMem.autoVolSlide >> 4; - } else - { - m.volcmd = VOLCMD_FINEVOLDOWN; - m.vol = chnMem.autoVolSlide & 0xF; - } - didVolSlide = true; - } - // try to place/combine all remaining running effects. - if(m.command == CMD_NONE) + if(shouldDelay && m.command == CMD_NONE) { - if(chnMem.autoPortaUp) - { - m.command = CMD_PORTAMENTOUP; - m.param = chnMem.autoPortaUp; - - } else if(chnMem.autoPortaDown) - { - m.command = CMD_PORTAMENTODOWN; - m.param = chnMem.autoPortaDown; - } else if(chnMem.autoFinePorta) - { - m.command = CMD_MODCMDEX; - m.param = chnMem.autoFinePorta; - - } else if(chnMem.autoTonePorta) - { - m.command = CMD_TONEPORTAMENTO; - m.param = chnMem.tonePortaMem = chnMem.autoTonePorta; - - } else if(chnMem.autoVibrato) - { - m.command = CMD_VIBRATO; - m.param = chnMem.vibratoMem = chnMem.autoVibrato; - - } else if(!didVolSlide && chnMem.autoVolSlide) - { - m.command = CMD_VOLUMESLIDE; - m.param = chnMem.autoVolSlide; - // convert to a "fine" value by setting the other nibble to 0xF - if(m.param & 0x0F) - m.param |= 0xF0; - else if(m.param & 0xF0) - m.param |= 0x0F; - didVolSlide = true; - MPT_UNUSED(didVolSlide); - - } else if(chnMem.autoTremolo) - { - m.command = CMD_TREMOLO; - m.param = chnMem.autoTremolo; - - } else if(shouldDelay) - { - // insert a fine pattern delay here - m.command = CMD_S3MCMDEX; - m.param = 0x61; - shouldDelay = false; - - } else if(!didGlobalVolSlide && globalVolSlide) - { - m.command = CMD_GLOBALVOLSLIDE; - m.param = globalVolSlide; - // convert to a "fine" value by setting the other nibble to 0xF - if(m.param & 0x0F) - m.param |= 0xF0; - else if(m.param & 0xF0) - m.param |= 0x0F; - - didGlobalVolSlide = true; - } + // insert a fine pattern delay here + m.SetEffectCommand(CMD_S3MCMDEX, 0x61); + shouldDelay = false; } } - // TODO: create/use extra channels for global volslide/delay if needed + // TODO: create/use extra channels for delay if needed? } } @@ -797,13 +678,9 @@ { // make duplicate samples for this individual section if needed if(info.looped) - { ConvertLoopSlice(Samples[smp], Samples[info.looped], info.loopStart, info.loopLength, true); - } if(info.nonLooped) - { ConvertLoopSlice(Samples[smp], Samples[info.nonLooped], info.loopStart, info.loopLength, false); - } } } } Modified: trunk/OpenMPT/soundlib/Load_ult.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_ult.cpp Sun May 26 00:27:30 2024 (r20850) @@ -197,7 +197,7 @@ } -static int ReadULTEvent(ModCommand &m, FileReader &file, uint8 version) +static uint8 ReadULTEvent(ModCommand &m, FileReader &file, uint8 version) { uint8 repeat = 1; uint8 b = file.ReadUint8(); @@ -263,75 +263,6 @@ } -// Functor for postfixing ULT patterns (this is easier than just remembering everything WHILE we're reading the pattern events) -struct PostFixUltCommands -{ - PostFixUltCommands(CHANNELINDEX channels) : numChannels{channels} - { - isPortaActive.resize(channels, false); - } - - void operator()(ModCommand &m) - { - // Attempt to fix portamentos. - // UltraTracker will slide until the destination note is reached or 300 is encountered. - - // Stop porta? - if(m.command == CMD_TONEPORTAMENTO && m.param == 0) - { - isPortaActive[curChannel] = false; - m.command = CMD_NONE; - } - if(m.volcmd == VOLCMD_TONEPORTAMENTO && m.vol == 0) - { - isPortaActive[curChannel] = false; - m.volcmd = VOLCMD_NONE; - } - - // Apply porta? - if(m.note == NOTE_NONE && isPortaActive[curChannel]) - { - if(m.command == CMD_NONE && m.volcmd != VOLCMD_TONEPORTAMENTO) - { - m.command = CMD_TONEPORTAMENTO; - m.param = 0; - } else if(m.volcmd == VOLCMD_NONE && m.command != CMD_TONEPORTAMENTO) - { - m.volcmd = VOLCMD_TONEPORTAMENTO; - m.vol = 0; - } - } else // new note -> stop porta (or initialize again) - { - isPortaActive[curChannel] = (m.command == CMD_TONEPORTAMENTO || m.volcmd == VOLCMD_TONEPORTAMENTO); - } - - // attempt to fix F00 (reset to tempo 125, speed 6) - if(writeT125 && m.command == CMD_NONE) - { - m.command = CMD_TEMPO; - m.param = 125; - } - if(m.command == CMD_SPEED && m.param == 0) - { - m.param = 6; - writeT125 = true; - } - if(m.command == CMD_TEMPO) // don't try to fix this anymore if the tempo has already changed. - { - writeT125 = false; - } - curChannel++; - if(curChannel >= numChannels) - curChannel = 0; - } - - std::vector<bool> isPortaActive; - const CHANNELINDEX numChannels; - CHANNELINDEX curChannel = 0; - bool writeT125 = false; -}; - - static bool ValidateHeader(const UltFileHeader &fileHeader) { if(fileHeader.version < '1' || fileHeader.version > '4' @@ -351,13 +282,9 @@ { UltFileHeader fileHeader; if(!file.ReadStruct(fileHeader)) - { return ProbeWantMoreData; - } if(!ValidateHeader(fileHeader)) - { return ProbeFailure; - } return ProbeAdditionalSize(file, pfilesize, GetHeaderMinimumAdditionalSize(fileHeader)); } @@ -368,21 +295,13 @@ UltFileHeader fileHeader; if(!file.ReadStruct(fileHeader)) - { return false; - } if(!ValidateHeader(fileHeader)) - { return false; - } if(loadFlags == onlyVerifyHeader) - { return true; - } if(!file.CanRead(mpt::saturate_cast<FileReader::pos_type>(GetHeaderMinimumAdditionalSize(fileHeader)))) - { return false; - } InitializeGlobals(MOD_TYPE_ULT); m_songName = mpt::String::ReadBuf(mpt::String::spacePadded, fileHeader.songName); @@ -393,7 +312,7 @@ m_modFormat.madeWithTracker = U_("UltraTracker ") + versions[fileHeader.version - '1']; m_modFormat.charset = mpt::Charset::CP437; - m_SongFlags = SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS; // this will be converted to IT format by MPT. + m_SongFlags = SONG_AUTO_TONEPORTA | SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS; // this will be converted to IT format by MPT. // Read "messageLength" lines, each containing 32 characters. m_songMessage.ReadFixedLineLength(file, fileHeader.messageLength * 32, 32, 0); @@ -447,6 +366,7 @@ return false; } + bool postFixSpeedCommands = false; for(CHANNELINDEX chn = 0; chn < m_nChannels; chn++) { ModCommand evnote; @@ -461,6 +381,8 @@ repeat = 64 - row; if(repeat == 0) break; + if(evnote.command == CMD_SPEED && evnote.param == 0) + postFixSpeedCommands = true; while(repeat--) { *note = evnote; @@ -470,10 +392,24 @@ } } } - - // Post-fix some effects. - Patterns.ForEachModCommand(PostFixUltCommands(GetNumChannels())); - + if(postFixSpeedCommands) + { + for(CPattern &pat : Patterns) + { + for(ROWINDEX row = 0; row < pat.GetNumRows(); row++) + { + for(auto &m : pat.GetRow(row)) + { + if(m.command == CMD_SPEED && m.param == 0) + { + m.param = 6; + pat.WriteEffect(EffectWriter(CMD_TEMPO, 125).Row(row).RetryNextRow()); + } + } + } + } + } + if(loadFlags & loadSampleData) { for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) Modified: trunk/OpenMPT/soundlib/Load_xmf.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_xmf.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Load_xmf.cpp Sun May 26 00:27:30 2024 (r20850) @@ -166,6 +166,7 @@ InitializeGlobals(MOD_TYPE_MOD); m_SongFlags.set(SONG_IMPORTED); m_SongFlags.reset(SONG_ISAMIGA); + m_SongFlags.set(SONG_AUTO_TONEPORTA, type < 4); m_nSamples = numSamples; m_nSamplePreAmp = (type == 3) ? 192 : 48; // Imperium Galactica files are really quiet, no other XMFs appear to use type 3 Modified: trunk/OpenMPT/soundlib/ModChannel.cpp ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/ModChannel.cpp Sun May 26 00:27:30 2024 (r20850) @@ -34,6 +34,7 @@ nFadeOutVol = 0; dwFlags.set(CHN_KEYOFF | CHN_NOTEFADE); dwOldFlags.reset(); + autoSlide.Reset(); nnaGeneration = 0; //IT compatibility 15. Retrigger if(sndFile.m_playBehaviour[kITRetrigger]) Modified: trunk/OpenMPT/soundlib/ModChannel.h ============================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/ModChannel.h Sun May 26 00:27:30 2024 (r20850) @@ -41,6 +41,23 @@ } }; + struct AutoSlideStatus + { + bool AnyActive() const noexcept { return m_set.any(); } + bool IsActive(AutoSlideCommand cmd) const noexcept { return m_set[static_cast<size_t>(cmd)]; } + void SetActive(AutoSlideCommand cmd, bool active = true) noexcept { m_set[static_cast<size_t>(cmd)] = active; } + void Reset() noexcept { m_set.reset(); } + + bool AnyPitchSlideActive() const noexcept + { + return IsActive(AutoSlideCommand::TonePortamento) + || IsActive(AutoSlideCommand::PortamentoUp) || IsActive(AutoSlideCommand::PortamentoDown) + || IsActive(AutoSlideCommand::FinePortamentoUp) || IsActive(AutoSlideCommand::FinePortamentoDown); + } + private: + std::bitset<static_cast<size_t>(AutoSlideCommand::NumCommands)> m_set; + }; + // Information used in the mixer (should be kept tight for better caching) SamplePosition position; // Current play position (fixed point) SamplePosition increment; // Sample speed relative to mixing frequency (fixed point) @@ -84,6 +101,7 @@ int32 nAutoVibDepth; uint32 nEFxOffset; // Offset memory for Invert Loop (EFx, .MOD only) ROWINDEX nPatternLoop; + AutoSlideStatus autoSlide; uint16 portamentoSlide; int16 nTranspose; int16 nFineTune; @@ -146,8 +164,6 @@ uint16 m_RowPlugParam; PLUGINDEX m_RowPlug; - void ClearRowCmd() { rowCommand = ModCommand(); } - // Get a reference to a specific envelope of this channel const EnvInfo &GetEnvelope(EnvelopeType envType) const { Modified: trunk/OpenMPT/soundlib/Snd_defs.h ============================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Snd_defs.h Sun May 26 00:27:30 2024 (r20850) @@ -118,6 +118,23 @@ }; +enum class AutoSlideCommand +{ + TonePortamento, + PortamentoUp, + PortamentoDown, + FinePortamentoUp, + FinePortamentoDown, + FineVolumeSlideUp, + FineVolumeSlideDown, + VolumeSlideSTK, + GlobalVolumeSlide, + Vibrato, + Tremolo, + NumCommands +}; + + // Module channel / sample flags enum ChannelFlags : uint32 { @@ -262,18 +279,23 @@ // Module flags - contains both song configuration and playback state... Use SONG_FILE_FLAGS and SONG_PLAY_FLAGS distinguish between the two. enum SongFlags { - SONG_FASTPORTAS = 0x01, // Portamentos are executed on every tick - SONG_FASTVOLSLIDES = 0x02, // Old Scream Tracker 3.0 volume slides (executed on every tick) - SONG_ITOLDEFFECTS = 0x04, // Old Impulse Tracker effect implementations - SONG_ITCOMPATGXX = 0x08, // IT "Compatible Gxx" (IT's flag to behave more like other trackers w/r/t portamento effects) - SONG_LINEARSLIDES = 0x10, // Linear slides vs. Amiga slides - SONG_EXFILTERRANGE = 0x20, // Cutoff Filter has double frequency range (up to ~10Khz) - SONG_AMIGALIMITS = 0x40, // Enforce amiga frequency limits - SONG_S3MOLDVIBRATO = 0x80, // ScreamTracker 2 vibrato in S3M files - SONG_PT_MODE = 0x100, // ProTracker 1/2 playback mode - SONG_ISAMIGA = 0x200, // Is an Amiga module and thus qualifies to be played using the Paula BLEP resampler - SONG_IMPORTED = 0x400, // Song type does not represent actual module format / was imported from a different format (OpenMPT) - SONG_PLAYALLSONGS = 0x800, // Play all subsongs consecutively (libopenmpt) + SONG_FASTPORTAS = 0x01, // Portamentos are executed on every tick + SONG_FASTVOLSLIDES = 0x02, // Old Scream Tracker 3.0 volume slides (executed on every tick) + SONG_ITOLDEFFECTS = 0x04, // Old Impulse Tracker effect implementations + SONG_ITCOMPATGXX = 0x08, // IT "Compatible Gxx" (IT's flag to behave more like other trackers w/r/t portamento effects) + SONG_LINEARSLIDES = 0x10, // Linear slides vs. Amiga slides + SONG_EXFILTERRANGE = 0x20, // Cutoff Filter has double frequency range (up to ~10Khz) + SONG_AMIGALIMITS = 0x40, // Enforce amiga frequency limits + SONG_S3MOLDVIBRATO = 0x80, // ScreamTracker 2 vibrato in S3M files + SONG_PT_MODE = 0x100, // ProTracker 1/2 playback mode + SONG_ISAMIGA = 0x200, // Is an Amiga module and thus qualifies to be played using the Paula BLEP resampler + SONG_IMPORTED = 0x400, // Song type does not represent actual module format / was imported from a different format (OpenMPT) + SONG_PLAYALLSONGS = 0x800, // Play all subsongs consecutively (libopenmpt) + SONG_AUTO_TONEPORTA = 0x1000, // Tone portamento command is continued automatically + SONG_AUTO_GLOBALVOL = 0x2000, // Global volume slide command is continued automatically + SONG_AUTO_VIBRATO = 0x4000, // Vibrato command is continued automatically + SONG_AUTO_TREMOLO = 0x8000, // Tremolo command is continued automatically + SONG_AUTO_VOLSLIDE_STK = 0x1'0000, // Automatic volume slide command is interpreted like in STK files (rather than like in STP files) }; DECLARE_FLAGSET(SongFlags) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sun May 26 00:27:30 2024 (r20850) @@ -183,6 +183,17 @@ break; } + if(chn.autoSlide.IsActive(AutoSlideCommand::TonePortamento) && !chn.rowCommand.IsTonePortamento()) + sndFile.TonePortamento(*state, channel, chn.portamentoSlide); + if(chn.autoSlide.IsActive(AutoSlideCommand::PortamentoUp)) + sndFile.PortamentoUp(*state, channel, chn.nOldPortaUp, true); + else if(chn.autoSlide.IsActive(AutoSlideCommand::PortamentoDown)) + sndFile.PortamentoDown(*state, channel, chn.nOldPortaDown, true); + else if(chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoUp)) + sndFile.FinePortamentoUp(chn, chn.nOldFinePortaUpDown); + else if(chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoDown)) + sndFile.FinePortamentoDown(chn, chn.nOldFinePortaUpDown); + updateInc = true; } @@ -274,6 +285,43 @@ } chnSettings[channel].ticksToRender = 0; } + + void GlobalVolSlide(ModChannel &chn, ModCommand::PARAM param, uint32 nonRowTicks) + { + if(sndFile.m_SongFlags[SONG_AUTO_GLOBALVOL]) + chn.autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, param != 0); + if(param) + chn.nOldGlobalVolSlide = param; + else + param = chn.nOldGlobalVolSlide; + + if((param & 0x0F) == 0x0F && (param & 0xF0)) + { + param >>= 4; + if(!(sndFile.GetType() & GLOBALVOL_7BIT_FORMATS)) + param <<= 1; + state->m_nGlobalVolume += param << 1; + } else if((param & 0xF0) == 0xF0 && (param & 0x0F)) + { + param = (param & 0x0F) << 1; + if(!(sndFile.GetType() & GLOBALVOL_7BIT_FORMATS)) + param <<= 1; + state->m_nGlobalVolume -= param; + } else if(param & 0xF0) + { + param >>= 4; + param <<= 1; + if(!(sndFile.GetType() & GLOBALVOL_7BIT_FORMATS)) + param <<= 1; + state->m_nGlobalVolume += param * nonRowTicks; + } else + { + param = (param & 0x0F) << 1; + if(!(sndFile.GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1; + state->m_nGlobalVolume -= param * nonRowTicks; + } + Limit(state->m_nGlobalVolume, 0, 256); + } }; @@ -326,7 +374,7 @@ for(CHANNELINDEX i = 0; i < GetNumChannels(); i++, m++) { if(m->note == NOTE_NOTECUT || m->note == NOTE_KEYOFF || (m->note == NOTE_FADE && GetNumInstruments()) - || (m->IsNote() && m->instr && !m->IsPortamento())) + || (m->IsNote() && m->instr && !m->IsTonePortamento())) { memory.chnSettings[i].ticksToRender = GetLengthMemory::IGNORE_CHANNEL; } @@ -597,13 +645,13 @@ for(CHANNELINDEX nChn = 0; nChn < GetNumChannels(); nChn++) { ModChannel &chn = playState.Chn[nChn]; - if(chn.rowCommand.IsEmpty()) + if(chn.rowCommand.IsEmpty() && !chn.autoSlide.AnyActive()) continue; ModCommand::COMMAND command = chn.rowCommand.command; ModCommand::PARAM param = chn.rowCommand.param; ModCommand::NOTE note = chn.rowCommand.note; - if(adjustMode & eAdjust) + if((adjustMode & eAdjust) && !chn.rowCommand.IsEmpty()) { if(chn.rowCommand.instr) { @@ -627,6 +675,9 @@ if(instr->IsResonanceEnabled()) chn.nResonance = instr->GetResonance(); } + const bool wasGlobalSlideRunning = chn.autoSlide.IsActive(AutoSlideCommand::GlobalVolumeSlide); + chn.autoSlide.Reset(); + chn.autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, wasGlobalSlideRunning); } } @@ -754,6 +805,9 @@ // The following calculations are not interesting if we just want to get the song length. if(!(adjustMode & eAdjust)) continue; + + ResetAutoSlides(chn); + switch(command) { // Portamento Up/Down @@ -791,6 +845,9 @@ case CMD_TONEPORTAVOL: if (param) chn.nOldVolumeSlide = param; break; + case CMD_AUTO_VOLUMESLIDE: + AutoVolumeSlide(chn, param); + break; // Set Volume case CMD_VOLUME: memory.chnSettings[nChn].vol = param; @@ -809,40 +866,11 @@ { playState.m_nGlobalVolume = 256; } + playState.Chn[m_playBehaviour[kPerChannelGlobalVolSlide] ? nChn : 0].autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, false); break; // Global Volume Slide case CMD_GLOBALVOLSLIDE: - if(m_playBehaviour[kPerChannelGlobalVolSlide]) - { - // IT compatibility 16. Global volume slide params are stored per channel (FT2/IT) - if (param) chn.nOldGlobalVolSlide = param; else param = chn.nOldGlobalVolSlide; - } else - { - if (param) playState.Chn[0].nOldGlobalVolSlide = param; else param = playState.Chn[0].nOldGlobalVolSlide; - } - if (((param & 0x0F) == 0x0F) && (param & 0xF0)) - { - param >>= 4; - if (!(GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1; - playState.m_nGlobalVolume += param << 1; - } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) - { - param = (param & 0x0F) << 1; - if (!(GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1; - playState.m_nGlobalVolume -= param; - } else if (param & 0xF0) - { - param >>= 4; - param <<= 1; - if (!(GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1; - playState.m_nGlobalVolume += param * nonRowTicks; - } else - { - param = (param & 0x0F) << 1; - if (!(GetType() & GLOBALVOL_7BIT_FORMATS)) param <<= 1; - playState.m_nGlobalVolume -= param * nonRowTicks; - } - Limit(playState.m_nGlobalVolume, 0, 256); + memory.GlobalVolSlide(playState.Chn[m_playBehaviour[kPerChannelGlobalVolSlide] ? nChn : 0], param, nonRowTicks); break; case CMD_CHANNELVOLUME: if (param <= 64) chn.nGlobalVol = param; @@ -930,6 +958,9 @@ break; case CMD_PANBRELLO: Panbrello(chn, param); + // Panbrello effect is permanent in compatible mode, so actually apply panbrello for the last tick of this row + chn.nPanbrelloPos += static_cast<uint8>(chn.nPanbrelloSpeed * nonRowTicks); + ProcessPanbrello(chn); break; case CMD_MIDI: @@ -965,39 +996,36 @@ break; } - // Process vibrato / tremolo / panbrello - switch(chn.rowCommand.command) + chn.isFirstTick = true; + if(chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideUp) && command != CMD_AUTO_VOLUMESLIDE) + FineVolumeUp(chn, 0, false); + if(chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideDown) && command != CMD_AUTO_VOLUMESLIDE) + FineVolumeDown(chn, 0, false); + if(chn.autoSlide.IsActive(AutoSlideCommand::VolumeSlideSTK)) { - case CMD_VIBRATO: - case CMD_FINEVIBRATO: - case CMD_VIBRATOVOL: + for(uint32 i = 0; i < numTicks; i++) { - uint32 vibTicks = ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && !m_SongFlags[SONG_ITOLDEFFECTS]) ? numTicks : nonRowTicks; - uint32 inc = chn.nVibratoSpeed * vibTicks; - if(m_playBehaviour[kITVibratoTremoloPanbrello]) - inc *= 4; - chn.nVibratoPos += static_cast<uint8>(inc); - } - break; - - case CMD_TREMOLO: - { - uint32 tremTicks = ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && !m_SongFlags[SONG_ITOLDEFFECTS]) ? numTicks : nonRowTicks; - uint32 inc = chn.nTremoloSpeed * tremTicks; - if(m_playBehaviour[kITVibratoTremoloPanbrello]) - inc *= 4; - chn.nTremoloPos += static_cast<uint8>(inc); + chn.isFirstTick = (i == 0); + VolumeSlide(chn, 0); } - break; - - case CMD_PANBRELLO: - // Panbrello effect is permanent in compatible mode, so actually apply panbrello for the last tick of this row - chn.nPanbrelloPos += static_cast<uint8>(chn.nPanbrelloSpeed * nonRowTicks); - ProcessPanbrello(chn); - break; - - default: - break; + } + if(chn.autoSlide.IsActive(AutoSlideCommand::GlobalVolumeSlide) && command != CMD_GLOBALVOLSLIDE) + memory.GlobalVolSlide(chn, chn.nOldGlobalVolSlide, nonRowTicks); + if(command == CMD_VIBRATO || command == CMD_FINEVIBRATO || command == CMD_VIBRATOVOL || chn.autoSlide.IsActive(AutoSlideCommand::Vibrato)) + { + uint32 vibTicks = ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && !m_SongFlags[SONG_ITOLDEFFECTS]) ? numTicks : nonRowTicks; + uint32 inc = chn.nVibratoSpeed * vibTicks; + if(m_playBehaviour[kITVibratoTremoloPanbrello]) + inc *= 4; + chn.nVibratoPos += static_cast<uint8>(inc); + } + if(command == CMD_TREMOLO || chn.autoSlide.IsActive(AutoSlideCommand::Tremolo)) + { + uint32 tremTicks = ((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && !m_SongFlags[SONG_ITOLDEFFECTS]) ? numTicks : nonRowTicks; + uint32 inc = chn.nTremoloSpeed * tremTicks; + if(m_playBehaviour[kITVibratoTremoloPanbrello]) + inc *= 4; + chn.nTremoloPos += static_cast<uint8>(inc); } if(m_playBehaviour[kST3EffectMemory] && command != CMD_NONE && param != 0) @@ -1040,7 +1068,7 @@ uint32 paramHi = m.param >> 4, paramLo = m.param & 0x0F; uint32 startTick = 0; - const bool porta = m.IsPortamento(); + const bool porta = m.IsTonePortamento(); bool stopNote = false; if(m.instr) chn.prevNoteOffset = 0; @@ -1206,6 +1234,25 @@ memory.RenderChannel(nChn, oldTickDuration); // Re-sync what we've got so far chn.microTuning = CalculateFinetuneTarget(playState.m_nPattern, playState.m_nRow, nChn); // TODO should render each tick individually for CMD_FINETUNE_SMOOTH for higher sync accuracy break; + + // Auto portamentos + case CMD_AUTO_PORTAUP: + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoUp, m.param != 0); + chn.nOldPortaUp = m.param; + break; + case CMD_AUTO_PORTADOWN: + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoDown, m.param != 0); + chn.nOldPortaDown = m.param; + break; + case CMD_AUTO_PORTAUP_FINE: + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoUp, m.param != 0); + chn.nOldFinePortaUpDown = m.param; + break; + case CMD_AUTO_PORTADOWN_FINE: + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoDown, m.param != 0); + chn.nOldFinePortaUpDown = m.param; + break; + default: break; } @@ -1245,7 +1292,8 @@ if(chn.isPaused) continue; - if(m.IsAnyPitchSlide()) + + if(m.IsAnyPitchSlide() || chn.autoSlide.AnyPitchSlideActive()) { // Portamento needs immediate syncing, as the pitch changes on each tick uint32 portaTick = memory.chnSettings[nChn].ticksToRender + startTick; @@ -2107,6 +2155,9 @@ { chn.paulaState.Reset(); } + const bool wasGlobalSlideRunning = chn.autoSlide.IsActive(AutoSlideCommand::GlobalVolumeSlide); + chn.autoSlide.Reset(); + chn.autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, wasGlobalSlideRunning); } @@ -2482,7 +2533,7 @@ uint32 vol = chn.rowCommand.vol; ModCommand::COMMAND cmd = chn.rowCommand.command; uint32 param = chn.rowCommand.param; - bool bPorta = chn.rowCommand.IsPortamento(); + bool bPorta = chn.rowCommand.IsTonePortamento(); uint32 nStartTick = 0; chn.isFirstTick = m_PlayState.m_flags[SONG_FIRSTTICK]; @@ -3038,6 +3089,8 @@ if(m_playBehaviour[kST3NoMutedChannels] && ChnSettings[nChn].dwFlags[CHN_MUTE]) // not even effects are processed on muted S3M channels continue; + ResetAutoSlides(chn); + // Volume Column Effect (except volume & panning) /* A few notes, paraphrased from ITTECH.TXT by Storlek (creator of schismtracker): Ex/Fx/Gx are shared with Exx/Fxx/Gxx; Ex/Fx are 4x the 'normal' slide value @@ -3221,6 +3274,24 @@ PortamentoDown(nChn, static_cast<ModCommand::PARAM>(param), false); break; + // Auto portamentos + case CMD_AUTO_PORTAUP: + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoUp, param != 0); + chn.nOldPortaUp = static_cast<uint8>(param); + break; + case CMD_AUTO_PORTADOWN: + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoDown, param != 0); + chn.nOldPortaDown = static_cast<uint8>(param); + break; + case CMD_AUTO_PORTAUP_FINE: + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoUp, param != 0); + chn.nOldFinePortaUpDown = static_cast<uint8>(param); + break; + case CMD_AUTO_PORTADOWN_FINE: + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoDown, param != 0); + chn.nOldFinePortaUpDown = static_cast<uint8>(param); + break; + // Volume Slide case CMD_VOLUMESLIDE: if (param || (GetType() != MOD_TYPE_MOD)) VolumeSlide(chn, static_cast<ModCommand::PARAM>(param)); @@ -3393,15 +3464,13 @@ { m_PlayState.m_nGlobalVolume = 256; } + m_PlayState.Chn[m_playBehaviour[kPerChannelGlobalVolSlide] ? nChn : 0].autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, false); break; // Global Volume Slide case CMD_GLOBALVOLSLIDE: //IT compatibility 16. Saving last global volume slide param per channel (FT2/IT) - if(m_playBehaviour[kPerChannelGlobalVolSlide]) - GlobalVolSlide(static_cast<ModCommand::PARAM>(param), chn.nOldGlobalVolSlide); - else - GlobalVolSlide(static_cast<ModCommand::PARAM>(param), m_PlayState.Chn[0].nOldGlobalVolSlide); + GlobalVolSlide(m_PlayState, static_cast<ModCommand::PARAM>(param), m_playBehaviour[kPerChannelGlobalVolSlide] ? nChn : 0); break; // Set 8-bit Panning @@ -3610,6 +3679,10 @@ DigiBoosterSampleReverse(chn, static_cast<ModCommand::PARAM>(param)); break; + case CMD_AUTO_VOLUMESLIDE: + AutoVolumeSlide(chn, static_cast<ModCommand::PARAM>(param)); + break; + default: break; } @@ -3625,6 +3698,7 @@ chn.nOldIns = chn.rowCommand.instr; } + ProcessAutoSlides(m_PlayState, nChn); } // for(...) end // Navigation Effects @@ -3710,6 +3784,70 @@ // Channels effects +void CSoundFile::ResetAutoSlides(ModChannel &chn) const +{ + const auto cmd = chn.rowCommand.command; + const auto volcmd = chn.rowCommand.volcmd; + if(cmd != CMD_NONE && GetType() == MOD_TYPE_669) + { + chn.autoSlide.Reset(); + return; + } + + if(cmd == CMD_NONE && chn.autoSlide.IsActive(AutoSlideCommand::VolumeSlideSTK)) + chn.autoSlide.SetActive(AutoSlideCommand::VolumeSlideSTK, false); + + if(chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoDown) || chn.autoSlide.IsActive(AutoSlideCommand::PortamentoDown) + || chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoUp) || chn.autoSlide.IsActive(AutoSlideCommand::PortamentoUp)) + { + if(!chn.rowCommand.IsTonePortamento() && chn.rowCommand.IsAnyPitchSlide()) + { + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoDown, false); + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoDown, false); + chn.autoSlide.SetActive(AutoSlideCommand::FinePortamentoUp, false); + chn.autoSlide.SetActive(AutoSlideCommand::PortamentoUp, false); + } + } + if(chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideUp) || chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideDown)) + { + if(cmd == CMD_VOLUME || cmd == CMD_AUTO_VOLUMESLIDE || chn.rowCommand.IsNormalVolumeSlide() + || volcmd == VOLCMD_VOLUME || volcmd == VOLCMD_VOLSLIDEUP || volcmd == VOLCMD_VOLSLIDEDOWN || volcmd == VOLCMD_FINEVOLUP || volcmd == VOLCMD_FINEVOLDOWN) + { + chn.autoSlide.SetActive(AutoSlideCommand::FineVolumeSlideUp, false); + chn.autoSlide.SetActive(AutoSlideCommand::FineVolumeSlideDown, false); + } + } +} + + +void CSoundFile::ProcessAutoSlides(PlayState &playState, CHANNELINDEX channel) +{ + ModChannel &chn = playState.Chn[channel]; + if(chn.autoSlide.IsActive(AutoSlideCommand::TonePortamento) && !chn.rowCommand.IsTonePortamento()) + TonePortamento(channel, chn.portamentoSlide); + if(chn.autoSlide.IsActive(AutoSlideCommand::PortamentoUp)) + PortamentoUp(channel, chn.nOldPortaUp, true); + else if(chn.autoSlide.IsActive(AutoSlideCommand::PortamentoDown)) + PortamentoDown(channel, chn.nOldPortaDown, true); + else if(chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoUp)) + FinePortamentoUp(chn, chn.nOldFinePortaUpDown); + else if(chn.autoSlide.IsActive(AutoSlideCommand::FinePortamentoDown)) + FinePortamentoDown(chn, chn.nOldFinePortaUpDown); + if(chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideUp) && chn.rowCommand.command != CMD_AUTO_VOLUMESLIDE) + FineVolumeUp(chn, 0, false); + if(chn.autoSlide.IsActive(AutoSlideCommand::FineVolumeSlideDown) && chn.rowCommand.command != CMD_AUTO_VOLUMESLIDE) + FineVolumeDown(chn, 0, false); + if(chn.autoSlide.IsActive(AutoSlideCommand::VolumeSlideSTK)) + VolumeSlide(chn, 0); + if(chn.autoSlide.IsActive(AutoSlideCommand::GlobalVolumeSlide) && chn.rowCommand.command != CMD_GLOBALVOLSLIDE) + GlobalVolSlide(playState, chn.nOldGlobalVolSlide, channel); + if(chn.autoSlide.IsActive(AutoSlideCommand::Vibrato)) + chn.dwFlags.set(CHN_VIBRATO); + if(chn.autoSlide.IsActive(AutoSlideCommand::Tremolo)) + chn.dwFlags.set(CHN_TREMOLO); +} + + // Update the effect memory of all S3M effects that use the last non-zero effect parameter as memory (Dxy, Exx, Fxx, Ixy, Jxy, Kxy, Lxy, Qxy, Rxy, Sxy) // Test case: ParamMemory.s3m void CSoundFile::UpdateS3MEffectMemory(ModChannel &chn, ModCommand::PARAM param) const @@ -4227,6 +4365,8 @@ { ModChannel &chn = playState.Chn[nChn]; chn.dwFlags.set(CHN_PORTAMENTO); + if(m_SongFlags[SONG_AUTO_TONEPORTA]) + chn.autoSlide.SetActive(AutoSlideCommand::TonePortamento, param != 0); //IT compatibility 03: Share effect memory with portamento up/down if((!m_SongFlags[SONG_ITCOMPATGXX] && m_playBehaviour[kITPortaMemoryShare]) || GetType() == MOD_TYPE_PLM) @@ -4331,7 +4471,10 @@ { if (param & 0x0F) chn.nVibratoDepth = (param & 0x0F) * 4; if (param & 0xF0) chn.nVibratoSpeed = (param >> 4) & 0x0F; - chn.dwFlags.set(CHN_VIBRATO); + if(m_SongFlags[SONG_AUTO_VIBRATO]) + chn.autoSlide.SetActive(AutoSlideCommand::Vibrato, param != 0); + else + chn.dwFlags.set(CHN_VIBRATO); } @@ -4339,7 +4482,10 @@ { if (param & 0x0F) chn.nVibratoDepth = param & 0x0F; if (param & 0xF0) chn.nVibratoSpeed = (param >> 4) & 0x0F; - chn.dwFlags.set(CHN_VIBRATO); + if(m_SongFlags[SONG_AUTO_VIBRATO]) + chn.autoSlide.SetActive(AutoSlideCommand::Vibrato, param != 0); + else + chn.dwFlags.set(CHN_VIBRATO); // ST3 compatibility: Do not distinguish between vibrato types in effect memory // Test case: VibratoTypeChange.s3m if(m_playBehaviour[kST3VibratoMemory] && (param & 0x0F)) @@ -4408,6 +4554,27 @@ } +void CSoundFile::AutoVolumeSlide(ModChannel &chn, ModCommand::PARAM param) const +{ + if(m_SongFlags[SONG_AUTO_VOLSLIDE_STK]) + { + chn.nOldVolumeSlide = param; + chn.autoSlide.SetActive(AutoSlideCommand::VolumeSlideSTK); + } else + { + if(param & 0x0F) + { + FineVolumeDown(chn, param, false); + chn.autoSlide.SetActive(AutoSlideCommand::FineVolumeSlideDown); + } else + { + FineVolumeUp(chn, param, false); + chn.autoSlide.SetActive(AutoSlideCommand::FineVolumeSlideUp); + } + } +} + + void CSoundFile::VolumeSlide(ModChannel &chn, ModCommand::PARAM param) const { if (param) @@ -4610,7 +4777,10 @@ { if (param & 0x0F) chn.nTremoloDepth = (param & 0x0F) << 2; if (param & 0xF0) chn.nTremoloSpeed = (param >> 4) & 0x0F; - chn.dwFlags.set(CHN_TREMOLO); + if(m_SongFlags[SONG_AUTO_TREMOLO]) + chn.autoSlide.SetActive(AutoSlideCommand::Tremolo, (param & 0x0F) != 0); + else + chn.dwFlags.set(CHN_TREMOLO); } @@ -6129,10 +6299,15 @@ } -void CSoundFile::GlobalVolSlide(ModCommand::PARAM param, uint8 &nOldGlobalVolSlide) +void CSoundFile::GlobalVolSlide(PlayState &playState, ModCommand::PARAM param, CHANNELINDEX chn) const { - int32 nGlbSlide = 0; - if (param) nOldGlobalVolSlide = param; else param = nOldGlobalVolSlide; + if(m_SongFlags[SONG_AUTO_GLOBALVOL]) + playState.Chn[chn].autoSlide.SetActive(AutoSlideCommand::GlobalVolumeSlide, param != 0); + + if(param) + playState.Chn[chn].nOldGlobalVolSlide = param; + else + param = playState.Chn[chn].nOldGlobalVolSlide; if((GetType() & (MOD_TYPE_XM | MOD_TYPE_MT2))) { @@ -6146,16 +6321,17 @@ } } + int32 nGlbSlide = 0; if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { - if(m_PlayState.m_flags[SONG_FIRSTTICK]) nGlbSlide = (param >> 4) * 2; + if(playState.m_flags[SONG_FIRSTTICK]) nGlbSlide = (param >> 4) * 2; } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) { - if(m_PlayState.m_flags[SONG_FIRSTTICK]) nGlbSlide = - (int)((param & 0x0F) * 2); + if(playState.m_flags[SONG_FIRSTTICK]) nGlbSlide = - (int)((param & 0x0F) * 2); } else { - if(!m_PlayState.m_flags[SONG_FIRSTTICK]) + if(!playState.m_flags[SONG_FIRSTTICK]) { if (param & 0xF0) { @@ -6171,9 +6347,9 @@ if (nGlbSlide) { if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT | MOD_TYPE_IMF | MOD_TYPE_J2B | MOD_TYPE_MID | MOD_TYPE_AMS | MOD_TYPE_DBM))) nGlbSlide *= 2; - nGlbSlide += m_PlayState.m_nGlobalVolume; + nGlbSlide += playState.m_nGlobalVolume; Limit(nGlbSlide, 0, 256); - m_PlayState.m_nGlobalVolume = nGlbSlide; + playState.m_nGlobalVolume = nGlbSlide; } } Modified: trunk/OpenMPT/soundlib/Sndfile.h ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Sndfile.h Sun May 26 00:27:30 2024 (r20850) @@ -1118,6 +1118,8 @@ Pan8bit = 8, }; // Channel Effects + void ResetAutoSlides(ModChannel &chn) const; + void ProcessAutoSlides(PlayState &playState, CHANNELINDEX channel); void UpdateS3MEffectMemory(ModChannel &chn, ModCommand::PARAM param) const; void PortamentoUp(CHANNELINDEX nChn, ModCommand::PARAM param, const bool doFinePortamentoAsRegular); void PortamentoUp(PlayState &playState, CHANNELINDEX nChn, ModCommand::PARAM param, const bool doFinePortamentoAsRegular) const; @@ -1139,6 +1141,7 @@ int32 TonePortamento(PlayState &playState, CHANNELINDEX nChn, uint16 param) const; void Vibrato(ModChannel &chn, uint32 param) const; void FineVibrato(ModChannel &chn, uint32 param) const; + void AutoVolumeSlide(ModChannel& chn, ModCommand::PARAM param) const; void VolumeSlide(ModChannel &chn, ModCommand::PARAM param) const; void PanningSlide(ModChannel &chn, ModCommand::PARAM param, bool memory = true) const; void ChannelVolSlide(ModChannel &chn, ModCommand::PARAM param) const; @@ -1162,7 +1165,7 @@ void InvertLoop(ModChannel &chn); void PositionJump(PlayState &state, CHANNELINDEX chn) const; ROWINDEX PatternBreak(PlayState &state, CHANNELINDEX chn, uint8 param) const; - void GlobalVolSlide(ModCommand::PARAM param, uint8 &nOldGlobalVolSlide); + void GlobalVolSlide(PlayState &playState, ModCommand::PARAM param, CHANNELINDEX chn) const; void ProcessMacroOnChannel(CHANNELINDEX nChn); void ProcessMIDIMacro(PlayState &playState, CHANNELINDEX nChn, bool isSmooth, const MIDIMacroConfigData::Macro ¯o, uint8 param = 0, PLUGINDEX plugin = 0); Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Sun May 26 00:27:30 2024 (r20850) @@ -695,7 +695,7 @@ && pChn->dwFlags[CHN_ADLIB] && pChn->nPortamentoDest && pChn->rowCommand.IsNote() - && pChn->rowCommand.IsPortamento()) + && pChn->rowCommand.IsTonePortamento()) { // ST3: Adlib Note + Tone Portamento does not execute the slide, but changes to the target note instantly on the next row (unless there is another note with tone portamento) // Test case: TonePortamentoWithAdlibNote.s3m @@ -1473,8 +1473,8 @@ // - If there's no arpeggio // - but an arpeggio note is still active and // - there's no note stop or new note that would stop it anyway - if((arpOnRow && chn.nArpeggioLastNote != arpNote && (!chn.isFirstTick || !chn.rowCommand.IsNote() || chn.rowCommand.IsPortamento())) - || (!arpOnRow && (chn.rowCommand.note == NOTE_NONE || chn.rowCommand.IsPortamento()) && chn.nArpeggioLastNote != NOTE_NONE)) + if((arpOnRow && chn.nArpeggioLastNote != arpNote && (!chn.isFirstTick || !chn.rowCommand.IsNote() || chn.rowCommand.IsTonePortamento())) + || (!arpOnRow && (chn.rowCommand.note == NOTE_NONE || chn.rowCommand.IsTonePortamento()) && chn.nArpeggioLastNote != NOTE_NONE)) SendMIDINote(nChn, arpNote | IMixPlugin::MIDI_NOTE_ARPEGGIO, static_cast<uint16>(chn.nVolume)); // Stop note: // - If some arpeggio note is still registered or @@ -2265,7 +2265,7 @@ // When glissando mode is set to semitones, clamp to the next halftone. if((chn.dwFlags & (CHN_GLISSANDO | CHN_PORTAMENTO)) == (CHN_GLISSANDO | CHN_PORTAMENTO) - && (!m_SongFlags[SONG_PT_MODE] || (chn.rowCommand.IsPortamento() && !m_PlayState.m_flags[SONG_FIRSTTICK]))) + && (!m_SongFlags[SONG_PT_MODE] || (chn.rowCommand.IsTonePortamento() && !m_PlayState.m_flags[SONG_FIRSTTICK]))) { if(period != chn.cachedPeriod) { @@ -2689,7 +2689,7 @@ realNote = pIns->NoteMap[note - NOTE_MIN]; // Experimental VST panning //ProcessMIDIMacro(nChn, false, m_MidiCfg.Global[MIDIOUT_PAN], 0, nPlugin); - if(m_playBehaviour[kPluginIgnoreTonePortamento] || !chn.rowCommand.IsPortamento()) + if(m_playBehaviour[kPluginIgnoreTonePortamento] || !chn.rowCommand.IsTonePortamento()) SendMIDINote(nChn, realNote, static_cast<uint16>(velocity)); } Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp ============================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp Sat May 25 23:29:11 2024 (r20849) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp Sun May 26 00:27:30 2024 (r20850) @@ -67,13 +67,10 @@ true, // Has artist name true, // Has default resampling true, // Fixed point tempo - " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#+*????????????", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#+*?????????????????", // Supported Effects " vpcdabuh??gfe?o", // Supported Volume Column commands }; - - - constexpr CModSpecifications mod_ = { MOD_TYPE_MOD, // Internal MODTYPE value @@ -117,11 +114,10 @@ false, // Doesn't have artist name false, // Doesn't have default resampling false, // Integer tempo - " 0123456789ABCD?FF?E?????????????????????????????", // Supported Effects + " 0123456789ABCD?FF?E??????????????????????????????????", // Supported Effects " ???????????????", // Supported Volume Column commands }; - constexpr CModSpecifications xm_ = { MOD_TYPE_XM, // Internal MODTYPE value @@ -165,7 +161,7 @@ false, // Doesn't have artist name false, // Doesn't have default resampling false, // Integer tempo - " 0123456789ABCDRFFTE???GHK??XPL??????W???????????", // Supported Effects + " 0123456789ABCDRFFTE???GHK??XPL??????W????????????????", // Supported Effects " vpcdabuhlrg????", // Supported Volume Column commands }; @@ -213,7 +209,7 @@ true, // Has artist name false, // Doesn't have default resampling false, // Integer tempo - " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#??W???????????", // Supported Effects + " 0123... [truncated message content] |
From: <sv...@op...> - 2024-05-28 17:05:17
|
Author: sagamusix Date: Sun May 26 22:38:23 2024 New Revision: 20856 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20856 Log: Merged revision(s) 20846-20848 from trunk/OpenMPT: [Mod] MED: Don't seek to and read pattern name position if the length is 0 anyway. ........ [Fix] STP: Volume slide nibbles are not just swapped, but they are always both executed (so up and down are added together). [Ref] Cleanup STP loader. ........ [Fix] S3M: Don't update effect memory from cells without a command. This could happen after editing a pattern. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/Load_med.cpp branches/OpenMPT-1.30/soundlib/Load_stp.cpp branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.30/soundlib/Load_med.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_med.cpp Sun May 26 22:35:07 2024 (r20855) +++ branches/OpenMPT-1.30/soundlib/Load_med.cpp Sun May 26 22:38:23 2024 (r20856) @@ -2,7 +2,7 @@ * Load_med.cpp * ------------ * Purpose: OctaMED / MED Soundstudio module loader - * Notes : Support for synthesized instruments is still missing. + * Notes : (currently none) * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -101,7 +101,7 @@ { FLAG_FILTERON = 0x01, // The hardware audio filter is on FLAG_JUMPINGON = 0x02, // Mouse pointer jumping on - FLAG_JUMP8TH = 0x04, // ump every 8th line (not in OctaMED Pro) + FLAG_JUMP8TH = 0x04, // Jump every 8th line (not in OctaMED Pro) FLAG_INSTRSATT = 0x08, // sng+samples indicator (not useful in MMDs) FLAG_VOLHEX = 0x10, // volumes are HEX FLAG_STSLIDE = 0x20, // use ST/NT/PT compatible sliding @@ -474,8 +474,7 @@ } break; case 0x10: // MIDI message - m.command = CMD_MIDI; - m.param |= 0x80; + m.SetEffectCommand(CMD_MIDI, 0x80 | param); break; case 0x11: // Slide pitch up m.command = CMD_MODCMDEX; @@ -1322,7 +1321,9 @@ file.Seek(patHeader.blockInfoOffset); MMDBlockInfo blockInfo; file.ReadStruct(blockInfo); - if(file.Seek(blockInfo.nameOffset)) + if(blockInfo.nameLength + && blockInfo.nameOffset + && file.Seek(blockInfo.nameOffset)) { // We have now chased four pointers to get this far... lovely format. file.ReadString<mpt::String::maybeNullTerminated>(patName, blockInfo.nameLength); Modified: branches/OpenMPT-1.30/soundlib/Load_stp.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Load_stp.cpp Sun May 26 22:35:07 2024 (r20855) +++ branches/OpenMPT-1.30/soundlib/Load_stp.cpp Sun May 26 22:38:23 2024 (r20856) @@ -441,18 +441,16 @@ const auto [instr, note, command, param] = file.ReadArray<uint8, 4>(); m.instr = instr; - m.note = note; m.param = param; - - if(m.note) + if(note) { - m.note += 24 + NOTE_MIN; + m.note = NOTE_MIDDLEC - 36 + note; chnMem = ChannelMemory(); } - // this is a nibble-swapped param value used for auto fine volside - // and auto global fine volside - uint8 swapped = (m.param >> 4) | (m.param << 4); + // Volume slides not only have their nibbles swapped, but the up and down parameters also add up + const int totalSlide = -static_cast<int>(m.param >> 4) + (m.param & 0x0F); + const uint8 slideParam = static_cast<uint8>((totalSlide > 0) ? totalSlide << 4 : -totalSlide); if((command & 0xF0) == 0xF0) { @@ -462,138 +460,93 @@ { m.param = mpt::saturate_round<ModCommand::PARAM>(ConvertTempo(ciaTempo).ToDouble()); m.command = CMD_TEMPO; - } else - { - m.command = CMD_NONE; } } else switch(command) { case 0x00: // arpeggio if(m.param) m.command = CMD_ARPEGGIO; - else - m.command = CMD_NONE; break; - case 0x01: // portamento up m.command = CMD_PORTAMENTOUP; break; - case 0x02: // portamento down m.command = CMD_PORTAMENTODOWN; break; - case 0x03: // auto fine portamento up chnMem.autoFinePorta = 0x10 | std::min(m.param, ModCommand::PARAM(15)); chnMem.autoPortaUp = 0; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x04: // auto fine portamento down chnMem.autoFinePorta = 0x20 | std::min(m.param, ModCommand::PARAM(15)); chnMem.autoPortaUp = 0; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x05: // auto portamento up chnMem.autoFinePorta = 0; chnMem.autoPortaUp = m.param; chnMem.autoPortaDown = 0; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x06: // auto portamento down chnMem.autoFinePorta = 0; chnMem.autoPortaUp = 0; chnMem.autoPortaDown = m.param; chnMem.autoTonePorta = 0; - - m.command = CMD_NONE; break; - case 0x07: // set global volume m.command = CMD_GLOBALVOLUME; globalVolSlide = 0; break; - case 0x08: // auto global fine volume slide - globalVolSlide = swapped; - m.command = CMD_NONE; + globalVolSlide = slideParam; break; - case 0x09: // fine portamento up m.command = CMD_MODCMDEX; m.param = 0x10 | std::min(m.param, ModCommand::PARAM(15)); break; - case 0x0A: // fine portamento down m.command = CMD_MODCMDEX; m.param = 0x20 | std::min(m.param, ModCommand::PARAM(15)); break; - case 0x0B: // auto fine volume slide - chnMem.autoVolSlide = swapped; - m.command = CMD_NONE; + chnMem.autoVolSlide = slideParam; break; - case 0x0C: // set volume m.volcmd = VOLCMD_VOLUME; m.vol = m.param; chnMem.autoVolSlide = 0; - m.command = CMD_NONE; break; - case 0x0D: // volume slide (param is swapped compared to .mod) - if(m.param & 0xF0) - { - m.volcmd = VOLCMD_VOLSLIDEDOWN; - m.vol = m.param >> 4; - } else if(m.param & 0x0F) - { - m.volcmd = VOLCMD_VOLSLIDEUP; - m.vol = m.param & 0xF; - } + if(totalSlide < 0) + m.SetVolumeCommand(VOLCMD_VOLSLIDEDOWN, slideParam & 0x0F); + else if(totalSlide > 0) + m.SetVolumeCommand(VOLCMD_VOLSLIDEUP, slideParam >> 4); chnMem.autoVolSlide = 0; - m.command = CMD_NONE; break; - case 0x0E: // set filter (also uses opposite value compared to .mod) - m.command = CMD_MODCMDEX; - m.param = 1 ^ (m.param ? 1 : 0); + m.SetEffectCommand(CMD_MODCMDEX, 1 ^ (m.param ? 1 : 0)); break; - case 0x0F: // set speed - m.command = CMD_SPEED; speedFrac = m.param & 0x0F; - m.param >>= 4; + m.SetEffectCommand(CMD_SPEED, m.param >> 4); break; - case 0x10: // auto vibrato chnMem.autoVibrato = m.param; chnMem.vibratoMem = 0; - m.command = CMD_NONE; break; - case 0x11: // auto tremolo if(m.param & 0xF) chnMem.autoTremolo = m.param; else chnMem.autoTremolo = 0; - m.command = CMD_NONE; break; - case 0x12: // pattern break m.command = CMD_PATTERNBREAK; break; - case 0x13: // auto tone portamento chnMem.autoFinePorta = 0; chnMem.autoPortaUp = 0; @@ -601,13 +554,10 @@ chnMem.autoTonePorta = m.param; chnMem.tonePortaMem = 0; - m.command = CMD_NONE; break; - case 0x14: // position jump m.command = CMD_POSITIONJUMP; break; - case 0x16: // start loop sequence if(m.instr && m.instr <= loopInfo.size()) { @@ -620,10 +570,7 @@ m.vol = m.param; } } - - m.command = CMD_NONE; break; - case 0x17: // play only loop nn if(m.instr && m.instr <= loopInfo.size()) { @@ -637,10 +584,7 @@ m.instr = static_cast<ModCommand::INSTR>(loopList[m.param].looped); } } - - m.command = CMD_NONE; break; - case 0x18: // play sequence without loop if(m.instr && m.instr <= loopInfo.size()) { @@ -657,10 +601,7 @@ nonLooped[m.instr - 1] = ++m_nSamples; m.instr = static_cast<ModCommand::INSTR>(nonLooped[m.instr - 1]); } - - m.command = CMD_NONE; break; - case 0x19: // play only loop nn without loop if(m.instr && m.instr <= loopInfo.size()) { @@ -674,54 +615,37 @@ m.instr = static_cast<ModCommand::INSTR>(loopList[m.param].nonLooped); } } - - m.command = CMD_NONE; break; - case 0x1D: // fine volume slide (nibble order also swapped) - m.command = CMD_VOLUMESLIDE; - m.param = swapped; - if(m.param & 0xF0) // slide down - m.param |= 0x0F; - else if(m.param & 0x0F) - m.param |= 0xF0; + if(totalSlide < 0) // slide down + m.SetEffectCommand(CMD_MODCMDEX, 0xB0 | (slideParam & 0x0F)); + else if(totalSlide > 0) + m.SetEffectCommand(CMD_MODCMDEX, 0xA0 | (slideParam >> 4)); break; - case 0x20: // "delayed fade" // just behave like either a normal fade or a notecut // depending on the speed if(m.param & 0xF0) { chnMem.autoVolSlide = m.param >> 4; - m.command = CMD_NONE; } else { - m.command = CMD_MODCMDEX; - m.param = 0xC0 | (m.param & 0xF); + m.SetEffectCommand(CMD_MODCMDEX, 0xC0 | (m.param & 0xF)); } break; - case 0x21: // note delay - m.command = CMD_MODCMDEX; - m.param = 0xD0 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0xD0 | std::min(m.param, ModCommand::PARAM(15))); break; - case 0x22: // retrigger note - m.command = CMD_MODCMDEX; - m.param = 0x90 | std::min(m.param, ModCommand::PARAM(15)); + m.SetEffectCommand(CMD_MODCMDEX, 0x90 | std::min(m.param, ModCommand::PARAM(15))); break; - case 0x49: // set sample offset m.command = CMD_OFFSET; break; - case 0x4E: // other protracker commands (pattern loop / delay) if((m.param & 0xF0) == 0x60 || (m.param & 0xF0) == 0xE0) m.command = CMD_MODCMDEX; - else - m.command = CMD_NONE; break; - case 0x4F: // set speed/tempo if(m.param < 0x20) { @@ -732,9 +656,7 @@ m.command = CMD_TEMPO; } break; - default: - m.command = CMD_NONE; break; } Modified: branches/OpenMPT-1.30/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sun May 26 22:35:07 2024 (r20855) +++ branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sun May 26 22:38:23 2024 (r20856) @@ -902,7 +902,7 @@ break; } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && command != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, param); } @@ -3452,7 +3452,7 @@ break; } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && cmd != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, static_cast<ModCommand::PARAM>(param)); } |
From: <sv...@op...> - 2024-05-28 16:50:21
|
Author: sagamusix Date: Sat May 25 23:04:22 2024 New Revision: 20848 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20848 Log: [Fix] S3M: Don't update effect memory from cells without a command. This could happen after editing a pattern. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sat May 25 17:51:23 2024 (r20847) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Sat May 25 23:04:22 2024 (r20848) @@ -1000,7 +1000,7 @@ break; } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && command != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, param); } @@ -3614,7 +3614,7 @@ break; } - if(m_playBehaviour[kST3EffectMemory] && param != 0) + if(m_playBehaviour[kST3EffectMemory] && cmd != CMD_NONE && param != 0) { UpdateS3MEffectMemory(chn, static_cast<ModCommand::PARAM>(param)); } |
From: <sv...@op...> - 2024-05-28 16:45:23
|
Author: sagamusix Date: Mon May 27 21:36:15 2024 New Revision: 20864 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20864 Log: [Var] Document test case. Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Mon May 27 21:34:41 2024 (r20863) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Mon May 27 21:36:15 2024 (r20864) @@ -5683,6 +5683,8 @@ param /= 2u; } + // IT compatibility: Offset with instrument number but note note recalls previous note and executes offset. + // Test case: OffsetWithInstr.it const auto note = (m_playBehaviour[kITOffsetWithInstrNumber] && chn.rowCommand.instr) ? chn.nNewNote : chn.rowCommand.note; if(ModCommand::IsNote(note) || m_playBehaviour[kApplyOffsetWithoutNote]) { |