Esempio n. 1
0
        public static void RecalculateNoteTimes <T>(this IEnumerable <IMeasure <T> > measures,
                                                    Tempo tempo, double songLength, double offset = 0) where T : class, ITimeIndexed, INoteValued, IMeasureTimed
        {
            var songSegments = TimeUtilities.CalculateSongSegments(tempo, songLength, offset);
            var tracker      = new NoteTimeTracker(songSegments);

            foreach (var measure in measures)
            {
                tracker.NewMeasure(measure.BeatSpaceLength());

                foreach (var note in measure.Notes)
                {
                    note.Time = tracker.CalculateNoteTimeFromMeasureTime(note.NormalizedMeasureTime);
                }
            }
        }