Exemple #1
0
        public void It_should_be_able_to_get_a_sequence_position_from_only_the_default_tempo()
        {
            var timetable = new Timetable(Tempo.FromBPM(120));

            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.Zero),
                Is.EqualTo(BeatPointFloat.Zero),
                "Invalid at 0.0 sec."
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(2.0f)),
                Is.EqualTo(BeatPointFloat.At(4.0f)),
                "Invalid at 2.0 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(2.75f)),
                Is.EqualTo(BeatPointFloat.At(5.5f)),
                "Invalid at 2.65 sec"
                );
        }
Exemple #2
0
        public void It_should_be_able_to_get_a_beat_count_from_the_reversed_tempo_controls()
        {
            var timetable = new Timetable(Tempo.FromBPM(120));

            timetable.Add(BeatPoint.At(4, 0, 1), Tempo.FromBPM(-60));
            timetable.Add(BeatPoint.At(6, 0, 1), Tempo.FromBPM(30));
            timetable.Add(BeatPoint.At(7, 0, 1), Tempo.FromBPM(-15));
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.Zero),
                Is.EqualTo(BeatPointFloat.Zero),
                "Invalid at 0.0 sec."
                );
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.AtSeconds(0.25f)),
                Is.EqualTo(BeatPointFloat.At(0.5f)),
                "Invalid at 0.25 sec"
                );
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.AtSeconds(2.0f)),
                Is.EqualTo(BeatPointFloat.At(4.0f)),
                "Invalid at 2.0 sec"
                );
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.AtSeconds(3.0f)),
                Is.EqualTo(BeatPointFloat.At(5.0f)),
                "Invalid at 3.0 sec"
                );
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.AtSeconds(5.5f)),
                Is.EqualTo(BeatPointFloat.At(6.75f)),
                "Invalid at 5.5 sec"
                );
            Assert.That(
                timetable.GetBeatTimeAt(TimePoint.AtSeconds(10.0f)),
                Is.EqualTo(BeatPointFloat.At(8.0f)),
                "Invalid at 10.0 sec"
                );
        }
Exemple #3
0
        public void It_should_be_able_to_get_a_sequence_position_from_the_stop_sequence_controls()
        {
            var timetable = new Timetable(Tempo.FromBPM(120));

            timetable.Add(BeatPoint.At(4, 0, 1), Tempo.FromBPM(-60), BeatDuration.One);
            timetable.Add(BeatPoint.At(6, 0, 1), Tempo.FromBPM(30), BeatDuration.One);
            timetable.Add(BeatPoint.At(7, 0, 1), Tempo.FromBPM(-15), BeatDuration.One);
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.Zero),
                Is.EqualTo(BeatPointFloat.Zero),
                "Invalid at 0.0 sec."
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(0.25f)),
                Is.EqualTo(BeatPointFloat.At(0.5f)),
                "Invalid at 0.25 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(2.0f)),
                Is.EqualTo(BeatPointFloat.At(4.0f)),
                "Invalid at 2.0 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(4.0f)),
                Is.EqualTo(BeatPointFloat.At(3.0f)),
                "Invalid at 4.0 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(8.5f)),
                Is.EqualTo(BeatPointFloat.At(2.75f)),
                "Invalid at 8.5 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(12.0f)),
                Is.EqualTo(BeatPointFloat.At(3.0f)),
                "Invalid at 12.0 sec"
                );
        }
Exemple #4
0
        public void It_should_be_able_to_get_a_sequence_position_from_only_the_positive_tempo_controls()
        {
            var timetable = new Timetable(Tempo.FromBPM(120));

            timetable.Add(BeatPoint.At(4, 0, 1), Tempo.FromBPM(60));
            timetable.Add(BeatPoint.At(6, 0, 1), Tempo.FromBPM(30));
            timetable.Add(BeatPoint.At(7, 0, 1), Tempo.FromBPM(15));
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.Zero),
                Is.EqualTo(BeatPointFloat.Zero),
                "Invalid at 0.0 sec."
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(0.25f)),
                Is.EqualTo(BeatPointFloat.At(0.5f)),
                "Invalid at 0.25 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(2.0f)),
                Is.EqualTo(BeatPointFloat.At(4.0f)),
                "Invalid at 2.0 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(3.0f)),
                Is.EqualTo(BeatPointFloat.At(5.0f)),
                "Invalid at 3.0 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(5.5f)),
                Is.EqualTo(BeatPointFloat.At(6.75f)),
                "Invalid at 4.75 sec"
                );
            Assert.That(
                timetable.GetSequencePositionAt(TimePoint.AtSeconds(10.0f)),
                Is.EqualTo(BeatPointFloat.At(8.0f)),
                "Invalid at 10.0 sec"
                );
        }