Author: sagamusix
Date: Sat Jun 1 23:19:57 2024
New Revision: 20898
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20898
Log:
[Fix] FTM: The song tempo appears to fluctuate - especially on the first played beat the tempo appears to be slower, although this sometimes repeats at later points in time. Change the tempo conversion so that it matches the tempo that FTM hits *mpst of the time*. Fixes stomper.ftm.
Modified:
trunk/OpenMPT/soundlib/InstrumentSynth.cpp
trunk/OpenMPT/soundlib/Load_ftm.cpp
Modified: trunk/OpenMPT/soundlib/InstrumentSynth.cpp
==============================================================================
--- trunk/OpenMPT/soundlib/InstrumentSynth.cpp Sat Jun 1 16:38:52 2024 (r20897)
+++ trunk/OpenMPT/soundlib/InstrumentSynth.cpp Sat Jun 1 23:19:57 2024 (r20898)
@@ -809,7 +809,7 @@
playState.m_nGlobalVolume = event.u16;
return false;
case Event::Type::FTM_SetTempo:
- playState.m_nMusicTempo = TEMPO(1766278.163 / event.u16);
+ playState.m_nMusicTempo = TEMPO(1777517.482 / event.u16);
return false;
case Event::Type::FTM_SetSpeed:
playState.m_nMusicSpeed = event.u16;
Modified: trunk/OpenMPT/soundlib/Load_ftm.cpp
==============================================================================
--- trunk/OpenMPT/soundlib/Load_ftm.cpp Sat Jun 1 16:38:52 2024 (r20897)
+++ trunk/OpenMPT/soundlib/Load_ftm.cpp Sat Jun 1 23:19:57 2024 (r20898)
@@ -29,7 +29,7 @@
uint8 version; // ...I guess?
uint8 numSamples; // 0...63
uint16be numMeasures;
- uint16be tempo; // Smaller values = faster, the default of 14209 is ~124.307 BPM
+ uint16be tempo; // Smaller values = faster, the default of 14209 is ~125.098 BPM (though it seems to fluctuate and *sometimes* it drops to 124.307 BPM?)
uint8 tonality; // Not relevant for playback (0 = C/a, 1 = Db/bb, etc.)
uint8 muteStatus;
uint8 globalVolume; // 0...63
@@ -115,7 +115,7 @@
m_playBehaviour.set(kST3NoMutedChannels);
m_playBehaviour.set(kApplyUpperPeriodLimit);
Order().SetDefaultSpeed(fileHeader.ticksPerRow);
- Order().SetDefaultTempo(TEMPO(1766278.163 / fileHeader.tempo));
+ Order().SetDefaultTempo(TEMPO(1777517.482 / fileHeader.tempo));
m_nDefaultRowsPerMeasure = fileHeader.rowsPerMeasure;
if(fileHeader.ticksPerRow == 2 || fileHeader.ticksPerRow == 4 || fileHeader.ticksPerRow == 8 || fileHeader.ticksPerRow == 16)
m_nDefaultRowsPerBeat = m_nDefaultRowsPerMeasure / 3;
|