along with @var{minimum-fret}, @var{maximum-stretch}, and
@var{tuning}. Returns a list of @code{(string fret finger) lists."
+
+ (define restrain-open-strings (ly:context-property context
+ 'restrainOpenStrings
+ #f))
(define specified-frets '())
(define free-strings (iota (length tuning) 1))
(map (lambda (art)
(let* ((num (ly:event-property art 'digit)))
- (if (and (eq? 'fingering-event (ly:event-property art 'class))
+ (if (and (ly:in-event-class? art 'fingering-event)
(number? num)
(> num 0))
(set! finger-found num))))
#t
(map (lambda (specced-fret)
(or (eq? 0 specced-fret)
- (eq? 0 fret)
+ (and (not restrain-open-strings)
+ (eq? 0 fret))
(>= maximum-stretch (abs (- fret specced-fret)))))
specified-frets))))
"Can @var{pitch} be played on @var{string}, given already placed
notes?"
(let* ((fret (calc-fret pitch string tuning)))
- (and (or (eq? fret 0) (>= fret minimum-fret))
+ (and (or (and (not restrain-open-strings)
+ (eq? fret 0))
+ (>= fret minimum-fret))
(close-enough fret))))
(define (open-string string pitch)