diff --git a/Assets/Cryville/Crtr/Extensions/Malody/MalodyChartConverter.cs b/Assets/Cryville/Crtr/Extensions/Malody/MalodyChartConverter.cs index 21be3ae..094d99e 100644 --- a/Assets/Cryville/Crtr/Extensions/Malody/MalodyChartConverter.cs +++ b/Assets/Cryville/Crtr/Extensions/Malody/MalodyChartConverter.cs @@ -74,16 +74,17 @@ namespace Cryville.Crtr.Extensions.Malody { Dictionary longEvents = new Dictionary(); - float? baseBpm = null; + float? baseBpm = null, cbpm = null; float pbeat = 0f, ctime = 0f; int[] endbeat = new int[] { 0, 0, 1 }; foreach (var ev in events) { float cbeat = ConvertBeat(ev.beat); - ctime += baseBpm == null ? 0 : (cbeat - pbeat) / baseBpm.Value * 60f; + ctime += cbpm == null ? 0 : (cbeat - pbeat) / cbpm.Value * 60f; pbeat = cbeat; if (ev is MalodyChart.Time) { var tev = (MalodyChart.Time)ev; if (baseBpm == null) baseBpm = tev.bpm; + cbpm = tev.bpm; chart.sigs.Add(new Chart.Signature { time = new BeatTime(ev.beat[0], ev.beat[1], ev.beat[2]), tempo = tev.bpm, @@ -165,7 +166,7 @@ namespace Cryville.Crtr.Extensions.Malody { } #pragma warning disable IDE1006 - public struct MalodyChart { + struct MalodyChart { public interface IEvent { int[] beat { get; set; } int[] endbeat { get; set; }