fix empty pattern duration calculation.

This commit is contained in:
Vixalie 2025-03-11 22:37:37 +08:00
parent 03fe09d1ce
commit abee609e43

View File

@ -117,7 +117,7 @@ export function totalDuration(pattern: Pattern): number {
return reduce(
pattern.pulses,
(former, pulse) => former + pulse.offset,
pattern.smoothRepeat ? 100 : 0,
pattern.smoothRepeat && pattern.pulses.length > 1 ? 100 : 0,
);
}