From: <sag...@us...> - 2014-10-21 16:37:52
|
Revision: 4457 http://sourceforge.net/p/modplug/code/4457 Author: saga-games Date: 2014-10-21 16:37:44 +0000 (Tue, 21 Oct 2014) Log Message: ----------- [Imp] Playback: Smooth MIDI macros do now, to some extent, work with external MIDI messages. They always rely on previous Zxx or \xx commands from the same channel. [Mod] OpenMPT: Version is now 1.24.00.12 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/ModChannel.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-10-21 15:08:04 UTC (rev 4456) +++ trunk/OpenMPT/common/versionNumber.h 2014-10-21 16:37:44 UTC (rev 4457) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 00 -#define VER_MINORMINOR 11 +#define VER_MINORMINOR 12 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/soundlib/ModChannel.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.cpp 2014-10-21 15:08:04 UTC (rev 4456) +++ trunk/OpenMPT/soundlib/ModChannel.cpp 2014-10-21 16:37:44 UTC (rev 4457) @@ -38,6 +38,7 @@ nTremorCount = 0; nEFxSpeed = 0; proTrackerOffset = 0; + lastZxxParam = 0xFF; isFirstTick = false; } Modified: trunk/OpenMPT/soundlib/ModChannel.h =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h 2014-10-21 15:08:04 UTC (rev 4456) +++ trunk/OpenMPT/soundlib/ModChannel.h 2014-10-21 16:37:44 UTC (rev 4457) @@ -111,6 +111,7 @@ uint8 nActiveMacro, nFilterMode; uint8 nEFxSpeed, nEFxDelay; // memory for Invert Loop (EFx, .MOD only) uint8 nNoteSlideCounter, nNoteSlideSpeed, nNoteSlideStep; // IMF / PTM Note Slide + uint8 lastZxxParam; // Memory for \xx slides bool isFirstTick; ModCommand rowCommand; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-10-21 15:08:04 UTC (rev 4456) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-10-21 16:37:44 UTC (rev 4457) @@ -4050,11 +4050,12 @@ void CSoundFile::ProcessMIDIMacro(CHANNELINDEX nChn, bool isSmooth, char *macro, uint8 param, PLUGINDEX plugin) //------------------------------------------------------------------------------------------------------------- { - const ModChannel *pChn = &m_PlayState.Chn[nChn]; + ModChannel *pChn = &m_PlayState.Chn[nChn]; const ModInstrument *pIns = GetNumInstruments() ? pChn->pModInstrument : nullptr; unsigned char out[MACRO_LENGTH]; size_t outPos = 0; // output buffer position, which also equals the number of complete bytes + const uint8 lastZxxParam = pChn->lastZxxParam; bool firstNibble = true; for(size_t pos = 0; pos < (MACRO_LENGTH - 1) && macro[pos]; pos++) @@ -4121,7 +4122,15 @@ } } else if(macro[pos] == 'z') // z: macro data { - data = (unsigned char)(param & 0x7F); + data = param & 0x7F; + if(isSmooth && pChn->lastZxxParam < 0x80 + && (outPos < 3 || out[outPos - 3] != 0xF0 || out[outPos - 2] < 0xF0)) + { + // Interpolation for external MIDI messages - interpolation for internal messages + // is handled separately to allow for more than 7-bit granularity where it's possible + data = (uint8)CalculateSmoothParamChange((float)lastZxxParam, (float)data); + } + pChn->lastZxxParam = data; } else // unrecognized byte (e.g. space char) { continue; @@ -4230,7 +4239,7 @@ //--------------------------------------------------------------------------------- { MPT_ASSERT(GetNumTicksOnCurrentRow() > m_PlayState.m_nTickCount); - const UINT ticksLeft = GetNumTicksOnCurrentRow() - m_PlayState.m_nTickCount; + const uint32 ticksLeft = GetNumTicksOnCurrentRow() - m_PlayState.m_nTickCount; if(ticksLeft > 1) { // Slide param This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |