sinmai-mods/MoreChartFormats/Simai/BpmChangeDataExtensions.cs
2024-05-27 10:59:40 +07:00

15 lines
397 B
C#

using Manager;
namespace MoreChartFormats.Simai;
public static class BpmChangeDataExtensions
{
public static float SecondsPerBar(this BPMChangeData timing)
{
// Work under the assumption that 1 bar = 4 beats
// which is kinda true because the meter is always 4/4.
// 240 is 60 * 4.
return timing.bpm == 0 ? 0 : 240f / timing.bpm;
}
}