]> git.donarmstrong.com Git - lilypond.git/commitdiff
make supportNonIntegerFret a context-property
authorThomas Morley <thomasmorley65@gmail.com>
Sun, 8 Nov 2015 22:32:32 +0000 (23:32 +0100)
committerDavid Kastrup <dak@gnu.org>
Tue, 17 Nov 2015 15:13:33 +0000 (16:13 +0100)
issue 4655

restores the arguments of determine-frets (changed with issue 4643)
to the previous state, changes the code of determine-frets to rely
on the newly created supportNonIntegerFret-context-property

Documentation/changes.tely
Documentation/fr/notation/fretted-strings.itely
Documentation/notation/fretted-strings.itely
input/regression/tablature-micro-tone.ly
ly/engraver-init.ly
scm/define-context-properties.scm
scm/translation-functions.scm

index 75a5a06f30ac07b03b24490c113457f0ef6528d4..570f877a1905eed1748b1a79080b681dcba7bbaf 100644 (file)
@@ -67,7 +67,7 @@ which scares away people.
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }
 
index 6874e2fa5dc2c0bb85db7a784b46a26b518e1b54..6954264f346d4d38dd0561a1f42f38f550f622fc 100644 (file)
@@ -730,7 +730,7 @@ Cette clef moderne prend en charge les tablatures de quatre à sept cordes.
 
 Un @code{TabStaff} peut contenir des micro-intervalles tels les quarts
 de ton, qui interveiennent dans les chutes ou sauts.  L'assertion
-@w{@code{noteToFretFunction = #(determine-frets #t)}} devra se placer au
+@w{@code{supportNonIntegerFret = ##t}} devra se placer au
 niveau du contexte @code{Score}.  Les micro-intervalles ne sont
 toutefois pas pris en charge dans un contexte @code{FretBoards}.
 
@@ -738,7 +738,7 @@ toutefois pas pris en charge dans un contexte @code{FretBoards}.
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }
 
index 6f1276e954e70d891739c06705ec11c1167a2195..eb111e3ce81d17ed10d1cef8ebf0b5fddb558b45 100644 (file)
@@ -720,14 +720,14 @@ The modern tab clef supports tablatures from 4 to 7 strings.
 
 @code{TabStaff} may support micro-tones like quarter-tones, which
 can be played using bendings.
-@code{noteToFretFunction = #(determine-frets #t)} needs to be set in
+@code{supportNonIntegerFret = ##t} needs to be set in
 Score-context.  However, micro-tones are not supported in @code{FretBoards}.
 
 @lilypond[quote,ragged-right,verbatim]
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }
 
index ff02d79bdb8d000792bbe5f814af14b724714c2b..461dd2f824cbfdeb0d8e8598b895e5ffd00bbb2b 100644 (file)
@@ -3,7 +3,8 @@
 \header {
   texidoc = "The @code{TabStaff} will print micro-tones as mixed numbers of
 fret-number and a fraction.
-@code{noteToFretFunction = #(my-determine-frets #t)} needs to be set in Score.
+The context-property @code{supportNonIntegerFret} needs to be set @code{#t}
+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
@@ -16,7 +17,7 @@ case here for the first pitch: @code{gih}"
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }
 
index eade287f1a52fda7c182909dd459074e6a9ce5a6..62559ca40fb6df178f3ab3b9d18954e6ad50769f 100644 (file)
@@ -620,8 +620,7 @@ automatically when an output definition (a @code{\\score} or
   \accepts "TabStaff"
   \accepts "VaticanaStaff"
 
-  %% (determine-frets #t) would support micro-tones
-  noteToFretFunction = #(determine-frets)
+  noteToFretFunction = #determine-frets
   predefinedDiagramTable = ##f
   soloText = #"Solo"
   soloIIText = #"Solo II"
index df664bd98f09b1ea413129621432fa139bbee579..3c9e159eb57e9b406b3283a11b17444104c09c42 100644 (file)
@@ -598,6 +598,8 @@ one).")
 subdivided at @code{baseMoment} positions by only drawing one beam over the beat.")
      (suggestAccidentals ,boolean? "If set, accidentals are typeset as
 cautionary suggestions over the note.")
+     (supportNonIntegerFret ,boolean? "If set in @code{Score} the
+@code{TabStaff} will print micro-tones as @samp{2½}")
      (systemStartDelimiter ,symbol? "Which grob to make for the start
 of the system/@/staff?  Set to @code{SystemStartBrace},
 @code{SystemStartBracket} or @code{SystemStartBar}.")
index 2bb980a2f49e29ad00ba4c1a999c64166598b028..2e0d02371b19c3e74ae718f99cbda8be7e1df0dd 100644 (file)
@@ -233,9 +233,8 @@ way the transposition number is displayed."
     ;; Create the dot-placement list for the grob
     (set! (ly:grob-property grob 'dot-placement-list) placement-list)))
 
-(define*-public
-  ((determine-frets #:optional (support-non-integer-fret? #f))
-                    context notes specified-info . rest)
+(define-public
+  (determine-frets context notes specified-info . rest)
   "Determine string numbers and frets for playing @var{notes}
 as a chord, given specified information @var{specified-info}.
 @var{specified-info} is a list with two list elements,
@@ -249,8 +248,8 @@ is not @code {#f}.  If @var{rest} is present, it contains the
 @code{FretBoard} grob, and a fretboard will be
 created.  Otherwise, a list of @code{(string fret finger)} lists will
 be returned.
-If the optional @var{support-non-integer-fret?} is set @code{#t}, micro-tones
-are supported for TabStaff, but not not for FretBoards."
+If the context-property @code{supportNonIntegerFret} is set @code{#t},
+micro-tones are supported for TabStaff, but not not for FretBoards."
 
   ;;  helper functions
 
@@ -359,7 +358,9 @@ notes?"
         (and (or (and (not restrain-open-strings)
                       (zero? fret))
                  (>= fret minimum-fret))
-             (if (and support-non-integer-fret? (null? rest))
+             (if (and
+                   (ly:context-property context 'supportNonIntegerFret #f)
+                   (null? rest))
                  (integer? (truncate fret))
                  (integer? fret))
              (close-enough fret))))
@@ -377,7 +378,9 @@ the current tuning?"
         (if (< this-fret 0)
             (ly:warning (_ "Negative fret for pitch ~a on string ~a")
                         (car pitch-entry) string)
-            (if (and (not (integer? this-fret)) (not support-non-integer-fret?))
+            (if (and
+                  (not (integer? this-fret))
+                  (not (ly:context-property context 'supportNonIntegerFret #f)))
                 (ly:warning (_ "Missing fret for pitch ~a on string ~a")
                             (car pitch-entry) string)))
         (delete-free-string string)