From 9203eadca5bcb79415060f8488889706a9c8e62a Mon Sep 17 00:00:00 2001 From: Carl Date: Thu, 26 Jan 2012 21:49:37 -0700 Subject: [PATCH] Allow open strings in chords regardless of finger positions Add regression test for 2256 --- input/regression/tablature-open-string-chord.ly | 17 +++++++++++++++++ scm/translation-functions.scm | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 input/regression/tablature-open-string-chord.ly diff --git a/input/regression/tablature-open-string-chord.ly b/input/regression/tablature-open-string-chord.ly new file mode 100644 index 0000000000..36bd309595 --- /dev/null +++ b/input/regression/tablature-open-string-chord.ly @@ -0,0 +1,17 @@ +\version "2.15.28" + +\header { + + texidoc = " +Open strings can always be part of a chord in tablature, even when frets +above 4 have been used in the chord. In this case, both chords should show +an open fourth string." + +} + +\score { + \new TabStaff { + \set TabStaff.stringTunings = \stringTuning + 1 1 + } +} diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 6f7d052493..d373da0eeb 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -326,6 +326,7 @@ if no string-number is present." #t (map (lambda (specced-fret) (or (eq? 0 specced-fret) + (eq? 0 fret) (>= maximum-stretch (abs (- fret specced-fret))))) specified-frets)))) @@ -333,7 +334,7 @@ if no string-number is present." "Can @var{pitch} be played on @var{string}, given already placed notes?" (let* ((fret (calc-fret pitch string tuning))) - (and (>= fret minimum-fret) + (and (or (eq? fret 0) (>= fret minimum-fret)) (close-enough fret)))) (define (open-string string pitch) -- 2.39.2