diff --git a/Vocaluxe/Base/CGame.cs b/Vocaluxe/Base/CGame.cs index 9c2b6c7d..25d8ac8f 100644 --- a/Vocaluxe/Base/CGame.cs +++ b/Vocaluxe/Base/CGame.cs @@ -242,6 +242,11 @@ namespace Vocaluxe.Base _MidBeatD = -0.5f + GetBeatFromTime(Time, song.BPM, song.Gap + CConfig.MicDelay/1000f); _CurrentBeatD = (int)Math.Floor(_MidBeatD); + for (int p = 0; p < _NumPlayer; p++) + { + CSound.AnalyzeBuffer(p); + } + if (_OldBeatD == _CurrentBeatD) return; @@ -298,7 +303,6 @@ namespace Vocaluxe.Base } } - CSound.AnalyzeBuffer(p); if (notes[Note].PointsForBeat > 0 && (CSound.RecordToneValid(p) || DEBUG_HIT)) { int Tone = notes[Note].Tone; diff --git a/Vocaluxe/Base/CSound.cs b/Vocaluxe/Base/CSound.cs index e7956ecb..440d405d 100644 --- a/Vocaluxe/Base/CSound.cs +++ b/Vocaluxe/Base/CSound.cs @@ -297,26 +297,53 @@ namespace Vocaluxe.Base public int ToneAbs { - get { return _ToneAbs; } + get + { + lock (_AnalysisBufferLock) + { + return _ToneAbs; + } + } } public int Tone { - get { return _Tone; } - set { _Tone = value; } + get + { + lock (_AnalysisBufferLock) + { + return _Tone; + } + } + set + { + lock (_AnalysisBufferLock) + { + _Tone = value; + } + } } public float MaxVolume { get { - return (float)_MaxVolume; + lock (_AnalysisBufferLock) + { + return (float)_MaxVolume; + } } } public bool ToneValid { - get { return _ToneValid; } + get + { + lock (_AnalysisBufferLock) + { + return _ToneValid; + } + } } public CBuffer() @@ -415,7 +442,7 @@ namespace Vocaluxe.Base _MaxVolume = Volume; } - if (_MaxVolume >= 0.2f) + if (_MaxVolume >= 0.05f) { // analyse the current voice pitch AnalyzeByAutocorrelation(); diff --git a/Vocaluxe/Menu/SingNotes/CSingNotes.cs b/Vocaluxe/Menu/SingNotes/CSingNotes.cs index a157e9fa..b475142c 100644 --- a/Vocaluxe/Menu/SingNotes/CSingNotes.cs +++ b/Vocaluxe/Menu/SingNotes/CSingNotes.cs @@ -400,7 +400,9 @@ namespace Vocaluxe.Menu.SingNotes if (note.EndBeat >= CGame.ActBeatD && note.Hit && note.NoteType == ENoteType.Golden) { - AddFlare(rect, n); + SRectF re = new SRectF(rect); + re.W = (CGame.MidBeatD - note.StartBeat) / beats * w; + AddFlare(re, n); } if (note.Perfect && note.EndBeat < CGame.ActBeatD)