private Note(int pitchClass, Note flat, Note sharp) { PitchClass = pitchClass; Flat = flat; Sharp = sharp; Name = Resources.DualNoteName.FormatInvariant(flat, sharp); }
protected override IEnumerable<Interval> GetIntervals(Note root) { return new[] { Interval.WholeStep, Interval.HalfStep, Interval.WholeStep, Interval.WholeStep, Interval.HalfStep, Interval.WholeStep, Interval.WholeStep }; }
public IEnumerable<Note> GetNotes(Note root) { Contract.Requires(root != null); var currentNote = root; foreach(var interval in GetIntervals(root)) { yield return currentNote; currentNote += interval; } yield return root; }
protected override IEnumerable<Interval> GetIntervals(Note root) { Contract.Ensures(Contract.Result<IEnumerable<Interval>>() != null); return null; }
protected abstract IEnumerable<Interval> GetIntervals(Note root);
public Key(Note root, KeyScale keyScale) : base(root, GetScale(keyScale)) { KeyScale = keyScale; }
private IEnumerable<Note> GetBaseModeNotes(Note root) { return _baseMode.Scale.GetNotes(root); }
private Note ApplyQuality(Note note, int degreeIndex) { var quality = _mode._noteQualities[degreeIndex]; switch(quality) { case NoteQuality.Natural: return note; case NoteQuality.Flat: return note.Flat; case NoteQuality.Sharp: return note.Sharp; default: throw new NotSupportedException("Unsupported note quality: " + quality.ToString()); } }
protected override IEnumerable<Interval> GetIntervals(Note root) { // TODO: Calculate mode intervals throw new NotImplementedException(); }