diff --git a/src/NotesLoaderKSF.cpp b/src/NotesLoaderKSF.cpp index fdd93670c5..e920e53974 100644 --- a/src/NotesLoaderKSF.cpp +++ b/src/NotesLoaderKSF.cpp @@ -496,7 +496,52 @@ static void LoadTags( const RString &str, Song &out ) } static void ProcessTickcounts( const RString & value, int & ticks, TimingData & timing ) -{ +{ + /* adapt tickcounts // + // valid tickcounts for SM: 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 64, ROWS_PER_BEAT + // put this inside the tickcount handling condition yes/no + + if( iTickCount > ROWS_PER_BEAT ) // beyond 48 + { + // clamp/scale/whatever and use scroll segments + } + else if( iTickCount > 32 || iTickCount < ROWS_PER_BEAT ) // ranging from 33 to 48, approximate to 32 + { + fScrollRatio = 32; + iTickCount = 32; + } + else if( iTickCount > 24 || iTickCount < 32 ) // ranging from 25 to 31, approximate to 24 + { + fScrollRatio = 24; + iTickCount = 24; + } + else if( iTickCount > 16 || iTickCount < 24 ) // ranging from 17 to 23, approximate to 16 + { + fScrollRatio = 16; + iTickCount = 16; + } + else if( iTickCount > 12 || iTickCount < 16 ) // ranging from 13 to 15, approximate to 12 + { + fScrollRatio = 12; + iTickCount = 12; + } + else if( iTickCount > 8 || iTickCount < 12 ) // ranging from 9 to 11, approximate to 8 + { + fScrollRatio = 8; + iTickCount = 8; + } + else if( iTickCount > 6 || iTickCount < 8 ) // 7, approximate to 6 + { + fScrollRatio = 6 / iTickCountt; + iTickCount = 6; + } + else if( iTickCount > 4 || iTickCount < 6 ) // 5, approximate to 4 + { + fScrollRatio = iTickCount / 4; + iTickCount = 4; + } + //*/ + /* TICKCOUNT will be used below if there are DM compliant BPM changes * and stops. It will be called again in LoadFromKSFFile for the * actual steps. */ diff --git a/src/NotesLoaderMidi.cpp b/src/NotesLoaderMidi.cpp index e1cdabe15d..f356cdb3d6 100644 --- a/src/NotesLoaderMidi.cpp +++ b/src/NotesLoaderMidi.cpp @@ -677,7 +677,7 @@ static bool LoadFromMidi( const RString &sPath, Song &songOut ) FOREACH_CONST( MidiFileIn::TempoChange, midi.tempoEvents_, iter ) { - BPMSegment * bpmSeg; + BPMSegment * bpmSeg = NULL; bpmSeg->SetRow( MidiCountToNoteRow( iter->count ) ); double fSecondsPerBeat = (iter->tickSeconds * GUITAR_MIDI_COUNTS_PER_BEAT); bpmSeg->SetBPS( float( 1. / fSecondsPerBeat ) ); diff --git a/src/NotesLoaderSSC.cpp b/src/NotesLoaderSSC.cpp index 4475916620..bcefb97fad 100644 --- a/src/NotesLoaderSSC.cpp +++ b/src/NotesLoaderSSC.cpp @@ -161,7 +161,7 @@ bool SSCLoader::LoadNoteDataFromSimfile( const RString & cachePath, Steps &out ) } bool tryingSteps = false; - float storedVersion; + float storedVersion = 0; const unsigned values = msd.GetNumValues(); for (unsigned i = 0; i < values; i++)