--- /dev/null
+\version "2.15.33"
+
+\header {
+
+ texidoc = "
+ Open strings are part of a chord in tablature, even when @code{minimumFret} is set.
+ This can be changed via @code{restrainOpenStrings}."
+
+}
+
+\score {
+ \new TabStaff {
+ \set TabStaff.minimumFret = #3
+ < g, d >1
+ \set TabStaff.restrainOpenStrings = ##t
+ < g, d >1
+ }
+}
predefinedDiagramTable = #default-fret-table
handleNegativeFrets = #'recalculate
+ restrainOpenStrings = ##f
}
\context {
clefPosition = #0
%% Change string if note results in negative fret number
handleNegativeFrets = #'recalculate
+ %% Allow open strings even if minimumFret is set
+ restrainOpenStrings = ##f
}
\context {
(restCompletionBusy ,boolean? "Signal whether a completion-rest is active.")
(restNumberThreshold ,number? "If a multimeasure rest has more
measures than this, a number is printed.")
+ (restrainOpenStrings ,boolean? "Exclude open strings from the
+automatic fret calculator.")
(searchForVoice ,boolean? "Signal whether a search should be made
of all contexts in the context hierarchy for a voice to provide rhythms
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))
#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)