From: <sv...@op...> - 2024-05-06 21:33:25
|
Author: sagamusix Date: Mon May 6 23:33:13 2024 New Revision: 20719 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20719 Log: [Imp] Mod conversion: Attempt to convert HMN mega-arp command at least partially. Modified: trunk/OpenMPT/soundlib/Sndmix.cpp trunk/OpenMPT/soundlib/Tables.cpp trunk/OpenMPT/soundlib/Tables.h trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/soundlib/Sndmix.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp Mon May 6 23:23:53 2024 (r20718) +++ trunk/OpenMPT/soundlib/Sndmix.cpp Mon May 6 23:33:13 2024 (r20719) @@ -1627,27 +1627,8 @@ } } else if(chn.rowCommand.command == CMD_HMN_MEGA_ARP) { - static constexpr std::array<uint8, 16> MegaArp[] = - { - {0, 3, 7, 12, 15, 12, 7, 3, 0, 3, 7, 12, 15, 12, 7, 3 }, - {0, 4, 7, 12, 16, 12, 7, 4, 0, 4, 7, 12, 16, 12, 7, 4 }, - {0, 3, 8, 12, 15, 12, 8, 3, 0, 3, 8, 12, 15, 12, 8, 3 }, - {0, 4, 8, 12, 16, 12, 8, 4, 0, 4, 8, 12, 16, 12, 8, 4 }, - {0, 5, 8, 12, 17, 12, 8, 5, 0, 5, 8, 12, 17, 12, 8, 5 }, - {0, 5, 9, 12, 17, 12, 9, 5, 0, 5, 9, 12, 17, 12, 9, 5 }, - {12, 0, 7, 0, 3, 0, 7, 0, 12, 0, 7, 0, 3, 0, 7, 0 }, - {12, 0, 7, 0, 4, 0, 7, 0, 12, 0, 7, 0, 4, 0, 7, 0 }, - {0, 3, 7, 3, 7, 12, 7, 12, 15, 12, 7, 12, 7, 3, 7, 3 }, - {0, 4, 7, 4, 7, 12, 7, 12, 16, 12, 7, 12, 7, 4, 7, 4 }, - {31, 27, 24, 19, 15, 12, 7, 3, 0, 3, 7, 12, 15, 19, 24, 27}, - {31, 28, 24, 19, 16, 12, 7, 4, 0, 4, 7, 12, 16, 19, 24, 28}, - {0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12}, - {0, 12, 24, 12, 0, 12, 24, 12, 0, 12, 24, 12, 0, 12, 24, 12}, - {0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3 }, - {0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4 } - }; uint8 note = static_cast<uint8>(GetNoteFromPeriod(period, chn.nFineTune, chn.nC5Speed)); - note += MegaArp[chn.rowCommand.param & 0x0F][chn.nArpeggio & 0x0F]; + note += HisMastersNoiseMegaArp[chn.rowCommand.param & 0x0F][chn.nArpeggio & 0x0F]; chn.nArpeggio++; period = GetPeriodFromNote(note, chn.nFineTune, chn.nC5Speed); } Modified: trunk/OpenMPT/soundlib/Tables.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp Mon May 6 23:23:53 2024 (r20718) +++ trunk/OpenMPT/soundlib/Tables.cpp Mon May 6 23:33:13 2024 (r20719) @@ -692,6 +692,28 @@ }; +// Note LUT for His Master's Noise command 7 (Mega-Arp) +const std::array<uint8, 16> HisMastersNoiseMegaArp[16] = +{ + {0, 3, 7, 12, 15, 12, 7, 3, 0, 3, 7, 12, 15, 12, 7, 3 }, + {0, 4, 7, 12, 16, 12, 7, 4, 0, 4, 7, 12, 16, 12, 7, 4 }, + {0, 3, 8, 12, 15, 12, 8, 3, 0, 3, 8, 12, 15, 12, 8, 3 }, + {0, 4, 8, 12, 16, 12, 8, 4, 0, 4, 8, 12, 16, 12, 8, 4 }, + {0, 5, 8, 12, 17, 12, 8, 5, 0, 5, 8, 12, 17, 12, 8, 5 }, + {0, 5, 9, 12, 17, 12, 9, 5, 0, 5, 9, 12, 17, 12, 9, 5 }, + {12, 0, 7, 0, 3, 0, 7, 0, 12, 0, 7, 0, 3, 0, 7, 0 }, + {12, 0, 7, 0, 4, 0, 7, 0, 12, 0, 7, 0, 4, 0, 7, 0 }, + {0, 3, 7, 3, 7, 12, 7, 12, 15, 12, 7, 12, 7, 3, 7, 3 }, + {0, 4, 7, 4, 7, 12, 7, 12, 16, 12, 7, 12, 7, 4, 7, 4 }, + {31, 27, 24, 19, 15, 12, 7, 3, 0, 3, 7, 12, 15, 19, 24, 27}, + {31, 28, 24, 19, 16, 12, 7, 4, 0, 4, 7, 12, 16, 19, 24, 28}, + {0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12, 0, 12}, + {0, 12, 24, 12, 0, 12, 24, 12, 0, 12, 24, 12, 0, 12, 24, 12}, + {0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3 }, + {0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4 } +}; + + ///////////////////////////////////////////////////////////////////////////////////////////// Modified: trunk/OpenMPT/soundlib/Tables.h ============================================================================== --- trunk/OpenMPT/soundlib/Tables.h Mon May 6 23:23:53 2024 (r20718) +++ trunk/OpenMPT/soundlib/Tables.h Mon May 6 23:33:13 2024 (r20719) @@ -39,6 +39,7 @@ extern const uint32 LinearSlideUpTable[256]; extern const uint32 LinearSlideDownTable[256]; extern const uint16 XMPanningTable[256]; +extern const std::array<uint8, 16> HisMastersNoiseMegaArp[16]; extern const uint8 AutoVibratoIT2XM[8]; extern const uint8 AutoVibratoXM2IT[8]; Modified: trunk/OpenMPT/soundlib/modcommand.cpp ============================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp Mon May 6 23:23:53 2024 (r20718) +++ trunk/OpenMPT/soundlib/modcommand.cpp Mon May 6 23:33:13 2024 (r20719) @@ -917,6 +917,10 @@ if((command == CMD_REVERSEOFFSET || command == CMD_OFFSETPERCENTAGE) && !newSpecs.HasCommand(command)) { command = CMD_OFFSET; + } else if(command == CMD_HMN_MEGA_ARP && !newSpecs.HasCommand(CMD_HMN_MEGA_ARP)) + { + command = CMD_ARPEGGIO; + param = (HisMastersNoiseMegaArp[param & 0x0F][1] << 4) | HisMastersNoiseMegaArp[param & 0x0F][2]; } if(!newSpecs.HasNote(note)) |