public Note this[FingerPosition position]
 {
     get
     {
         return(this.NoteAt(position));
     }
 }
Example #2
0
        public bool Covers(FingerPosition position)
        {
            if (position == null)
            {
                throw new ArgumentNullException("position", "FingerPosition is not a valid object");
            }

            return(position.Fret >= this.Lowest && position.Fret <= this.Highest);
        }
        public IList <FingerPosition> OtherExactPositionsFor(FingerPosition position)
        {
            if (position == null)
            {
                throw new ArgumentNullException("position");
            }

            var pitch = this[position];

            return(this.PositionsFor(args => args.Pitch == pitch && args.Position != position));
        }
        public Note NoteAt(FingerPosition position)
        {
            if (position == null)
            {
                throw new ArgumentNullException("position");
            }

            int stringIndex = this.strings.Count - position.String;

            if (stringIndex < 0)
            {
                throw new ArgumentOutOfRangeException("position", "Position value is not available on this instrument");
            }

            return(this.strings[stringIndex].PitchAt(position.Fret));
        }
Example #5
0
        public IEnumerable <FingerPosition> FindAllPositionsFor(int fretRange, Predicate <FingerSearchArgs> decider)
        {
            var list = new List <FingerPosition>();

            foreach (var fret in Enumerable.Range(0, fretRange + 1))
            {
                Note candidate = this.PitchAt(fret);

                var position = new FingerPosition(fret, this.Number);
                var args     = new FingerSearchArgs {
                    Pitch = candidate, Position = position
                };

                if (decider != null && decider(args))
                {
                    list.Add(position);
                }
            }

            return(list);
        }
Example #6
0
 public void Add(FingerPosition position)
 {
     this.positions.Add(position);
 }