/// <summary> /// Creates a representation for a natural. /// </summary> /// <param name="naturalNote">Can't be an accidental.</param> internal NoteRepresentation(Note naturalNote) { if (naturalNote.IsAccidental()) throw new Exception("Only a natural can be passed to this constructor."); Note = naturalNote; Name = GetNaturalNoteName(naturalNote); Accidental = AccidentalType.Natural; }
public static NoteName GetNaturalNoteName(Note naturalNote) { if (naturalNote.IsAccidental()) throw new Exception("Argument must be a natural."); return (NoteName)(Array.IndexOf(Note.GetNaturals(), naturalNote) % 7); }