From: Thomas Morley Date: Sun, 8 Nov 2015 22:32:32 +0000 (+0100) Subject: make supportNonIntegerFret a context-property X-Git-Tag: release/2.19.32-1~7 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=84ac019c437ea40b7b18ab46da1772f6db344a83 make supportNonIntegerFret a context-property 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 --- diff --git a/Documentation/changes.tely b/Documentation/changes.tely index 75a5a06f30..570f877a19 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 } } diff --git a/Documentation/fr/notation/fretted-strings.itely b/Documentation/fr/notation/fretted-strings.itely index 6874e2fa5d..6954264f34 100644 --- a/Documentation/fr/notation/fretted-strings.itely +++ b/Documentation/fr/notation/fretted-strings.itely @@ -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 } } diff --git a/Documentation/notation/fretted-strings.itely b/Documentation/notation/fretted-strings.itely index 6f1276e954..eb111e3ce8 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. -@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 } } diff --git a/input/regression/tablature-micro-tone.ly b/input/regression/tablature-micro-tone.ly index ff02d79bdb..461dd2f824 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. -@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 } } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index eade287f1a..62559ca40f 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" diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index df664bd98f..3c9e159eb5 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 +@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}.") diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 2bb980a2f4..2e0d02371b 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)