Exemple #1
0
        private static void CheckEndTime <TTimeSpan>(ITimeSpan time, ITimeSpan length, TTimeSpan expectedEndTime)
            where TTimeSpan : ITimeSpan
        {
            var tempoMap = TempoMap.Default;
            var chord    = new ChordMethods().Create(time, length, tempoMap);

            TimeSpanTestUtilities.AreEqual(expectedEndTime, chord.EndTimeAs <TTimeSpan>(tempoMap), "End time is invalid.");
        }
Exemple #2
0
        public void GetDuration_Metric()
        {
            var midiFile = new PatternBuilder()
                           .SetNoteLength(new MetricTimeSpan(0, 0, 1))
                           .Note(DryWetMidi.MusicTheory.NoteName.CSharp)
                           .Repeat(9)
                           .Build()
                           .ToFile(TempoMap.Default);

            var duration = midiFile.GetDuration(TimeSpanType.Metric);

            TimeSpanTestUtilities.AreEqual(new MetricTimeSpan(0, 0, 10), duration, "Duration of MIDI file is invalid.");
        }