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

            Name = Resources.DualNoteName.FormatInvariant(flat, sharp);
        }
Exemple #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
     };
 }
Exemple #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;
        }
Exemple #4
0
            protected override IEnumerable<Interval> GetIntervals(Note root)
            {
                Contract.Ensures(Contract.Result<IEnumerable<Interval>>() != null);

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

                throw new NotImplementedException();
            }