Esempio n. 1
0
        public bool IsIntervalDiatonic(Pitch pitch, Interval interval)
        {
            if (!FullScale.Contains(pitch.ToStep()))
            {
                throw new ArgumentException(string.Format("Starting pitch {0} does not belong to scale.", pitch), "pitch");
            }
            var newStep = pitch.Translate(interval, MidiPitchTranslationMode).ToStep();

            return(FullScale.Contains(newStep));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of BoundInterval which is generated by translation of specific pitch by specific interval.
 /// </summary>
 /// <param name="pitch">Pitch to translate</param>
 /// <param name="interval">Interval</param>
 /// <param name="translationMode">Translation mode</param>
 public BoundInterval(Pitch pitch, Interval interval, Pitch.MidiPitchTranslationMode translationMode)
     : base(interval.Steps, interval.Halftones)
 {
     StartingPitch = pitch;
     EndingPitch   = pitch.Translate(interval, translationMode);
 }