Beispiel #1
0
        private Note(int pitchClass, Note flat, Note sharp)
        {
            PitchClass = pitchClass;
            Flat = flat;
            Sharp = sharp;

            Name = Resources.DualNoteName.FormatInvariant(flat, sharp);
        }
Beispiel #2
0
 protected override IEnumerable<Interval> GetIntervals(Note root)
 {
     return new[]
     {
         Interval.WholeStep,
         Interval.HalfStep,
         Interval.WholeStep,
         Interval.WholeStep,
         Interval.HalfStep,
         Interval.WholeStep,
         Interval.WholeStep
     };
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
            protected override IEnumerable<Interval> GetIntervals(Note root)
            {
                Contract.Ensures(Contract.Result<IEnumerable<Interval>>() != null);

                return null;
            }
Beispiel #5
0
 protected abstract IEnumerable<Interval> GetIntervals(Note root);
Beispiel #6
0
 public Key(Note root, KeyScale keyScale)
     : base(root, GetScale(keyScale))
 {
     KeyScale = keyScale;
 }
Beispiel #7
0
 private IEnumerable<Note> GetBaseModeNotes(Note root)
 {
     return _baseMode.Scale.GetNotes(root);
 }
Beispiel #8
0
            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());
                }
            }
Beispiel #9
0
            protected override IEnumerable<Interval> GetIntervals(Note root)
            {
                // TODO: Calculate mode intervals

                throw new NotImplementedException();
            }