lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make supportNonIntegerFret a context-property (issue 277860043 by addres


From: thomasmorley65
Subject: make supportNonIntegerFret a context-property (issue 277860043 by address@hidden)
Date: Sun, 08 Nov 2015 22:58:20 +0000

Reviewers: ,

Message:
please review

this is a follow up to issue 4643
https://sourceforge.net/p/testlilyissues/issues/4643/
see discussion:
https://codereview.appspot.com/272320043/

Description:
make supportNonIntegerFret a context-property

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

Please review this at https://codereview.appspot.com/277860043/

Affected files (+19, -14 lines):
  M Documentation/changes.tely
  M Documentation/notation/fretted-strings.itely
  M input/regression/tablature-micro-tone.ly
  M ly/engraver-init.ly
  M scm/define-context-properties.scm
  M scm/translation-functions.scm


Index: Documentation/changes.tely
diff --git a/Documentation/changes.tely b/Documentation/changes.tely
index 5f01072a353e0a3863ab2daef94070e4f13b19ab..292c82f8bc2dabf8986c77e3444e808a027786e2 100644
--- a/Documentation/changes.tely
+++ b/Documentation/changes.tely
@@ -67,7 +67,7 @@ which scares away people.
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }

Index: Documentation/notation/fretted-strings.itely
diff --git a/Documentation/notation/fretted-strings.itely b/Documentation/notation/fretted-strings.itely index d6a97470af0ebf0cf260bc1e06c6f0dbcfb0c2bb..8c9dfe8c4438c5c48445992372ab6b4172d7993f 100644
--- a/Documentation/notation/fretted-strings.itely
+++ b/Documentation/notation/fretted-strings.itely
@@ -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.
address@hidden = #(determine-frets #t)} needs to be set in
address@hidden = ##t} needs to be set in
Score-context. However, micro-tones are not supperted in @code{FretBoards}.

 @lilypond[quote,ragged-right,verbatim]
 \layout {
   \context {
     \Score
-    noteToFretFunction = #(determine-frets #t)
+    supportNonIntegerFret = ##t
   }
 }

Index: input/regression/tablature-micro-tone.ly
diff --git a/input/regression/tablature-micro-tone.ly b/input/regression/tablature-micro-tone.ly index ff02d79bdb8d000792bbe5f814af14b724714c2b..461dd2f824cbfdeb0d8e8598b895e5ffd00bbb2b 100644
--- a/input/regression/tablature-micro-tone.ly
+++ b/input/regression/tablature-micro-tone.ly
@@ -3,7 +3,8 @@
 \header {
   texidoc = "The @code{TabStaff} will print micro-tones as mixed numbers of
 fret-number and a fraction.
address@hidden = #(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: ly/engraver-init.ly
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index eade287f1a52fda7c182909dd459074e6a9ce5a6..62559ca40fb6df178f3ab3b9d18954e6ad50769f 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -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: scm/define-context-properties.scm
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index df664bd98f09b1ea413129621432fa139bbee579..3c9e159eb57e9b406b3283a11b17444104c09c42 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -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
address@hidden 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: scm/translation-functions.scm
diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index 2bb980a2f49e29ad00ba4c1a999c64166598b028..2e0d02371b19c3e74ae718f99cbda8be7e1df0dd 100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]