Add an "Autosync Tempo" feature. This uses a linear Least Squares

Regression to figure out a line through the user's step errors to minimize
that error.  It then uses the slope of that line to fix the tempo and the
intercept to fix the offset.  Stops are adjusted as if they were originally
calculated as a number of beats, ie the slope is also used to change
the stops.

Also fixed is a bug where the user doesn't get a chance to keep or
reject the sync changes when ESCing (ZZing) from a song.

R=glenn
This commit is contained in:
John Bauer
2006-10-26 22:41:40 +00:00
parent ce94e14f03
commit 37f9178f61
19 changed files with 338 additions and 59 deletions
+2 -2
View File
@@ -94,7 +94,7 @@ void ScreenGameplaySyncMachine::ResetAndRestartCurrentSong()
StartPlayingSong( 4, 0 );
// reset autosync
AdjustSync::s_iAutosyncOffsetSample = 0;
AdjustSync::ResetAutosync();
}
static LocalizedString OLD_OFFSET ( "ScreenGameplaySyncMachine", "Old offset" );
@@ -110,7 +110,7 @@ void ScreenGameplaySyncMachine::RefreshText()
s += OLD_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fOld );
s += NEW_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fNew );
s += STANDARD_DEVIATION.GetValue() + ssprintf( ": %0.3f\n", fStdDev );
s += COLLECTING_SAMPLE.GetValue() + ssprintf( ": %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, SAMPLE_COUNT );
s += COLLECTING_SAMPLE.GetValue() + ssprintf( ": %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, AdjustSync::OFFSET_SAMPLE_COUNT );
m_textSyncInfo.SetText( s );
}