USTのテンポの丸めを1箇所へ集約

このコミットが含まれているのは:
routersys committed 2026-08-19 14:13:40 +09:00
1 親 fb28206a38
コミット caecdb1092
1ファイル変更
+6 -3
+6 -3
ファイルの表示
@@ -47,7 +47,7 @@ internal static class UstImporter
var sectionTempo = ParseNumber(section.Find(UstKeys.Tempo));
var isTempoChange = IsUsableTempo(sectionTempo) && Math.Abs(sectionTempo!.Value - currentTempo) > TempoEpsilon;
if (isTempoChange)
currentTempo = Math.Clamp(sectionTempo!.Value, TimeBase.MinimumTempo, TimeBase.MaximumTempo);
currentTempo = ClampTempo(sectionTempo!.Value);
var note = CreateNote(section, noteLength, new TimeBase(currentTempo, 1.0));
if (isTempoChange)
@@ -186,18 +186,21 @@ internal static class UstImporter
{
var declared = ParseNumber(document.Setting?.Find(UstKeys.Tempo));
if (IsUsableTempo(declared))
return declared!.Value;
return ClampTempo(declared!.Value);
foreach (var section in document.NoteSections)
{
var noteTempo = ParseNumber(section.Find(UstKeys.Tempo));
if (IsUsableTempo(noteTempo))
return noteTempo!.Value;
return ClampTempo(noteTempo!.Value);
}
return TimeBase.DefaultTempo;
}
static double ClampTempo(double tempo)
=> Math.Clamp(tempo, TimeBase.MinimumTempo, TimeBase.MaximumTempo);
static bool IsUsableTempo(double? tempo) => tempo is > 0.0 and <= MaximumDeclaredTempo;
static string NormalizeLyric(string? text)