Пример #1
0
        public static Note Execute(Tact tact)
        {
            var result = new Note();

            foreach (var current in tact.Notes)
            {
                if (result.Denominator == default)
                {
                    result.Numerator   = current.Numerator;
                    result.Denominator = current.Denominator;

                    continue;
                }
                if (current.Denominator == result.Denominator)
                {
                    result.Numerator++;
                    continue;
                }

                LeadToCommonDenominator(result, current);
                result.Numerator += current.Numerator;
            }

            Optimizator.ExecuteForNote(result);
            return(result);
        }