Example #1
0
 /// <summary>
 /// NotePair constructor.
 /// </summary>
 /// <param name="cantusFirmusNote">The cantus firmus note</param>
 /// <param name="counterPointNote">The counterpoint note</param>
 /// <param name="arrivedFromCompositionContext">The CompositionContext from which this NotePair was generated</param>
 /// <param name="arrivedFromNoteChoice">The NoteChoice which led to this NotePair being generated</param>
 /// <param name="scaleDegreeEvaluator">The ScaleDegreeEvaluator to use with this NotePair</param>
 public NotePair(
     int cantusFirmusNote,
     int counterPointNote,
     CompositionContext arrivedFromCompositionContext,
     NoteChoice arrivedFromNoteChoice,
     ScaleDegreeEvaluator scaleDegreeEvaluator
     )
 {
     CantusFirmusNote = cantusFirmusNote;
     CounterPointNote = counterPointNote;
     ArrivedFromCompositionContext = arrivedFromCompositionContext;
     ArrivedFromNoteChoice         = arrivedFromNoteChoice;
     _scaleDegreeEvaluator         = scaleDegreeEvaluator;
 }
Example #2
0
        /// <summary>
        /// Override of the Equals method, to handle NoteChoice equivalence.
        /// </summary>
        /// <param name="noteChoice">The other NoteChoice we are comparing this NoteChoice to</param>
        /// <returns>Whether the two NoteChoice objects are equal or not.</returns>
        public bool Equals(NoteChoice noteChoice)
        {
            if (null == noteChoice)
            {
                return(false);
            }

            if (ReferenceEquals(this, noteChoice))
            {
                return(true);
            }

            return(Equals(CounterPointNoteMotion, noteChoice.CounterPointNoteMotion) &&
                   Equals(CantusFirmusNoteMotion, noteChoice.CantusFirmusNoteMotion) &&
                   Equals(CounterPointScaleDegreeChange, noteChoice.CounterPointScaleDegreeChange) &&
                   Equals(CantusFirmusScaleDegreeChange, noteChoice.CantusFirmusScaleDegreeChange));
        }