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
(181) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2024-12-13 18:22:06
|
Author: sagamusix Date: Fri Dec 13 19:21:42 2024 New Revision: 22533 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22533 Log: [Var] Improve comments. Modified: trunk/OpenMPT/soundlib/pattern.h Modified: trunk/OpenMPT/soundlib/pattern.h ============================================================================== --- trunk/OpenMPT/soundlib/pattern.h Fri Dec 13 19:19:53 2024 (r22532) +++ trunk/OpenMPT/soundlib/pattern.h Fri Dec 13 19:21:42 2024 (r22533) @@ -68,7 +68,7 @@ // Deallocate pattern data. void Deallocate(); - // Removes all modcommands from the pattern. + // Empties all ModCommands in the pattern. void ClearCommands() noexcept; // Returns associated soundfile. @@ -131,7 +131,7 @@ protected: std::vector<ModCommand> m_ModCommands; ROWINDEX m_Rows = 0; - ROWINDEX m_RowsPerBeat = 0; // patterns-specific time signature. if != 0, this is implicitely set. + ROWINDEX m_RowsPerBeat = 0; // patterns-specific time signature. if != 0, the time signature is used automatically. ROWINDEX m_RowsPerMeasure = 0; // ditto TempoSwing m_tempoSwing; std::string m_PatternName; @@ -154,9 +154,9 @@ // Row advance mode enum RetryMode : uint8 { - rmIgnore, // If effect can't be written, abort. - rmTryNextRow, // If effect can't be written, try next row. - rmTryPreviousRow, // If effect can't be written, try previous row. + rmIgnore, // If effect can't be written, abort. + rmTryNextRow, // If effect can't be written, try next row. + rmTryPreviousRow, // If effect can't be written, try previous row. }; public: |
From: <sv...@op...> - 2024-12-13 18:20:05
|
Author: sagamusix Date: Fri Dec 13 19:19:53 2024 New Revision: 22532 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22532 Log: Merged revision(s) 22531 from trunk/OpenMPT: [Fix] ITP: Instruments paths were always read as relative paths since r17468 (so since the first official release of OpenMPT 1.31), usually causing them to file to load. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_itp.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_itp.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_itp.cpp Fri Dec 13 19:19:36 2024 (r22531) +++ branches/OpenMPT-1.31/soundlib/Load_itp.cpp Fri Dec 13 19:19:53 2024 (r22532) @@ -261,7 +261,7 @@ #ifdef MODPLUG_TRACKER if(const auto fileName = file.GetOptionalFileName(); fileName.has_value()) { - instrPaths[ins] = mpt::AbsolutePathToRelative(instrPaths[ins], fileName->GetDirectoryWithDrive()); + instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], fileName->GetDirectoryWithDrive()); } else if(GetpModDoc() != nullptr) { instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], GetpModDoc()->GetPathNameMpt().GetDirectoryWithDrive()); @@ -309,15 +309,13 @@ // Pattern data size_t numCommands = GetNumChannels() * numRows; - if(patternChunk.CanRead(sizeof(ITPModCommand) * numCommands)) { - ModCommand *target = Patterns[pat].GetpModCommand(0, 0); - while(numCommands-- != 0) + for(ModCommand &m : Patterns[pat]) { ITPModCommand data; patternChunk.ReadStruct(data); - *(target++) = data; + m = data; } } } @@ -330,7 +328,7 @@ // Read number of embedded samples - at most as many as there are real samples in a valid file uint32 embeddedSamples = file.ReadUint32LE(); - if(embeddedSamples > m_nSamples) + if(embeddedSamples > GetNumSamples()) { return false; } |
From: <sv...@op...> - 2024-12-13 18:19:48
|
Author: sagamusix Date: Fri Dec 13 19:19:36 2024 New Revision: 22531 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22531 Log: [Fix] ITP: Instruments paths were always read as relative paths since r17468 (so since the first official release of OpenMPT 1.31), usually causing them to file to load. Modified: trunk/OpenMPT/soundlib/Load_itp.cpp Modified: trunk/OpenMPT/soundlib/Load_itp.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp Thu Dec 12 22:27:08 2024 (r22530) +++ trunk/OpenMPT/soundlib/Load_itp.cpp Fri Dec 13 19:19:36 2024 (r22531) @@ -256,7 +256,7 @@ #ifdef MODPLUG_TRACKER if(const auto fileName = file.GetOptionalFileName(); fileName.has_value()) { - instrPaths[ins] = mpt::AbsolutePathToRelative(instrPaths[ins], fileName->GetDirectoryWithDrive()); + instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], fileName->GetDirectoryWithDrive()); } else if(GetpModDoc() != nullptr) { instrPaths[ins] = mpt::RelativePathToAbsolute(instrPaths[ins], GetpModDoc()->GetPathNameMpt().GetDirectoryWithDrive()); @@ -304,15 +304,13 @@ // Pattern data size_t numCommands = GetNumChannels() * numRows; - if(patternChunk.CanRead(sizeof(ITPModCommand) * numCommands)) { - ModCommand *target = Patterns[pat].GetpModCommand(0, 0); - while(numCommands-- != 0) + for(ModCommand &m : Patterns[pat]) { ITPModCommand data; patternChunk.ReadStruct(data); - *(target++) = data; + m = data; } } } @@ -325,7 +323,7 @@ // Read number of embedded samples - at most as many as there are real samples in a valid file uint32 embeddedSamples = file.ReadUint32LE(); - if(embeddedSamples > m_nSamples) + if(embeddedSamples > GetNumSamples()) { return false; } |
From: <sv...@op...> - 2024-12-12 21:27:15
|
Author: sagamusix Date: Thu Dec 12 22:27:08 2024 New Revision: 22530 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22530 Log: [Fix] Avoid writing past end of ChnSettings when reading channel colors. [Imp] Modernize Extended Song Properties writing to not use macros. [Mod] Don't write Tempo Mode Extended Song Property when using classic tempo mode. [Mod] Don't write Sample Pre-Amp Extended Song Property when not required. Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Thu Dec 12 22:21:29 2024 (r22529) +++ trunk/OpenMPT/soundlib/Load_it.cpp Thu Dec 12 22:27:08 2024 (r22530) @@ -2310,45 +2310,44 @@ // Extra song data - Yet Another Hack. mpt::IO::WriteIntLE<uint32>(f, MagicBE("MPTS")); -#define WRITEMODULARHEADER(code, fsize) \ - { \ - mpt::IO::WriteIntLE<uint32>(f, code); \ - MPT_ASSERT(mpt::in_range<uint16>(fsize)); \ - const uint16 _size = fsize; \ - mpt::IO::WriteIntLE<uint16>(f, _size); \ - } -#define WRITEMODULAR(code, field) \ - { \ - WRITEMODULARHEADER(code, sizeof(field)) \ - mpt::IO::WriteIntLE(f, field); \ - } + const auto WriteModularHeader = [](std::ostream &f, uint32 code, size_t fsize) + { + mpt::IO::WriteIntLE<uint32>(f, code); + MPT_ASSERT(mpt::in_range<uint16>(fsize)); + mpt::IO::WriteIntLE<uint16>(f, static_cast<uint16>(fsize)); + }; + const auto WriteModular = [&WriteModularHeader](std::ostream &f, uint32 code, auto field) + { + WriteModularHeader(f, code, sizeof(field)); + mpt::IO::WriteIntLE(f, field); + }; if(Order().GetDefaultTempo().GetInt() > 255) { uint32 tempo = Order().GetDefaultTempo().GetInt(); - WRITEMODULAR(MagicBE("DT.."), tempo); + WriteModular(f, MagicBE("DT.."), tempo); } if(Order().GetDefaultTempo().GetFract() != 0 && specs.hasFractionalTempo) { uint32 tempo = Order().GetDefaultTempo().GetFract(); - WRITEMODULAR(MagicLE("DTFR"), tempo); + WriteModular(f, MagicLE("DTFR"), tempo); } if(m_nDefaultRowsPerBeat > 255 || m_nDefaultRowsPerMeasure > 255 || GetType() == MOD_TYPE_XM) { - WRITEMODULAR(MagicBE("RPB."), m_nDefaultRowsPerBeat); - WRITEMODULAR(MagicBE("RPM."), m_nDefaultRowsPerMeasure); + WriteModular(f, MagicBE("RPB."), m_nDefaultRowsPerBeat); + WriteModular(f, MagicBE("RPM."), m_nDefaultRowsPerMeasure); } if(GetType() != MOD_TYPE_XM) { - WRITEMODULAR(MagicBE("C..."), GetNumChannels()); + WriteModular(f, MagicBE("C..."), GetNumChannels()); } if((GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) && GetNumChannels() > 64) { // IT header has only room for 64 channels. Save the settings that do not fit to the header here as an extension. - WRITEMODULARHEADER(MagicBE("ChnS"), static_cast<uint16>((GetNumChannels() - 64) * 2)); + WriteModularHeader(f, MagicBE("ChnS"), (GetNumChannels() - 64) * 2); for(CHANNELINDEX chn = 64; chn < GetNumChannels(); chn++) { uint8 panvol[2]; @@ -2360,37 +2359,41 @@ } } + if(m_nTempoMode != TempoMode::Classic) { - WRITEMODULARHEADER(MagicBE("TM.."), 1); + WriteModularHeader(f, MagicBE("TM.."), 1); uint8 mode = static_cast<uint8>(m_nTempoMode); mpt::IO::WriteIntLE(f, mode); } const int32 tmpMixLevels = static_cast<int32>(m_nMixLevels); - WRITEMODULAR(MagicBE("PMM."), tmpMixLevels); + WriteModular(f, MagicBE("PMM."), tmpMixLevels); if(m_dwCreatedWithVersion) { - WRITEMODULAR(MagicBE("CWV."), m_dwCreatedWithVersion.GetRawVersion()); + WriteModular(f, MagicBE("CWV."), m_dwCreatedWithVersion.GetRawVersion()); } - WRITEMODULAR(MagicBE("LSWV"), Version::Current().GetRawVersion()); - WRITEMODULAR(MagicBE("SPA."), m_nSamplePreAmp); - WRITEMODULAR(MagicBE("VSTV"), m_nVSTiVolume); + WriteModular(f, MagicBE("LSWV"), Version::Current().GetRawVersion()); + if(GetType() == MOD_TYPE_XM || m_nSamplePreAmp > 128) + { + WriteModular(f, MagicBE("SPA."), m_nSamplePreAmp); + } + WriteModular(f, MagicBE("VSTV"), m_nVSTiVolume); if(GetType() == MOD_TYPE_XM && m_nDefaultGlobalVolume != MAX_GLOBAL_VOLUME) { - WRITEMODULAR(MagicBE("DGV."), m_nDefaultGlobalVolume); + WriteModular(f, MagicBE("DGV."), m_nDefaultGlobalVolume); } if(GetType() != MOD_TYPE_XM && Order().GetRestartPos() != 0) { - WRITEMODULAR(MagicBE("RP.."), Order().GetRestartPos()); + WriteModular(f, MagicBE("RP.."), Order().GetRestartPos()); } if(m_nResampling != SRCMODE_DEFAULT && specs.hasDefaultResampling) { - WRITEMODULAR(MagicLE("RSMP"), static_cast<uint32>(m_nResampling)); + WriteModular(f, MagicLE("RSMP"), static_cast<uint32>(m_nResampling)); } // Sample cues @@ -2404,7 +2407,7 @@ // Write one chunk for every sample. // Rationale: chunks are limited to 65536 bytes, which can easily be reached // with the amount of samples that OpenMPT supports. - WRITEMODULARHEADER(MagicLE("CUES"), static_cast<uint16>(2 + std::size(sample.cues) * 4)); + WriteModularHeader(f, MagicLE("CUES"), 2 + std::size(sample.cues) * 4); mpt::IO::WriteIntLE<uint16>(f, smp); for(auto cue : sample.cues) { @@ -2421,7 +2424,7 @@ TempoSwing::Serialize(oStrm, m_tempoSwing); std::string data = oStrm.str(); uint16 length = mpt::saturate_cast<uint16>(data.size()); - WRITEMODULARHEADER(MagicLE("SWNG"), length); + WriteModularHeader(f, MagicLE("SWNG"), length); mpt::IO::WriteRaw(f, data.data(), length); } @@ -2440,7 +2443,7 @@ } } uint16 numBytes = static_cast<uint16>(maxBit / 8u); - WRITEMODULARHEADER(MagicBE("MSF."), numBytes); + WriteModularHeader(f, MagicBE("MSF."), numBytes); mpt::IO::WriteRaw(f, bits.data(), numBytes); } @@ -2448,7 +2451,7 @@ { std::string songArtistU8 = mpt::ToCharset(mpt::Charset::UTF8, m_songArtist); uint16 length = mpt::saturate_cast<uint16>(songArtistU8.length()); - WRITEMODULARHEADER(MagicLE("AUTH"), length); + WriteModularHeader(f, MagicLE("AUTH"), length); mpt::IO::WriteRaw(f, songArtistU8.c_str(), length); } @@ -2462,7 +2465,7 @@ AddToLog(LogWarning, U_("Too many MIDI Mapping directives to save; data won't be written.")); } else { - WRITEMODULARHEADER(MagicBE("MIMA"), static_cast<uint16>(objectsize)); + WriteModularHeader(f, MagicBE("MIMA"), objectsize); GetMIDIMapper().Serialize(&f); } } @@ -2479,7 +2482,7 @@ } if(numChannels > 0) { - WRITEMODULARHEADER(MagicLE("CCOL"), numChannels * 4); + WriteModularHeader(f, MagicLE("CCOL"), numChannels * 4); for(CHANNELINDEX i = 0; i < numChannels; i++) { uint32 color = ChnSettings[i].color; @@ -2491,9 +2494,6 @@ } } #endif - -#undef WRITEMODULAR -#undef WRITEMODULARHEADER } #endif // MODPLUG_NO_FILESAVE @@ -2571,7 +2571,10 @@ case MagicLE("CCOL"): // Channel colors { - const CHANNELINDEX numChannels = std::min(MAX_BASECHANNELS, static_cast<CHANNELINDEX>(size / 4u)); + const CHANNELINDEX channelsInFile = static_cast<CHANNELINDEX>(size / 4u); + if(!ignoreChannelCount) + ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); + const CHANNELINDEX numChannels = std::min(channelsInFile, GetNumChannels()); for(CHANNELINDEX i = 0; i < numChannels; i++) { auto rgb = chunk.ReadArray<uint8, 4>(); @@ -2598,8 +2601,8 @@ const CHANNELINDEX channelsInFile = mpt::saturate_cast<CHANNELINDEX>(64 + size / 2); if(!ignoreChannelCount) ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); - const CHANNELINDEX loopLimit = std::min(channelsInFile, GetNumChannels()); - for(CHANNELINDEX chn = 64; chn < loopLimit; chn++) + const CHANNELINDEX numChannels = std::min(channelsInFile, GetNumChannels()); + for(CHANNELINDEX chn = 64; chn < numChannels; chn++) { auto [pan, vol] = chunk.ReadArray<uint8, 2>(); if(pan != 0xFF) |
From: <sv...@op...> - 2024-12-12 21:21:40
|
Author: sagamusix Date: Thu Dec 12 22:21:29 2024 New Revision: 22529 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22529 Log: [Fix] Reset tempo mode when initializing module. Since only few formats use a tempo mode other than classic, and their loaders don't return false after the tempo mode has been set, this does not make a difference in practice right now. Modified: trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Thu Dec 12 22:16:19 2024 (r22528) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Thu Dec 12 22:21:29 2024 (r22529) @@ -206,6 +206,7 @@ m_nResampling = SRCMODE_DEFAULT; m_dwLastSavedWithVersion = Version(0); m_dwCreatedWithVersion = Version(0); + m_nTempoMode = TempoMode::Classic; SetMixLevels(MixLevels::Compatible); |
From: <sv...@op...> - 2024-12-12 21:16:42
|
Author: sagamusix Date: Thu Dec 12 22:16:19 2024 New Revision: 22528 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22528 Log: [Imp] TCB: Fill in "made with" tracker information based on new/old format. [Ref] Whitespace cleanup. Modified: trunk/OpenMPT/soundlib/Load_cba.cpp trunk/OpenMPT/soundlib/Load_tcb.cpp Modified: trunk/OpenMPT/soundlib/Load_cba.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_cba.cpp Thu Dec 12 22:15:42 2024 (r22527) +++ trunk/OpenMPT/soundlib/Load_cba.cpp Thu Dec 12 22:16:19 2024 (r22528) @@ -145,7 +145,7 @@ else if(command == 0x18) m.SetEffectCommand(CMD_RETRIG, param); else if(command >= 0x10 && command <= 0x1E) - m.SetEffectCommand(CMD_MODCMDEX, static_cast<ModCommand::PARAM>(((command << 4) + 0x10) | std::min(param ,uint8(0x0F)))); + m.SetEffectCommand(CMD_MODCMDEX, static_cast<ModCommand::PARAM>(((command << 4) + 0x10) | std::min(param, uint8(0x0F)))); else if(command == 0x1F) m.SetEffectCommand(CMD_SPEED, param); else if(command == 0x20) Modified: trunk/OpenMPT/soundlib/Load_tcb.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_tcb.cpp Thu Dec 12 22:15:42 2024 (r22527) +++ trunk/OpenMPT/soundlib/Load_tcb.cpp Thu Dec 12 22:16:19 2024 (r22528) @@ -17,7 +17,7 @@ struct TCBFileHeader { - char magic[8]; // "AN COOL." (new) or "AN COOL!" (old - even TCB Tracker 1.0 cannot load these files) + char magic[8]; // "AN COOL." (new) or "AN COOL!" (early TCB Tracker beta versions; not even TCB Tracker 1.0 can read these files) uint32be numPatterns; uint8 tempo; uint8 unused1; @@ -182,9 +182,9 @@ m_szNames[smp] = mpt::String::ReadBuf(mpt::String::spacePadded, instrNames[smp - 1]); } - m_modFormat.formatName = newFormat ? UL_("TCB Tracker (New Format)") : UL_("TCB Tracker (Old Format)"); + m_modFormat.formatName = newFormat ? UL_("TCB Tracker") : UL_("TCB Tracker (Beta Format)"); m_modFormat.type = UL_("mod"); - m_modFormat.madeWithTracker = UL_("TCB Tracker"); + m_modFormat.madeWithTracker = newFormat ? UL_("TCB Tracker 1.0 - 2.0") : UL_("TCB Tracker Beta"); m_modFormat.charset = mpt::Charset::AtariST; return true; |
From: <sv...@op...> - 2024-12-12 21:15:49
|
Author: sagamusix Date: Thu Dec 12 22:15:42 2024 New Revision: 22527 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22527 Log: [Ref] Quick Start Dialog: Optimize memory usage. Modified: trunk/OpenMPT/mptrack/QuickStartDialog.cpp Modified: trunk/OpenMPT/mptrack/QuickStartDialog.cpp ============================================================================== --- trunk/OpenMPT/mptrack/QuickStartDialog.cpp Thu Dec 12 22:14:57 2024 (r22526) +++ trunk/OpenMPT/mptrack/QuickStartDialog.cpp Thu Dec 12 22:15:42 2024 (r22527) @@ -120,6 +120,7 @@ if(m_prevDPI) { // We don't use this as a stand-alone dialog but rather embed it in the MDI child area, and it is not resized automatically. + MPT_ASSERT(GetStyle() & WS_CHILD); CRect windowRect; GetClientRect(windowRect); windowRect.right = Util::muldiv(windowRect.right, GetDPI(), m_prevDPI); @@ -312,10 +313,9 @@ { struct OpenItem { - const mpt::PathString path; // Must create copy because dialog will get destroyed after successfully loading the first file - const int item; - const int group; - const size_t index; + mpt::PathString path; // Must create copy because dialog will get destroyed after successfully loading the first file + int item = 0; + int group = 0; }; std::vector<OpenItem> files; int i = -1; @@ -323,8 +323,7 @@ { const int group = GetItemGroup(i); const size_t index = GetItemIndex(i); - const auto &path = m_paths[group][index]; - files.push_back({path, i, group, index}); + files.push_back({std::move(m_paths[group][index]), i, group}); } bool success = false; for(const auto &item : files) @@ -340,7 +339,6 @@ // If at least one item managed to load, the dialog will now be destroyed, and there are no items to delete from the list for(auto it = files.rbegin(); it != files.rend(); it++) { - m_paths[it->group][it->index] = {}; m_list.DeleteItem(it->item); } } |
From: <sv...@op...> - 2024-12-12 21:15:10
|
Author: sagamusix Date: Thu Dec 12 22:14:57 2024 New Revision: 22526 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22526 Log: [Fix] Splash screen: Inherit message map from correct base class. Modified: trunk/OpenMPT/mptrack/Mptrack.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp Wed Dec 11 23:04:15 2024 (r22525) +++ trunk/OpenMPT/mptrack/Mptrack.cpp Thu Dec 12 22:14:57 2024 (r22526) @@ -1779,12 +1779,12 @@ DECLARE_MESSAGE_MAP() }; -BEGIN_MESSAGE_MAP(CSplashScreen, CDialog) +BEGIN_MESSAGE_MAP(CSplashScreen, DialogBase) ON_WM_PAINT() ON_WM_ERASEBKGND() END_MESSAGE_MAP() -static CSplashScreen *gpSplashScreen = NULL; +static CSplashScreen *gpSplashScreen = nullptr; static DWORD64 gSplashScreenStartTime = 0; @@ -1806,13 +1806,13 @@ gfx.SetSmoothingMode(Gdiplus::SmoothingModeHighQuality); gfx.DrawImage(m_Image.get(), 0, 0, rect.right, rect.bottom); - CDialog::OnPaint(); + DialogBase::OnPaint(); } BOOL CSplashScreen::OnInitDialog() { - CDialog::OnInitDialog(); + DialogBase::OnInitDialog(); try { |
From: <sv...@op...> - 2024-12-11 22:04:28
|
Author: sagamusix Date: Wed Dec 11 23:04:15 2024 New Revision: 22525 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22525 Log: [Imp] Remove default cue points in IT files and old enough MPTM files that don't use any volume-column offset commands (https://bugs.openmpt.org/view.php?id=1540). Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Wed Dec 11 22:51:45 2024 (r22524) +++ trunk/OpenMPT/soundlib/Load_it.cpp Wed Dec 11 23:04:15 2024 (r22525) @@ -1024,6 +1024,7 @@ // Reading Patterns Patterns.ResizeArray(numPats); + bool hasVolColOffset = false; for(PATTERNINDEX pat = 0; pat < numPats; pat++) { if(patPos[pat] == 0 || !file.Seek(patPos[pat])) @@ -1158,7 +1159,7 @@ } else // 213-222: Unused (was velocity) // 223-232: Offset - if(vol >= 223 && vol <= 232) { m.volcmd = VOLCMD_OFFSET; m.vol = vol - 223; } + if(vol >= 223 && vol <= 232) { m.volcmd = VOLCMD_OFFSET; m.vol = vol - 223; hasVolColOffset = true; } lastValue[ch].volcmd = m.volcmd; lastValue[ch].vol = m.vol; } @@ -1185,6 +1186,14 @@ } } } + // Remove (default) cue points if no volume column offset is found (unless it's a new enough MPTM file, which could contain intentionally-placed custom cue points that we don't want to lose) + if(!hasVolColOffset && (GetType() != MOD_TYPE_MPT || m_dwLastSavedWithVersion < MPT_V("1.24.02.06"))) + { + for(SAMPLEINDEX smp = 1; smp <= GetNumSamples(); smp++) + { + Samples[smp].RemoveAllCuePoints(); + } + } if(!m_dwLastSavedWithVersion && fileHeader.cwtv == 0x0888) { |
From: <sv...@op...> - 2024-12-11 21:51:52
|
Author: sagamusix Date: Wed Dec 11 22:51:45 2024 New Revision: 22524 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22524 Log: [Mod] Don't set default sample cue points for OKT files, they are not used. Modified: trunk/OpenMPT/soundlib/Load_okt.cpp Modified: trunk/OpenMPT/soundlib/Load_okt.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_okt.cpp Wed Dec 11 22:36:01 2024 (r22523) +++ trunk/OpenMPT/soundlib/Load_okt.cpp Wed Dec 11 22:51:45 2024 (r22524) @@ -136,7 +136,7 @@ // Default volume only works on raw Paula channels if(pairedChn[chn] && sample.nVolume < 256) m.SetVolumeCommand(VOLCMD_VOLUME, 64); - + // If channel and sample type don't match, stop this channel (add 100 to the instrument number to make it understandable what happened during import) if((sample.cues[0] == 1 && pairedChn[chn] != 0) || (sample.cues[0] == 0 && pairedChn[chn] == 0)) { @@ -457,7 +457,6 @@ ModSample &mptSample = Samples[smp]; const bool needCopy = mptSample.cues[1] != 0; - mptSample.SetDefaultCuePoints(); if(mptSample.nLength == 0) continue; |
From: <sv...@op...> - 2024-12-11 21:36:15
|
Author: sagamusix Date: Wed Dec 11 22:36:01 2024 New Revision: 22523 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22523 Log: Merged revision(s) 22522 from trunk/OpenMPT: [Imp] Allow fine tempo adjustment shortcuts to also work with formats that don't support fractional tempo. They only affect playback afterall. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/Moddoc.cpp Modified: branches/OpenMPT-1.31/mptrack/Moddoc.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/Moddoc.cpp Wed Dec 11 22:35:38 2024 (r22522) +++ branches/OpenMPT-1.31/mptrack/Moddoc.cpp Wed Dec 11 22:36:01 2024 (r22523) @@ -2779,17 +2779,11 @@ case kcToggleLoopSong: SetLoopSong(!TrackerSettings::Instance().gbLoopSong); break; case kcTempoIncreaseFine: - if(!modSpecs.hasFractionalTempo) - break; - [[fallthrough]]; case kcTempoIncrease: if(auto tempo = m_SndFile.m_PlayState.m_nMusicTempo; tempo < modSpecs.GetTempoMax()) m_SndFile.m_PlayState.m_nMusicTempo = std::min(modSpecs.GetTempoMax(), tempo + TEMPO(wParam == kcTempoIncrease ? 1.0 : 0.1)); break; case kcTempoDecreaseFine: - if(!modSpecs.hasFractionalTempo) - break; - [[fallthrough]]; case kcTempoDecrease: if(auto tempo = m_SndFile.m_PlayState.m_nMusicTempo; tempo > modSpecs.GetTempoMin()) m_SndFile.m_PlayState.m_nMusicTempo = std::max(modSpecs.GetTempoMin(), tempo - TEMPO(wParam == kcTempoDecrease ? 1.0 : 0.1)); |
From: <sv...@op...> - 2024-12-11 21:35:51
|
Author: sagamusix Date: Wed Dec 11 22:35:38 2024 New Revision: 22522 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22522 Log: [Imp] Allow fine tempo adjustment shortcuts to also work with formats that don't support fractional tempo. They only affect playback afterall. Modified: trunk/OpenMPT/mptrack/Moddoc.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp Wed Dec 11 22:34:55 2024 (r22521) +++ trunk/OpenMPT/mptrack/Moddoc.cpp Wed Dec 11 22:35:38 2024 (r22522) @@ -2768,17 +2768,11 @@ case kcToggleLoopSong: SetLoopSong(!TrackerSettings::Instance().gbLoopSong); break; case kcTempoIncreaseFine: - if(!modSpecs.hasFractionalTempo) - break; - [[fallthrough]]; case kcTempoIncrease: if(auto tempo = m_SndFile.m_PlayState.m_nMusicTempo; tempo < modSpecs.GetTempoMax()) m_SndFile.m_PlayState.m_nMusicTempo = std::min(modSpecs.GetTempoMax(), tempo + TEMPO(wParam == kcTempoIncrease ? 1.0 : 0.1)); break; case kcTempoDecreaseFine: - if(!modSpecs.hasFractionalTempo) - break; - [[fallthrough]]; case kcTempoDecrease: if(auto tempo = m_SndFile.m_PlayState.m_nMusicTempo; tempo > modSpecs.GetTempoMin()) m_SndFile.m_PlayState.m_nMusicTempo = std::max(modSpecs.GetTempoMin(), tempo - TEMPO(wParam == kcTempoDecrease ? 1.0 : 0.1)); |
From: <sv...@op...> - 2024-12-11 21:35:08
|
Author: sagamusix Date: Wed Dec 11 22:34:55 2024 New Revision: 22521 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22521 Log: [Imp] VST: Reset position again after rendering one sample, to avoid some of the time reporting to be off by one sample. Modified: trunk/OpenMPT/mptrack/Vstplug.cpp Modified: trunk/OpenMPT/mptrack/Vstplug.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp Wed Dec 11 22:31:16 2024 (r22520) +++ trunk/OpenMPT/mptrack/Vstplug.cpp Wed Dec 11 22:34:55 2024 (r22521) @@ -1444,6 +1444,8 @@ float out = 0.0f; Process(&out, &out, 1); Suspend(); + // As we have now rendered one sample, reset the position change flag again. Otherwise the last bar start position may be off by a sample. + m_positionChanged = true; } } |
From: <sv...@op...> - 2024-12-11 21:31:31
|
Author: sagamusix Date: Wed Dec 11 22:31:16 2024 New Revision: 22520 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22520 Log: [Fix] Process one sample when notifying VST plugins of changing position while playback is stopped. Electri-Q crashes with a heap corruption if we try to process 0 samples. Modified: trunk/OpenMPT/mptrack/Vstplug.cpp trunk/OpenMPT/mptrack/Vstplug.h trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Vstplug.cpp ============================================================================== --- trunk/OpenMPT/mptrack/Vstplug.cpp Wed Dec 11 22:14:06 2024 (r22519) +++ trunk/OpenMPT/mptrack/Vstplug.cpp Wed Dec 11 22:31:16 2024 (r22520) @@ -412,7 +412,7 @@ if(pVstPlugin) { VstTimeInfo &timeInfo = pVstPlugin->timeInfo; - MemsetZero(timeInfo); + mpt::reset(timeInfo); timeInfo.sampleRate = pVstPlugin->m_nSampleRate; if(pVstPlugin->IsSongPlaying()) @@ -1433,6 +1433,20 @@ } } + +void CVstPlugin::PositionChanged() +{ + m_positionChanged = true; + if(!IsResumed()) + { + Resume(); + // Electri-Q crashes with a heap corruption if we try to process 0 samples. + float out = 0.0f; + Process(&out, &out, 1); + Suspend(); + } +} + // Send events to plugin. Returns true if there are events left to be processed. void CVstPlugin::ProcessVSTEvents() Modified: trunk/OpenMPT/mptrack/Vstplug.h ============================================================================== --- trunk/OpenMPT/mptrack/Vstplug.h Wed Dec 11 22:14:06 2024 (r22519) +++ trunk/OpenMPT/mptrack/Vstplug.h Wed Dec 11 22:31:16 2024 (r22520) @@ -37,10 +37,10 @@ { protected: - bool m_maskCrashes; - HMODULE m_hLibrary; + const bool m_maskCrashes; + HMODULE m_hLibrary = nullptr; Vst::AEffect &m_Effect; - Vst::ProcessProc m_pProcessFP = nullptr; // Function pointer to AEffect processReplacing if supported, else process. + Vst::ProcessProc m_pProcessFP = nullptr; // Function pointer to AEffect processReplacing if supported, else process. double lastBarStartPos = -1.0; uint32 m_nSampleRate; @@ -51,13 +51,13 @@ bool m_needIdle : 1; bool m_positionChanged : 1; - VstEventQueue vstEvents; // MIDI events that should be sent to the plugin + VstEventQueue vstEvents; // MIDI events that should be sent to the plugin - Vst::VstTimeInfo timeInfo; + Vst::VstTimeInfo timeInfo{}; public: - const bool isBridged : 1; // True if our built-in plugin bridge is being used. + const bool isBridged : 1; // True if our built-in plugin bridge is being used. private: @@ -165,7 +165,7 @@ void Resume() override; void Suspend() override; - void PositionChanged() override { m_positionChanged = true; } + void PositionChanged() override; // Check whether a VST parameter can be automated bool CanAutomateParameter(PlugParamIndex index); @@ -200,4 +200,4 @@ OPENMPT_NAMESPACE_END -#endif // MPT_WITH_VST \ No newline at end of file +#endif // MPT_WITH_VST Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Wed Dec 11 22:14:06 2024 (r22519) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Wed Dec 11 22:31:16 2024 (r22520) @@ -1024,16 +1024,12 @@ void CSoundFile::UpdatePluginPositions() { #ifndef NO_PLUGINS - float out = 0.0f; for(auto &plugin : m_MixPlugins) { IMixPlugin *pPlugin = plugin.pMixPlugin; if(pPlugin != nullptr && !pPlugin->IsResumed()) { pPlugin->PositionChanged(); - pPlugin->Resume(); - pPlugin->Process(&out, &out, 0); - pPlugin->Suspend(); } } #endif // NO_PLUGINS |
From: <sv...@op...> - 2024-12-11 21:14:19
|
Author: sagamusix Date: Wed Dec 11 22:14:06 2024 New Revision: 22519 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22519 Log: Merged revision(s) 22518 from trunk/OpenMPT: [Fix] SampleList::tooManySamples was not initialized. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/XMTools.h Modified: branches/OpenMPT-1.31/soundlib/XMTools.h ============================================================================== --- branches/OpenMPT-1.31/soundlib/XMTools.h Wed Dec 11 22:13:48 2024 (r22518) +++ branches/OpenMPT-1.31/soundlib/XMTools.h Wed Dec 11 22:14:06 2024 (r22519) @@ -95,7 +95,7 @@ struct SampleList { std::vector<SAMPLEINDEX> samples; // The list of samples to write to the file - bool tooManySamples; // Does the source instrument contain more samples than what we can write? + bool tooManySamples = false; // Does the source instrument contain more samples than what we can write? }; // Convert OpenMPT's internal sample representation to an XMInstrument. |
From: <sv...@op...> - 2024-12-11 21:14:02
|
Author: sagamusix Date: Wed Dec 11 22:13:48 2024 New Revision: 22518 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22518 Log: [Fix] SampleList::tooManySamples was not initialized. Modified: trunk/OpenMPT/soundlib/XMTools.h Modified: trunk/OpenMPT/soundlib/XMTools.h ============================================================================== --- trunk/OpenMPT/soundlib/XMTools.h Wed Dec 11 20:48:04 2024 (r22517) +++ trunk/OpenMPT/soundlib/XMTools.h Wed Dec 11 22:13:48 2024 (r22518) @@ -99,7 +99,7 @@ struct SampleList { std::vector<SAMPLEINDEX> samples; // The list of samples to write to the file - bool tooManySamples; // Does the source instrument contain more samples than what we can write? + bool tooManySamples = false; // Does the source instrument contain more samples than what we can write? }; // Convert OpenMPT's internal sample representation to an XMInstrument. |
From: <sv...@op...> - 2024-12-11 19:48:18
|
Author: sagamusix Date: Wed Dec 11 20:48:04 2024 New Revision: 22517 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22517 Log: Merged revision(s) 22514 from trunk/OpenMPT: [Ref] Silence compiler warning. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/XMTools.cpp Modified: branches/OpenMPT-1.31/soundlib/XMTools.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/XMTools.cpp Wed Dec 11 20:03:54 2024 (r22516) +++ branches/OpenMPT-1.31/soundlib/XMTools.cpp Wed Dec 11 20:48:04 2024 (r22517) @@ -109,7 +109,7 @@ continue; // We haven't considered this sample yet. addedToList[smp - 1] = true; - if(sampleList.samples.size() < (compatibilityExport ? 16 : 32)) + if(sampleList.samples.size() < (compatibilityExport ? 16u : 32u)) sampleList.samples.push_back(smp); else sampleList.tooManySamples = true; |
From: <sv...@op...> - 2024-12-11 19:04:08
|
Author: sagamusix Date: Wed Dec 11 20:03:54 2024 New Revision: 22516 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22516 Log: [Mod] MIDI I/O Plugin: Any empty MIDI macro will now abort reading the macro section. Modified: trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp Modified: trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp ============================================================================== --- trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp Wed Dec 11 19:58:28 2024 (r22515) +++ trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp Wed Dec 11 20:03:54 2024 (r22516) @@ -195,7 +195,7 @@ mpt::IO::WriteRaw(s, m_parameterMacros[i].first.c_str(), m_parameterMacros[i].first.size()); } } - // End of macor section + // End of macro section mpt::IO::WriteIntLE<uint32>(s, 0); mpt::IO::WriteIntLE<uint32>(s, 0); } @@ -284,7 +284,7 @@ while(file.CanRead(sizeof(uint32le) * 2)) { const auto [dumpID, dumpSize] = file.ReadArray<uint32le, 2>(); - if((!dumpID && !dumpSize) || !file.CanRead(dumpSize)) + if(!dumpSize || !file.CanRead(dumpSize)) break; if(dumpID == uint32_max) { |
From: <sv...@op...> - 2024-12-11 18:58:41
|
Author: sagamusix Date: Wed Dec 11 19:58:28 2024 New Revision: 22515 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22515 Log: [Fix] MIDI I/O Plugin: Reserve correct amount of scratch space for macro translation. Modified: trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp trunk/OpenMPT/mptrack/plugins/MidiInOut.h Modified: trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp ============================================================================== --- trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp Wed Dec 11 19:30:04 2024 (r22514) +++ trunk/OpenMPT/mptrack/plugins/MidiInOut.cpp Wed Dec 11 19:58:28 2024 (r22515) @@ -295,12 +295,12 @@ m_parameterMacros.resize(dumpID - kMacroParamMin + 1); auto &str = m_parameterMacros[dumpID - kMacroParamMin].first; file.ReadString<mpt::String::maybeNullTerminated>(str, dumpSize); - m_parameterMacroScratchSpace.reserve(str.size()); std::string::size_type pos; while((pos = str.find_first_not_of(" 0123456789ABCDEFabchmnopsuvxyz")) != std::string::npos) { str.erase(pos, 1); } + m_parameterMacroScratchSpace.reserve(str.size() + 1); } } } Modified: trunk/OpenMPT/mptrack/plugins/MidiInOut.h ============================================================================== --- trunk/OpenMPT/mptrack/plugins/MidiInOut.h Wed Dec 11 19:30:04 2024 (r22514) +++ trunk/OpenMPT/mptrack/plugins/MidiInOut.h Wed Dec 11 19:58:28 2024 (r22515) @@ -65,7 +65,7 @@ // MIDI queue entry with small storage optimiziation. // This optimiziation is going to be used for all messages that OpenMPT can send internally, - // but SysEx messages received from other plugins may be longer. + // but SysEx messages created by this plugin or received from other plugins may be longer. class Message { public: |
From: <sv...@op...> - 2024-12-11 18:30:14
|
Author: sagamusix Date: Wed Dec 11 19:30:04 2024 New Revision: 22514 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22514 Log: [Ref] Silence compiler warning. Modified: trunk/OpenMPT/soundlib/XMTools.cpp Modified: trunk/OpenMPT/soundlib/XMTools.cpp ============================================================================== --- trunk/OpenMPT/soundlib/XMTools.cpp Wed Dec 11 18:58:26 2024 (r22513) +++ trunk/OpenMPT/soundlib/XMTools.cpp Wed Dec 11 19:30:04 2024 (r22514) @@ -110,7 +110,7 @@ continue; // We haven't considered this sample yet. addedToList[smp - 1] = true; - if(sampleList.samples.size() < (compatibilityExport ? 16 : 32)) + if(sampleList.samples.size() < (compatibilityExport ? 16u : 32u)) sampleList.samples.push_back(smp); else sampleList.tooManySamples = true; |
From: <sv...@op...> - 2024-12-11 17:58:44
|
Author: sagamusix Date: Wed Dec 11 18:58:26 2024 New Revision: 22513 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22513 Log: Merged revision(s) 22512 from trunk/OpenMPT: [Imp] MPT Hacks: Warn when an XM instrument uses more than 16 samples (https://bugs.openmpt.org/view.php?id=1846). [Imp] XM: Warn when saving an instrument that references more than 16/32 samples (https://bugs.openmpt.org/view.php?id=1846). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/MPTHacks.cpp branches/OpenMPT-1.31/soundlib/Load_xm.cpp branches/OpenMPT-1.31/soundlib/SampleFormats.cpp branches/OpenMPT-1.31/soundlib/XMTools.cpp branches/OpenMPT-1.31/soundlib/XMTools.h Modified: branches/OpenMPT-1.31/mptrack/MPTHacks.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/MPTHacks.cpp Wed Dec 11 18:56:57 2024 (r22512) +++ branches/OpenMPT-1.31/mptrack/MPTHacks.cpp Wed Dec 11 18:58:26 2024 (r22513) @@ -299,6 +299,7 @@ // Check for instrument extensions foundHere = false; bool foundEnvelopes = false; + INSTRUMENTINDEX instrWithTooManySmps = 0; for(INSTRUMENTINDEX i = 1; i <= m_SndFile.GetNumInstruments(); i++) { ModInstrument *instr = m_SndFile.Instruments[i]; @@ -334,6 +335,9 @@ instr->nFadeOut = ((instr->nFadeOut + 16) / 32) * 32; } + if(modType == MOD_TYPE_XM && instr->GetSamples().size() > 16) + instrWithTooManySmps++; + // Incompatible envelope shape foundEnvelopes |= FindIncompatibleEnvelopes(instr->VolEnv, autofix); foundEnvelopes |= FindIncompatibleEnvelopes(instr->PanEnv, autofix); @@ -344,6 +348,8 @@ AddToLog("Found MPT instrument extensions"); if(foundEnvelopes) AddToLog("Two envelope points may not share the same tick."); + if(instrWithTooManySmps) + AddToLog(MPT_AFORMAT("{} instruments use too many samples (16 allowed)")(instrWithTooManySmps)); // Check for too many orders if(m_SndFile.Order().GetLengthTailTrimmed() > originalSpecs->ordersMax) Modified: branches/OpenMPT-1.31/soundlib/Load_xm.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_xm.cpp Wed Dec 11 18:56:57 2024 (r22512) +++ branches/OpenMPT-1.31/soundlib/Load_xm.cpp Wed Dec 11 18:58:26 2024 (r22513) @@ -1389,9 +1389,11 @@ if(Instruments[ins] != nullptr) { // Convert instrument - insHeader.ConvertToXM(*Instruments[ins], compatibilityExport); + auto sampleList = insHeader.ConvertToXM(*Instruments[ins], compatibilityExport); + samples = std::move(sampleList.samples); + if(sampleList.tooManySamples) + AddToLog(LogInformation, MPT_UFORMAT("Instrument {} references too many samples, only the first {} will be exported.")(ins, samples.size())); - samples = insHeader.instrument.GetSampleList(*Instruments[ins], compatibilityExport); if(samples.size() > 0 && samples[0] <= GetNumSamples()) { // Copy over auto-vibrato settings of first sample Modified: branches/OpenMPT-1.31/soundlib/SampleFormats.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/SampleFormats.cpp Wed Dec 11 18:56:57 2024 (r22512) +++ branches/OpenMPT-1.31/soundlib/SampleFormats.cpp Wed Dec 11 18:58:26 2024 (r22513) @@ -1360,9 +1360,11 @@ // Create file header XIInstrumentHeader header; - header.ConvertToXM(*pIns, false); + const auto sampleList = header.ConvertToXM(*pIns, false); + const auto &samples = sampleList.samples; + if(sampleList.tooManySamples) + AddToLog(LogInformation, MPT_UFORMAT("This instrument references too many samples, only the first {} will be exported.")(samples.size())); - const std::vector<SAMPLEINDEX> samples = header.instrument.GetSampleList(*pIns, false); if(samples.size() > 0 && samples[0] <= GetNumSamples()) { // Copy over auto-vibrato settings of first sample Modified: branches/OpenMPT-1.31/soundlib/XMTools.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/XMTools.cpp Wed Dec 11 18:56:57 2024 (r22512) +++ branches/OpenMPT-1.31/soundlib/XMTools.cpp Wed Dec 11 18:58:26 2024 (r22513) @@ -54,7 +54,7 @@ // Convert OpenMPT's internal sample representation to an XMInstrument. -uint16 XMInstrument::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XMInstrument::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { MemsetZero(*this); @@ -74,53 +74,49 @@ pitchWheelRange = std::min(mptIns.midiPWD, int8(36)); // Create sample assignment table - auto sampleList = GetSampleList(mptIns, compatibilityExport); + const auto sampleList = GetSampleList(mptIns, compatibilityExport); for(std::size_t i = 0; i < std::size(sampleMap); i++) { if(mptIns.Keyboard[i + 12] > 0) { - auto sample = std::find(sampleList.begin(), sampleList.end(), mptIns.Keyboard[i + 12]); - if(sample != sampleList.end()) + auto sample = std::find(sampleList.samples.begin(), sampleList.samples.end(), mptIns.Keyboard[i + 12]); + if(sample != sampleList.samples.end()) { // Yep, we want to export this sample. - sampleMap[i] = static_cast<uint8>(sample - sampleList.begin()); + sampleMap[i] = static_cast<uint8>(std::distance(sampleList.samples.begin(), sample)); } } } - return static_cast<uint16>(sampleList.size()); + return sampleList; } // Get a list of samples that should be written to the file. -std::vector<SAMPLEINDEX> XMInstrument::GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const +XMInstrument::SampleList XMInstrument::GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const { - std::vector<SAMPLEINDEX> sampleList; // List of samples associated with this instrument - std::vector<bool> addedToList; // Which samples did we already add to the sample list? + SampleList sampleList; // List of samples associated with this instrument + std::vector<bool> addedToList; // Which samples did we already add to the sample list? - uint8 numSamples = 0; for(std::size_t i = 0; i < std::size(sampleMap); i++) { const SAMPLEINDEX smp = mptIns.Keyboard[i + 12]; - if(smp > 0) - { - if(smp > addedToList.size()) - { - addedToList.resize(smp, false); - } - - if(!addedToList[smp - 1] && numSamples < (compatibilityExport ? 16 : 32)) - { - // We haven't considered this sample yet. - addedToList[smp - 1] = true; - numSamples++; - sampleList.push_back(smp); - } - } + if(smp == 0) + continue; + if(smp > addedToList.size()) + addedToList.resize(smp, false); + if(addedToList[smp - 1]) + continue; + // We haven't considered this sample yet. + addedToList[smp - 1] = true; + if(sampleList.samples.size() < (compatibilityExport ? 16 : 32)) + sampleList.samples.push_back(smp); + else + sampleList.tooManySamples = true; } // FT2 completely ignores MIDI settings (and also the less important stuff) if not at least one (empty) sample is assigned to this instrument! - if(sampleList.empty() && compatibilityExport && midiEnabled) - sampleList.assign(1, 0); + if(sampleList.samples.empty() && compatibilityExport && midiEnabled) + sampleList.samples.assign(1, 0); return sampleList; } @@ -247,12 +243,14 @@ // Convert OpenMPT's internal sample representation to an XMInstrumentHeader. -void XMInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XMInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { - numSamples = instrument.ConvertToXM(mptIns, compatibilityExport); + const auto sampleList = instrument.ConvertToXM(mptIns, compatibilityExport); + numSamples = static_cast<uint16>(sampleList.samples.size()); mpt::String::WriteBuf(mpt::String::spacePadded, name) = mptIns.name; type = mptIns.nMidiProgram; // If FT2 writes crap here, we can do so, too! (we probably shouldn't, though. This is just for backwards compatibility with old MPT versions.) + return sampleList; } @@ -284,9 +282,10 @@ // Convert OpenMPT's internal sample representation to an XIInstrumentHeader. -void XIInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XIInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { - numSamples = instrument.ConvertToXM(mptIns, compatibilityExport); + const auto sampleList = instrument.ConvertToXM(mptIns, compatibilityExport); + numSamples = static_cast<uint16>(sampleList.samples.size()); memcpy(signature, "Extended Instrument: ", 21); mpt::String::WriteBuf(mpt::String::spacePadded, name) = mptIns.name; @@ -296,6 +295,7 @@ mpt::String::WriteBuf(mpt::String::spacePadded, trackerName) = openMptTrackerName; version = 0x102; + return sampleList; } Modified: branches/OpenMPT-1.31/soundlib/XMTools.h ============================================================================== --- branches/OpenMPT-1.31/soundlib/XMTools.h Wed Dec 11 18:56:57 2024 (r22512) +++ branches/OpenMPT-1.31/soundlib/XMTools.h Wed Dec 11 18:58:26 2024 (r22513) @@ -28,7 +28,7 @@ }; char signature[17]; // "Extended Module: " - char songName[20]; // Song Name, not null-terminated (any nulls are treated as spaces) + char songName[20]; // Song Name, space-padded uint8le eof; // DOS EOF Character (0x1A) char trackerName[20]; // Software that was used to create the XM file uint16le version; // File version (1.02 - 1.04 are supported) @@ -92,8 +92,14 @@ // Convert XM envelope data to an OpenMPT's internal envelope representation. void ConvertEnvelopeToMPT(InstrumentEnvelope &mptEnv, uint8 numPoints, uint8 flags, uint8 sustain, uint8 loopStart, uint8 loopEnd, EnvType env) const; + struct SampleList + { + std::vector<SAMPLEINDEX> samples; // The list of samples to write to the file + bool tooManySamples; // Does the source instrument contain more samples than what we can write? + }; + // Convert OpenMPT's internal sample representation to an XMInstrument. - uint16 ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XMInstrument to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; // Apply auto-vibrato settings from sample to file. @@ -102,7 +108,7 @@ void ApplyAutoVibratoToMPT(ModSample &mptSmp) const; // Get a list of samples that should be written to the file. - std::vector<SAMPLEINDEX> GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const; + SampleList GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const; }; MPT_BINARY_STRUCT(XMInstrument, 230) @@ -112,8 +118,8 @@ struct XMInstrumentHeader { uint32le size; // Size of XMInstrumentHeader + XMInstrument - char name[22]; // Instrument Name, not null-terminated (any nulls are treated as spaces) - uint8le type; // Instrument Type (Apparently FT2 writes some crap here, but it's the same crap for all instruments of the same module!) + char name[22]; // Instrument Name, space-padded + uint8le type; // Instrument Type (FT2 does not initialize this field properly, so it contains a random value, but it's the same random value for all instruments of the same module!) uint16le numSamples; // Number of Samples associated with instrument uint32le sampleHeaderSize; // Size of XMSample XMInstrument instrument; @@ -122,7 +128,7 @@ void Finalise(); // Convert OpenMPT's internal sample representation to an XMInstrument. - void ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + XMInstrument::SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XMInstrument to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; }; @@ -139,7 +145,7 @@ }; char signature[21]; // "Extended Instrument: " - char name[22]; // Instrument Name, not null-terminated (any nulls are treated as spaces) + char name[22]; // Instrument Name, space-padded uint8le eof; // DOS EOF Character (0x1A) char trackerName[20]; // Software that was used to create the XI file uint16le version; // File Version (1.02) @@ -147,7 +153,7 @@ uint16le numSamples; // Number of embedded sample headers + samples // Convert OpenMPT's internal sample representation to an XIInstrumentHeader. - void ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + XMInstrument::SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XIInstrumentHeader to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; }; @@ -176,7 +182,7 @@ uint8le pan; // Sample Panning int8le relnote; // Sample Transpose uint8le reserved; // Reserved (abused for ModPlug's ADPCM compression) - char name[22]; // Sample Name, not null-terminated (any nulls are treated as spaces) + char name[22]; // Sample Name, space-padded // Convert OpenMPT's internal sample representation to an XMSample. void ConvertToXM(const ModSample &mptSmp, MODTYPE fromType, bool compatibilityExport); |
From: <sv...@op...> - 2024-12-11 17:57:21
|
Author: sagamusix Date: Wed Dec 11 18:56:57 2024 New Revision: 22512 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22512 Log: [Imp] MPT Hacks: Warn when an XM instrument uses more than 16 samples (https://bugs.openmpt.org/view.php?id=1846). [Imp] XM: Warn when saving an instrument that references more than 16/32 samples (https://bugs.openmpt.org/view.php?id=1846). Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/XMTools.cpp trunk/OpenMPT/soundlib/XMTools.h Modified: trunk/OpenMPT/mptrack/MPTHacks.cpp ============================================================================== --- trunk/OpenMPT/mptrack/MPTHacks.cpp Wed Dec 11 18:55:17 2024 (r22511) +++ trunk/OpenMPT/mptrack/MPTHacks.cpp Wed Dec 11 18:56:57 2024 (r22512) @@ -311,6 +311,7 @@ // Check for instrument extensions foundHere = false; bool foundEnvelopes = false; + INSTRUMENTINDEX instrWithTooManySmps = 0; for(INSTRUMENTINDEX i = 1; i <= m_SndFile.GetNumInstruments(); i++) { ModInstrument *instr = m_SndFile.Instruments[i]; @@ -346,6 +347,9 @@ instr->nFadeOut = ((instr->nFadeOut + 16) / 32) * 32; } + if(modType == MOD_TYPE_XM && instr->GetSamples().size() > 16) + instrWithTooManySmps++; + // Incompatible envelope shape foundEnvelopes |= FindIncompatibleEnvelopes(instr->VolEnv, autofix); foundEnvelopes |= FindIncompatibleEnvelopes(instr->PanEnv, autofix); @@ -356,6 +360,8 @@ AddToLog("Found MPT instrument extensions"); if(foundEnvelopes) AddToLog("Two envelope points may not share the same tick"); + if(instrWithTooManySmps) + AddToLog(MPT_AFORMAT("{} instruments use too many samples (16 allowed)")(instrWithTooManySmps)); for(auto &order : m_SndFile.Order) { Modified: trunk/OpenMPT/soundlib/Load_xm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp Wed Dec 11 18:55:17 2024 (r22511) +++ trunk/OpenMPT/soundlib/Load_xm.cpp Wed Dec 11 18:56:57 2024 (r22512) @@ -1390,9 +1390,11 @@ if(Instruments[ins] != nullptr) { // Convert instrument - insHeader.ConvertToXM(*Instruments[ins], compatibilityExport); + auto sampleList = insHeader.ConvertToXM(*Instruments[ins], compatibilityExport); + samples = std::move(sampleList.samples); + if(sampleList.tooManySamples) + AddToLog(LogInformation, MPT_UFORMAT("Instrument {} references too many samples, only the first {} will be exported.")(ins, samples.size())); - samples = insHeader.instrument.GetSampleList(*Instruments[ins], compatibilityExport); if(samples.size() > 0 && samples[0] <= GetNumSamples()) { // Copy over auto-vibrato settings of first sample Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp Wed Dec 11 18:55:17 2024 (r22511) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp Wed Dec 11 18:56:57 2024 (r22512) @@ -1360,9 +1360,11 @@ // Create file header XIInstrumentHeader header; - header.ConvertToXM(*pIns, false); + const auto sampleList = header.ConvertToXM(*pIns, false); + const auto &samples = sampleList.samples; + if(sampleList.tooManySamples) + AddToLog(LogInformation, MPT_UFORMAT("This instrument references too many samples, only the first {} will be exported.")(samples.size())); - const std::vector<SAMPLEINDEX> samples = header.instrument.GetSampleList(*pIns, false); if(samples.size() > 0 && samples[0] <= GetNumSamples()) { // Copy over auto-vibrato settings of first sample Modified: trunk/OpenMPT/soundlib/XMTools.cpp ============================================================================== --- trunk/OpenMPT/soundlib/XMTools.cpp Wed Dec 11 18:55:17 2024 (r22511) +++ trunk/OpenMPT/soundlib/XMTools.cpp Wed Dec 11 18:56:57 2024 (r22512) @@ -55,7 +55,7 @@ // Convert OpenMPT's internal sample representation to an XMInstrument. -uint16 XMInstrument::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XMInstrument::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { MemsetZero(*this); @@ -75,53 +75,49 @@ pitchWheelRange = std::min(mptIns.midiPWD, int8(36)); // Create sample assignment table - auto sampleList = GetSampleList(mptIns, compatibilityExport); + const auto sampleList = GetSampleList(mptIns, compatibilityExport); for(std::size_t i = 0; i < std::size(sampleMap); i++) { if(mptIns.Keyboard[i + 12] > 0) { - auto sample = std::find(sampleList.begin(), sampleList.end(), mptIns.Keyboard[i + 12]); - if(sample != sampleList.end()) + auto sample = std::find(sampleList.samples.begin(), sampleList.samples.end(), mptIns.Keyboard[i + 12]); + if(sample != sampleList.samples.end()) { // Yep, we want to export this sample. - sampleMap[i] = static_cast<uint8>(sample - sampleList.begin()); + sampleMap[i] = static_cast<uint8>(std::distance(sampleList.samples.begin(), sample)); } } } - return static_cast<uint16>(sampleList.size()); + return sampleList; } // Get a list of samples that should be written to the file. -std::vector<SAMPLEINDEX> XMInstrument::GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const +XMInstrument::SampleList XMInstrument::GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const { - std::vector<SAMPLEINDEX> sampleList; // List of samples associated with this instrument - std::vector<bool> addedToList; // Which samples did we already add to the sample list? + SampleList sampleList; // List of samples associated with this instrument + std::vector<bool> addedToList; // Which samples did we already add to the sample list? - uint8 numSamples = 0; for(std::size_t i = 0; i < std::size(sampleMap); i++) { const SAMPLEINDEX smp = mptIns.Keyboard[i + 12]; - if(smp > 0) - { - if(smp > addedToList.size()) - { - addedToList.resize(smp, false); - } - - if(!addedToList[smp - 1] && numSamples < (compatibilityExport ? 16 : 32)) - { - // We haven't considered this sample yet. - addedToList[smp - 1] = true; - numSamples++; - sampleList.push_back(smp); - } - } + if(smp == 0) + continue; + if(smp > addedToList.size()) + addedToList.resize(smp, false); + if(addedToList[smp - 1]) + continue; + // We haven't considered this sample yet. + addedToList[smp - 1] = true; + if(sampleList.samples.size() < (compatibilityExport ? 16 : 32)) + sampleList.samples.push_back(smp); + else + sampleList.tooManySamples = true; } // FT2 completely ignores MIDI settings (and also the less important stuff) if not at least one (empty) sample is assigned to this instrument! - if(sampleList.empty() && compatibilityExport && midiEnabled) - sampleList.assign(1, 0); + if(sampleList.samples.empty() && compatibilityExport && midiEnabled) + sampleList.samples.assign(1, 0); return sampleList; } @@ -248,12 +244,14 @@ // Convert OpenMPT's internal sample representation to an XMInstrumentHeader. -void XMInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XMInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { - numSamples = instrument.ConvertToXM(mptIns, compatibilityExport); + const auto sampleList = instrument.ConvertToXM(mptIns, compatibilityExport); + numSamples = static_cast<uint16>(sampleList.samples.size()); mpt::String::WriteBuf(mpt::String::spacePadded, name) = mptIns.name; type = mptIns.nMidiProgram; // If FT2 writes crap here, we can do so, too! (we probably shouldn't, though. This is just for backwards compatibility with old MPT versions.) + return sampleList; } @@ -285,9 +283,10 @@ // Convert OpenMPT's internal sample representation to an XIInstrumentHeader. -void XIInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) +XMInstrument::SampleList XIInstrumentHeader::ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport) { - numSamples = instrument.ConvertToXM(mptIns, compatibilityExport); + const auto sampleList = instrument.ConvertToXM(mptIns, compatibilityExport); + numSamples = static_cast<uint16>(sampleList.samples.size()); memcpy(signature, "Extended Instrument: ", 21); mpt::String::WriteBuf(mpt::String::spacePadded, name) = mptIns.name; @@ -297,6 +296,7 @@ mpt::String::WriteBuf(mpt::String::spacePadded, trackerName) = openMptTrackerName; version = 0x102; + return sampleList; } Modified: trunk/OpenMPT/soundlib/XMTools.h ============================================================================== --- trunk/OpenMPT/soundlib/XMTools.h Wed Dec 11 18:55:17 2024 (r22511) +++ trunk/OpenMPT/soundlib/XMTools.h Wed Dec 11 18:56:57 2024 (r22512) @@ -32,7 +32,7 @@ }; char signature[17]; // "Extended Module: " - char songName[20]; // Song Name, not null-terminated (any nulls are treated as spaces) + char songName[20]; // Song Name, space-padded uint8le eof; // DOS EOF Character (0x1A) char trackerName[20]; // Software that was used to create the XM file uint16le version; // File version (1.02 - 1.04 are supported) @@ -96,8 +96,14 @@ // Convert XM envelope data to an OpenMPT's internal envelope representation. void ConvertEnvelopeToMPT(InstrumentEnvelope &mptEnv, uint8 numPoints, uint8 flags, uint8 sustain, uint8 loopStart, uint8 loopEnd, EnvType env) const; + struct SampleList + { + std::vector<SAMPLEINDEX> samples; // The list of samples to write to the file + bool tooManySamples; // Does the source instrument contain more samples than what we can write? + }; + // Convert OpenMPT's internal sample representation to an XMInstrument. - uint16 ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XMInstrument to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; // Apply auto-vibrato settings from sample to file. @@ -106,7 +112,7 @@ void ApplyAutoVibratoToMPT(ModSample &mptSmp) const; // Get a list of samples that should be written to the file. - std::vector<SAMPLEINDEX> GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const; + SampleList GetSampleList(const ModInstrument &mptIns, bool compatibilityExport) const; }; MPT_BINARY_STRUCT(XMInstrument, 230) @@ -116,8 +122,8 @@ struct XMInstrumentHeader { uint32le size; // Size of XMInstrumentHeader + XMInstrument - char name[22]; // Instrument Name, not null-terminated (any nulls are treated as spaces) - uint8le type; // Instrument Type (Apparently FT2 writes some crap here, but it's the same crap for all instruments of the same module!) + char name[22]; // Instrument Name, space-padded + uint8le type; // Instrument Type (FT2 does not initialize this field properly, so it contains a random value, but it's the same random value for all instruments of the same module!) uint16le numSamples; // Number of Samples associated with instrument uint32le sampleHeaderSize; // Size of XMSample XMInstrument instrument; @@ -126,7 +132,7 @@ void Finalise(); // Convert OpenMPT's internal sample representation to an XMInstrument. - void ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + XMInstrument::SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XMInstrument to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; }; @@ -143,7 +149,7 @@ }; char signature[21]; // "Extended Instrument: " - char name[22]; // Instrument Name, not null-terminated (any nulls are treated as spaces) + char name[22]; // Instrument Name, space-padded uint8le eof; // DOS EOF Character (0x1A) char trackerName[20]; // Software that was used to create the XI file uint16le version; // File Version (1.02) @@ -151,7 +157,7 @@ uint16le numSamples; // Number of embedded sample headers + samples // Convert OpenMPT's internal sample representation to an XIInstrumentHeader. - void ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); + XMInstrument::SampleList ConvertToXM(const ModInstrument &mptIns, bool compatibilityExport); // Convert an XIInstrumentHeader to OpenMPT's internal instrument representation. void ConvertToMPT(ModInstrument &mptIns) const; }; @@ -180,7 +186,7 @@ uint8le pan; // Sample Panning int8le relnote; // Sample Transpose uint8le reserved; // Reserved (abused for ModPlug's ADPCM compression) - char name[22]; // Sample Name, not null-terminated (any nulls are treated as spaces) + char name[22]; // Sample Name, space-padded // Convert OpenMPT's internal sample representation to an XMSample. void ConvertToXM(const ModSample &mptSmp, MODTYPE fromType, bool compatibilityExport); |
From: <sv...@op...> - 2024-12-11 17:55:29
|
Author: sagamusix Date: Wed Dec 11 18:55:17 2024 New Revision: 22511 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22511 Log: [Mod] TCB: Remove default assignment of special values again. The early TCB Tracker betas / demo use this format, and the special effect mechanism is completely non-functional there. Modified: trunk/OpenMPT/soundlib/Load_tcb.cpp Modified: trunk/OpenMPT/soundlib/Load_tcb.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_tcb.cpp Wed Dec 11 14:36:15 2024 (r22510) +++ trunk/OpenMPT/soundlib/Load_tcb.cpp Wed Dec 11 18:55:17 2024 (r22511) @@ -22,7 +22,7 @@ uint8 tempo; uint8 unused1; uint8 order[128]; - uint8 restartOrder; + uint8 numOrders; uint8 unused2; // Supposed to be part of lastOrder but then it would have to be a little-endian word bool IsNewFormat() const @@ -34,7 +34,7 @@ { if(memcmp(magic, "AN COOL.", 8) && memcmp(magic, "AN COOL!", 8)) return false; - if(tempo > 15 || unused1 || restartOrder > 127 || unused2 || numPatterns > 128) + if(tempo > 15 || unused1 || numOrders > 127 || unused2 || numPatterns > 128) return false; for(uint8 ord : order) { @@ -85,7 +85,7 @@ SetupMODPanning(true); Order().SetDefaultSpeed(16 - fileHeader.tempo); Order().SetDefaultTempoInt(125); - ReadOrderFromArray(Order(), fileHeader.order, std::max(uint8(1), fileHeader.restartOrder)); + ReadOrderFromArray(Order(), fileHeader.order, std::max(uint8(1), fileHeader.numOrders)); m_nSamplePreAmp = 64; m_SongFlags.set(SONG_IMPORTED); m_playBehaviour.set(kApplyUpperPeriodLimit); @@ -102,14 +102,7 @@ const auto instrNames = file.ReadArray<char[8], 16>(); std::array<int16be, 16> specialValues{}; if(newFormat) - { file.ReadStruct(specialValues); - } else - { - // A pure guess, the only old-format file I found doesn't even use these... - static constexpr std::array<int16, 16> defaultSpecialValues{0, 10, 30, 50, 70, 90, -10, -30, -50, -70, -90, 0, 0, 0, 0, 0}; - std::copy(defaultSpecialValues.begin(), defaultSpecialValues.end(), specialValues.begin()); - } m_nMinPeriod = useAmigaFreqs ? 113 * 4 : 92 * 4; m_nMaxPeriod = useAmigaFreqs ? 856 * 4 : 694 * 4; |
From: <sv...@op...> - 2024-12-11 13:36:29
|
Author: manx Date: Wed Dec 11 14:36:15 2024 New Revision: 22510 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22510 Log: Merged revision(s) 22509 from trunk/OpenMPT: [Ref] build: CI: GitHub: CPA: NetBSD: Remove work-around for <https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58432>. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/.github/workflows/NetBSD-Autotools.yml branches/OpenMPT-1.31/.github/workflows/NetBSD-Makefile.yml Modified: branches/OpenMPT-1.31/.github/workflows/NetBSD-Autotools.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/NetBSD-Autotools.yml Wed Dec 11 14:35:50 2024 (r22509) +++ branches/OpenMPT-1.31/.github/workflows/NetBSD-Autotools.yml Wed Dec 11 14:36:15 2024 (r22510) @@ -47,7 +47,7 @@ run: | sudo pkgin -y update sudo pkgin -y full-upgrade - sudo pkgin -y install subversion-base p5-subversion py311-subversion ruby32-subversion git p5-XML-XPath mawk + sudo pkgin -y install subversion git p5-XML-XPath mawk sudo pkgin -y install gmake pkgconf sudo pkgin -y install mpg123 libogg libvorbis flac libsndfile pulseaudio portaudio SDL2 sudo pkgin -y install autoconf autoconf-archive automake libtool libltdl Modified: branches/OpenMPT-1.31/.github/workflows/NetBSD-Makefile.yml ============================================================================== --- branches/OpenMPT-1.31/.github/workflows/NetBSD-Makefile.yml Wed Dec 11 14:35:50 2024 (r22509) +++ branches/OpenMPT-1.31/.github/workflows/NetBSD-Makefile.yml Wed Dec 11 14:36:15 2024 (r22510) @@ -51,7 +51,7 @@ run: | sudo pkgin -y update sudo pkgin -y full-upgrade - sudo pkgin -y install subversion-base p5-subversion py311-subversion ruby32-subversion git p5-XML-XPath mawk + sudo pkgin -y install subversion git p5-XML-XPath mawk sudo pkgin -y install gmake pkgconf sudo pkgin -y install mpg123 libogg libvorbis flac libsndfile pulseaudio portaudio SDL2 sudo pkgin -y install autoconf autoconf-archive automake libtool libltdl |
From: <sv...@op...> - 2024-12-11 13:36:09
|
Author: manx Date: Wed Dec 11 14:35:50 2024 New Revision: 22509 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22509 Log: [Ref] build: CI: GitHub: CPA: NetBSD: Remove work-around for <https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=58432>. Modified: trunk/OpenMPT/.github/workflows/NetBSD-Autotools.yml trunk/OpenMPT/.github/workflows/NetBSD-Makefile.yml Modified: trunk/OpenMPT/.github/workflows/NetBSD-Autotools.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/NetBSD-Autotools.yml Wed Dec 11 14:34:37 2024 (r22508) +++ trunk/OpenMPT/.github/workflows/NetBSD-Autotools.yml Wed Dec 11 14:35:50 2024 (r22509) @@ -49,7 +49,7 @@ run: | sudo pkgin -y update sudo pkgin -y full-upgrade - sudo pkgin -y install subversion-base p5-subversion py311-subversion ruby32-subversion git p5-XML-XPath mawk + sudo pkgin -y install subversion git p5-XML-XPath mawk sudo pkgin -y install gmake pkgconf sudo pkgin -y install mpg123 libogg libvorbis flac libsndfile pulseaudio portaudio SDL2 sudo pkgin -y install autoconf autoconf-archive automake libtool libltdl Modified: trunk/OpenMPT/.github/workflows/NetBSD-Makefile.yml ============================================================================== --- trunk/OpenMPT/.github/workflows/NetBSD-Makefile.yml Wed Dec 11 14:34:37 2024 (r22508) +++ trunk/OpenMPT/.github/workflows/NetBSD-Makefile.yml Wed Dec 11 14:35:50 2024 (r22509) @@ -53,7 +53,7 @@ run: | sudo pkgin -y update sudo pkgin -y full-upgrade - sudo pkgin -y install subversion-base p5-subversion py311-subversion ruby32-subversion git p5-XML-XPath mawk + sudo pkgin -y install subversion git p5-XML-XPath mawk sudo pkgin -y install gmake pkgconf sudo pkgin -y install mpg123 libogg libvorbis flac libsndfile pulseaudio portaudio SDL2 sudo pkgin -y install autoconf autoconf-archive automake libtool libltdl |