public Note this[FingerPosition position] { get { return(this.NoteAt(position)); } }
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)); }
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); }
public void Add(FingerPosition position) { this.positions.Add(position); }