diff --git a/CHANGELOG.md b/CHANGELOG.md index 0febe23..ce16da3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Added LobbyCompatibility to dependencies to avoid desync issues. - Fixed lyrics not being displayed in some situations. - Fixed minor visual issue with the fade out effect. +- Fixed visual glitch at the last beat of a loop. ## MuzikaGromche 13.37.911 - Sri Lanka Bus hotfix diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index b5bec9e..12b2566 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -921,26 +921,20 @@ namespace MuzikaGromche } public readonly float Duration() - { - return Split().Sum(span => span.BeatToInclusive - span.BeatFromExclusive); - } - - public readonly BeatTimeSpan[] Split() { if (IsEmpty()) { - return []; + return 0f; } else if (IsWrapped()) { - return [ - new BeatTimeSpan(LoopBeats, isLooping: false, beatFromExclusive: /* epsilon */ -0.001f, beatToInclusive: BeatToInclusive), - new BeatTimeSpan(LoopBeats, isLooping: false, beatFromExclusive: BeatFromExclusive, beatToInclusive: LoopBeats), - ]; + var beforeWrapping = LoopBeats - BeatFromExclusive; + var afterWrapping = BeatToInclusive - 0f; + return beforeWrapping + afterWrapping; } else { - return [this]; + return BeatToInclusive - BeatFromExclusive; } } @@ -1197,7 +1191,6 @@ namespace MuzikaGromche // // Otherwise there is no transition running at this time. const float currentClipLength = 1f; - // var currentClipSpan = BeatTimespan timestamp.Floor() var currentClipStart = timestamp.Floor(); var currentClipEnd = currentClipStart + currentClipLength;