Exemplo n.º 1
0
 public Note this[FingerPosition position]
 {
     get
     {
         return(this.NoteAt(position));
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 public void Add(FingerPosition position)
 {
     this.positions.Add(position);
 }