示例#1
0
        /// <summary>
        /// Clones the current <see cref="TempoMap"/>.
        /// </summary>
        /// <returns>An instance of the <see cref="TempoMap"/> which is a clone of the current one.</returns>
        public TempoMap Clone()
        {
            var tempoMap = new TempoMap(TimeDivision.Clone());

            tempoMap.Tempo.ReplaceValues(Tempo);
            tempoMap.TimeSignature.ReplaceValues(TimeSignature);

            return(tempoMap);
        }
示例#2
0
        public MidiFile GetNextSlice(long endTime, SliceMidiFileSettings settings)
        {
            var timedEvents = GetNextTimedEvents(endTime, settings.PreserveTimes);
            var trackChunks = timedEvents.Select(e => e.ToTrackChunk())
                              .Where(c => settings.PreserveTrackChunks || c.Events.Any())
                              .ToList();

            var file = new MidiFile(trackChunks)
            {
                TimeDivision = _timeDivision.Clone()
            };

            return(file);
        }