
        public static double CalculateMainBPM(Beatmap beatmap)
        {
            // beatLength, duration of that beatLength
            var beatLengthsDuration = new Dictionary<double, int>();
            var uninheritedTimingPoints = beatmap.TimingPoints.Where(t => t.Uninherited).ToList();
            if (!uninheritedTimingPoints.Any())
                return 0;
            for (int i = 0; i < uninheritedTimingPoints.Count - 1; i++)