]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4960 Fix micro-tones assigned to strings in TabStaff
authorThomas Morley <thomasmorley65@gmail.com>
Fri, 26 Aug 2016 22:32:30 +0000 (00:32 +0200)
committerThomas Morley <thomasmorley65@gmail.com>
Fri, 2 Sep 2016 20:38:28 +0000 (22:38 +0200)
This is an oversight from issue 4643
Also extending input/regression/tablature-micro-tone.ly to cover this case.

input/regression/tablature-micro-tone.ly
scm/translation-functions.scm

index 461dd2f824cbfdeb0d8e8598b895e5ffd00bbb2b..a7f891c048ff65f8a97384c80b8f2caf15c24269 100644 (file)
@@ -8,11 +8,17 @@ in @code{Score}-context.
 @code{FretBoards} will print those micro-tones only if they can be found in the
 chosen settings for @code{stringTunings}, otherwise a warning (surpressed here)
 will be printed and an empty @code{FretBoard} returned.  Which should be the
-case here for the first pitch: @code{gih}"
+case for the last four of the examples pitches.
+Micro-tones assigned to strings work nicely."
 }
 
 #(ly:set-option 'warning-as-error #f)
-#(ly:expect-warning (_ "No string for pitch ~a (given frets ~a)") #{ gih #} '())
+#(for-each
+  (lambda (pitch)
+    (ly:expect-warning (_ "No string for pitch "))
+    (ly:expect-warning (_ "Requested string for pitch requires negative fret"))
+    (ly:expect-warning (_ "Ignoring string request and recalculating.")))
+  (iota 4))
 
 \layout {
   \context {
@@ -24,8 +30,7 @@ case here for the first pitch: @code{gih}"
 custom-tuning = \stringTuning <e, a, d ges beh eeh'>
 
 mus = \relative {
-  gih4
-  eeses'
+  eeses'4
   eeseh
   ees
   eeh
@@ -34,6 +39,10 @@ mus = \relative {
   eis
   eisih
   eisis
+  geseh,,\6
+  geh\6
+  gih\6
+  gisih\6
 }
 
 <<
index 22f8648c31e8c0dcaacdad9a4894c6ef057bd0fc..0ed0deff0a24817edc4f53b42fb902313f0e75bc 100644 (file)
@@ -427,13 +427,21 @@ the current tuning?"
                          (ly:warning (_ "No open string for pitch ~a")
                                      pitch)))
                    ;; here we handle assigned strings
-                   (let ((this-fret
-                          (calc-fret pitch string tuning))
-                         (handle-negative
-                          (ly:context-property context
-                                               'handleNegativeFrets
-                                               'recalculate)))
-                     (cond ((or (and (>= this-fret 0) (integer? this-fret))
+                   (let* ((this-fret
+                           (calc-fret pitch string tuning))
+                          (possible-fret?
+                           (and (>= this-fret 0)
+                                (if (and
+                                      (ly:context-property
+                                        context 'supportNonIntegerFret #f)
+                                      (null? rest))
+                                    (integer? (truncate this-fret))
+                                    (integer? this-fret))))
+                          (handle-negative
+                           (ly:context-property context
+                                                'handleNegativeFrets
+                                                'recalculate)))
+                     (cond ((or possible-fret?
                                 (eq? handle-negative 'include))
                             (set-fret! pitch-entry string finger))
                            ((eq? handle-negative 'recalculate)