From: <sag...@us...> - 2013-07-01 23:48:56
|
Revision: 2477 http://sourceforge.net/p/modplug/code/2477 Author: saga-games Date: 2013-07-01 23:48:48 +0000 (Mon, 01 Jul 2013) Log Message: ----------- [Imp] PTM: Semi-working note slides (seems to be slightly buggy in PolyTracker, but luckily noone seems to have used them for precise slides anyway) Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/modcommand.cpp trunk/OpenMPT/soundlib/modcommand.h Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -124,7 +124,7 @@ MODCOLOR_GLOBALS, 0, MODCOLOR_PITCH, MODCOLOR_PANNING, MODCOLOR_PITCH, MODCOLOR_PANNING, 0, 0, 0, 0, 0, MODCOLOR_PITCH, - MODCOLOR_PITCH, 0, + MODCOLOR_PITCH, MODCOLOR_PITCH, MODCOLOR_PITCH, 0, }; STATIC_ASSERT(CountOf(effectColors) == MAX_EFFECTS); Modified: trunk/OpenMPT/mptrack/EffectInfo.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/mptrack/EffectInfo.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -114,9 +114,11 @@ // -> DESC="add extended parameter mechanism to pattern effects" {CMD_XPARAM, 0x00,0x00, 0, MOD_TYPE_XMITMPT, "Parameter Extension"}, // -! NEW_FEATURE#0010 - {CMD_NOTESLIDEUP, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Up"}, // .IMF effect - {CMD_NOTESLIDEDOWN, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Down"}, // .IMF effect - {CMD_REVERSEOFFSET, 0x00,0x00, 0, MOD_TYPE_NONE, "Revert Sample + Offset"}, // .PTM effect + {CMD_NOTESLIDEUP, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Up"}, // IMF / PTM effect + {CMD_NOTESLIDEDOWN, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Down"}, // IMF / PTM effect + {CMD_NOTESLIDEUPRETRIG, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Up + Retrigger Note"}, // PTM effect + {CMD_NOTESLIDEDOWNRETRIG, 0x00,0x00, 0, MOD_TYPE_NONE, "Note Slide Down+ Retrigger Note"}, // PTM effect + {CMD_REVERSEOFFSET, 0x00,0x00, 0, MOD_TYPE_NONE, "Revert Sample + Offset"}, // PTM effect }; Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -179,7 +179,7 @@ mpt::String::Read<mpt::String::maybeNullTerminated>(m_szNames[smp + 1], sampleHeader.samplename); SampleIO sampleIO = sampleHeader.ConvertToMPT(sample); - if((loadFlags & loadSampleData) && sample.nLength && sampleHeader.dataOffset && file.Seek(sampleHeader.dataOffset)) + if((loadFlags & loadSampleData) && sample.nLength && file.Seek(sampleHeader.dataOffset)) { sampleIO.ReadSample(sample, file); } @@ -230,7 +230,7 @@ m.command = file.ReadUint8(); m.param = file.ReadUint8(); - const ModCommand::COMMAND effTrans[] = { CMD_GLOBALVOLUME, CMD_RETRIG, CMD_FINEVIBRATO, CMD_NONE, CMD_NONE, CMD_NONE, CMD_NONE, CMD_REVERSEOFFSET }; + const ModCommand::COMMAND effTrans[] = { CMD_GLOBALVOLUME, CMD_RETRIG, CMD_FINEVIBRATO, CMD_NOTESLIDEUP, CMD_NOTESLIDEDOWN, CMD_NOTESLIDEUPRETRIG, CMD_NOTESLIDEDOWNRETRIG, CMD_REVERSEOFFSET }; if(m.command < 0x10) { // Beware: Effect letters are as in MOD, but portamento and volume slides behave like in S3M (i.e. fine slides share the same effect letters) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -2615,13 +2615,14 @@ } break; - // IMF Commands + // IMF / PTM Note Slides case CMD_NOTESLIDEUP: - NoteSlide(pChn, param, true); - break; - case CMD_NOTESLIDEDOWN: - NoteSlide(pChn, param, false); + case CMD_NOTESLIDEUPRETRIG: + case CMD_NOTESLIDEDOWNRETRIG: + // Note that this command seems to be a bit buggy in Polytracker... Luckily, no tune seems to seriously use this + // (Vic uses it e.g. in Spaceman or Perfect Reason to slide effect samples, noone will notice the difference :) + NoteSlide(pChn, param, cmd == CMD_NOTESLIDEUP || cmd == CMD_NOTESLIDEUPRETRIG, cmd == CMD_NOTESLIDEUPRETRIG || cmd == CMD_NOTESLIDEDOWNRETRIG); break; // PTM Reverse sample + offset (executed on every tick) @@ -2631,7 +2632,7 @@ pChn->dwFlags.set(CHN_PINGPONGFLAG); pChn->dwFlags.reset(CHN_LOOP); pChn->nLength = pChn->pModSample->nLength; // If there was a loop, extend sample to whole length. - pChn->nPos = (pChn->nLength - 1) - std::min<SmpLength>(SmpLength(pChn->rowCommand.param) << 8, pChn->nLength - 1); + pChn->nPos = (pChn->nLength - 1) - std::min<SmpLength>(SmpLength(param) << 8, pChn->nLength - 1); pChn->nPosLo = 0; } break; @@ -3007,8 +3008,8 @@ // Implemented for IMF compatibility, can't actually save this in any formats // sign should be 1 (up) or -1 (down) -void CSoundFile::NoteSlide(ModChannel *pChn, UINT param, bool slideUp) -//-------------------------------------------------------------------- +void CSoundFile::NoteSlide(ModChannel *pChn, UINT param, bool slideUp, bool retrig) +//--------------------------------------------------------------------------------- { uint8 x, y; if(m_SongFlags[SONG_FIRSTTICK]) @@ -3028,6 +3029,11 @@ // update it pChn->nPeriod = GetPeriodFromNote ((slideUp ? 1 : -1) * pChn->nNoteSlideStep + GetNoteFromPeriod(pChn->nPeriod), 8363, 0); + + if(retrig) + { + pChn->nPos = pChn->nPosLo = 0; + } } } } Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/Sndfile.h 2013-07-01 23:48:48 UTC (rev 2477) @@ -725,7 +725,7 @@ void FinePortamentoDown(ModChannel *pChn, UINT param); void ExtraFinePortamentoUp(ModChannel *pChn, UINT param); void ExtraFinePortamentoDown(ModChannel *pChn, UINT param); - void NoteSlide(ModChannel *pChn, UINT param, bool slideUp); + void NoteSlide(ModChannel *pChn, UINT param, bool slideUp, bool retrig); void TonePortamento(ModChannel *pChn, UINT param); void Vibrato(ModChannel *pChn, UINT param); void FineVibrato(ModChannel *pChn, UINT param); Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -52,7 +52,7 @@ true, // Has song comments MAX_ENVPOINTS, // Envelope point count true, // Has envelope release node - " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#???", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\:#?????", // Supported Effects " vpcdabuhlrgfe?o", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "---" pattern @@ -97,7 +97,7 @@ false, // No song comments 0, // No instrument envelopes false, // No envelope release node - " 0123456789ABCD?FF?E??????????????????", // Supported Effects + " 0123456789ABCD?FF?E????????????????????", // Supported Effects " ???????????????", // Supported Volume Column commands false, // Doesn't have "+++" pattern false, // Doesn't have "---" pattern @@ -140,7 +140,7 @@ false, // No song comments 12, // Envelope point count false, // No envelope release node - " 0123456789ABCDRFFTE???GHK??XPL???????", // Supported Effects + " 0123456789ABCDRFFTE???GHK??XPL?????????", // Supported Effects " vpcdabuhlrg????", // Supported Volume Column commands false, // Doesn't have "+++" pattern false, // Doesn't have "---" pattern @@ -183,7 +183,7 @@ true, // Has song comments 12, // Envelope point count false, // No envelope release node - " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#???", // Supported Effects + " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#?????", // Supported Effects " vpcdabuhlrgfe?o", // Supported Volume Column commands false, // Doesn't have "+++" pattern false, // Doesn't have "---" pattern @@ -225,7 +225,7 @@ false, // No song comments 0, // No instrument envelopes false, // No envelope release node - " JFEGHLKRXODB?CQATI?SMNVW?U???????????", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?U?????????????", // Supported Effects " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "---" pattern @@ -268,7 +268,7 @@ false, // No song comments 0, // No instrument envelopes false, // No envelope release node - " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z??????", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z????????", // Supported Effects " vp?????????????", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "---" pattern @@ -310,7 +310,7 @@ true, // Has song comments 25, // Envelope point count false, // No envelope release node - " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z??????", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z????????", // Supported Effects " vpcdab?h??gfe??", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "--" pattern @@ -352,7 +352,7 @@ true, // Has song comments 25, // Envelope point count false, // No envelope release node - " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#???", // Supported Effects + " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#?????", // Supported Effects " vpcdab?h??gfe?o", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "---" pattern Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2013-07-01 23:48:48 UTC (rev 2477) @@ -766,7 +766,9 @@ CMD_SMOOTHMIDI, CMD_PANNINGSLIDE, CMD_PANNING8, + CMD_NOTESLIDEUPRETRIG, CMD_NOTESLIDEUP, + CMD_NOTESLIDEDOWNRETRIG, CMD_NOTESLIDEDOWN, CMD_PORTAMENTOUP, CMD_PORTAMENTODOWN, Modified: trunk/OpenMPT/soundlib/modcommand.h =================================================================== --- trunk/OpenMPT/soundlib/modcommand.h 2013-07-01 23:35:46 UTC (rev 2476) +++ trunk/OpenMPT/soundlib/modcommand.h 2013-07-01 23:48:48 UTC (rev 2477) @@ -89,10 +89,12 @@ CMD_SMOOTHMIDI = 32, //rewbs.smoothVST CMD_DELAYCUT = 33, CMD_XPARAM = 34, // -> CODE#0010 -> DESC="add extended parameter mechanism to pattern effects" -! NEW_FEATURE#0010 - CMD_NOTESLIDEUP = 35, // IMF Gxy - CMD_NOTESLIDEDOWN = 36, // IMF Hxy - CMD_REVERSEOFFSET = 37, // PTM Revert sample + offset - MAX_EFFECTS = 38 + CMD_NOTESLIDEUP = 35, // IMF Gxy / PTM Jxy (Slide y notes up every ticks) + CMD_NOTESLIDEDOWN = 36, // IMF Hxy / PTM Kxy (Slide y notes down every ticks) + CMD_NOTESLIDEUPRETRIG = 37, // PTM Lxy (Slide y notes up every ticks + retrigger note) + CMD_NOTESLIDEDOWNRETRIG = 38, // PTM Mxy (Slide y notes down every ticks + retrigger note) + CMD_REVERSEOFFSET = 39, // PTM Nxx Revert sample + offset + MAX_EFFECTS = 40 }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |