Example #1
0
        public void ChromaticIntervalTranslationsTest()
        {
            var scale   = new MajorScale(Step.G, false);
            var pitches = scale.BuildScale(1, 8);

            var secondStep      = pitches.ElementAt(1);
            var translatedPitch = scale.TranslatePitch(secondStep, Interval.MajorThird);

            Assert.AreEqual(translatedPitch, Step.CSharp);
        }
Example #2
0
        public void DiatonicIntervalTranslationsTest()
        {
            var scale   = new MajorScale(Step.G, false);
            var pitches = scale.BuildScale(1, 8);

            var secondStep      = pitches.ElementAt(1);
            var translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Unison);

            Assert.AreEqual(translatedPitch, Step.A);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Second);
            Assert.AreEqual(translatedPitch, Step.B);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Third);
            Assert.AreEqual(translatedPitch, Step.C);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Fourth);
            Assert.AreEqual(translatedPitch, Step.D);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Fifth);
            Assert.AreEqual(translatedPitch, Step.E);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Sixth);
            Assert.AreEqual(translatedPitch, Step.FSharp);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Seventh);
            Assert.AreEqual(translatedPitch, Step.G);
            translatedPitch = scale.TranslatePitch(secondStep, DiatonicInterval.Octave);
            Assert.AreEqual(translatedPitch, Step.A);
        }