Reviewers: Keith,
Message:
On 2013/02/10 20:42:35, Keith wrote:
https://codereview.appspot.com/7303067/diff/1/Documentation/notation/editorial.itely
File Documentation/notation/editorial.itely (right):
https://codereview.appspot.com/7303067/diff/1/Documentation/notation/editorial.itely#newcode157
Documentation/notation/editorial.itely:157: Markup texts or strings
may be used
for finger changes.
Not strings in general, because the font is the music font by default.
General
strings would have a in some default font, but p in the font for the
dynamic
'piano'
I did not write "arbitrary strings". "string" just implies a data type,
not what characters it may contain. We are also talking about
fingerings here and nothing else. If you think that the text needs
changes, please propose what you consider appropriate instead.
Description:
This is actually a whole bunch of commits:
Remove obsolete @knownissue about fingerings like -23
Issue 3034: Use \finger in a few documentation places
Simplify definition of \thumb
Remove definition of \finger from double fingering regtest
Add explicit \finger command for normal fingering events
Let \rightHandFinger accept arbitrary markup as text
Add number-or-markup? predicate
Let calc-{fingering,string-number,stroke-finger}::calc-text look at
event 'text
This slightly increases the number of property lookups, and the same
function can be achieved using a tweak. However, it seems more
natural to attach any overriding text (in the case of non-standard
elements like thumbs or other) directly to the event in question.
Please review this at https://codereview.appspot.com/7303067/
Affected files:
M Documentation/notation/editorial.itely
M Documentation/notation/text.itely
M Documentation/snippets/creating-double-digit-fingerings.ly
M ly/music-functions-init.ly
M ly/script-init.ly
M scm/c++.scm
M scm/lily.scm
M scm/output-lib.scm
Index: Documentation/notation/editorial.itely
diff --git a/Documentation/notation/editorial.itely
b/Documentation/notation/editorial.itely
index
002dafbe668d8aaa58bba81a609166a8eeae50e3..715aa620a74e9f9776c1de10d9621fa59c1ad682
100644
--- a/Documentation/notation/editorial.itely
+++ b/Documentation/notation/editorial.itely
@@ -154,10 +154,10 @@ Fingering instructions can be entered using
c4-1 d-2 f-4 e-3
@end lilypond
-Markup texts may be used for finger changes.
+Markup texts or strings may be used for finger changes.
@lilypond[verbatim,quote,relative=2]
-c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
+c4-1 d-2 f\finger \markup \tied-lyric #"4~3" c\finger "2 - 3"
@end lilypond
@cindex thumb-script
@@ -211,10 +211,6 @@ Internals Reference:
@rinternals{New_fingering_engraver},
@rinternals{Fingering}.
-@knownissues
-By default, numbers greater than 9 are not supported using
-@samp{@var{note}-@var{digit}}.
-
@node Hidden notes
@unnumberedsubsubsec Hidden notes
Index: Documentation/notation/text.itely
diff --git a/Documentation/notation/text.itely
b/Documentation/notation/text.itely
index
dd7126585081b4911fd0b9c60f47ba5f907186a6..e6a085fc56e0b6488be5580168fdd8fafb5e6104
100644
--- a/Documentation/notation/text.itely
+++ b/Documentation/notation/text.itely
@@ -1166,11 +1166,7 @@ in markup mode:
@lilypond[quote,verbatim,relative=1]
g1 bes
-ees-\markup {
- \finger 4
- \tied-lyric #"~"
- \finger 1
-}
+ees\finger \markup \tied-lyric #"4~1"
fis_\markup { \dynamic rf }
bes^\markup {
\beam #8 #0.1 #0.5
Index: Documentation/snippets/creating-double-digit-fingerings.ly
diff --git a/Documentation/snippets/creating-double-digit-fingerings.ly
b/Documentation/snippets/creating-double-digit-fingerings.ly
index
4991989e6a7c5bbdde6cbe0f7bb2dbc8a839a634..85f596d7edf3bc3312868ecd549c718055b17917
100644
--- a/Documentation/snippets/creating-double-digit-fingerings.ly
+++ b/Documentation/snippets/creating-double-digit-fingerings.ly
@@ -4,7 +4,7 @@
%% and then run scripts/auxiliar/makelsr.py
%%
%% This file is in the public domain.
-\version "2.17.11"
+\version "2.17.13"
\header {
lsrtags = "editorial-annotations, expressive-marks, scheme-language,
staff-notation, tweaks-and-overrides"
@@ -28,11 +28,6 @@ fifty =
#(make-music 'FingeringEvent
'digit 50)
-finger =
-#(define-music-function (parser location digit) (integer?)
- (make-music 'FingeringEvent
- 'digit digit))
-
#(define (calc-finger-without-warning grob)
(let* ((event (event-cause grob))
(digit (ly:event-property event 'digit)))
Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index
c063b9585da50b8d9325f73aab5ebb4c0c45cd6e..061e696d08f01f967924c674367e095cb245086a
100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -379,6 +379,15 @@ featherDurations=
argument))
+finger =
+#(define-event-function (parser location finger) (number-or-markup?)
+ (_i "Apply @var{finger} as a fingering indication.")
+
+ (make-music
+ 'FingeringEvent
+ (if (number? finger) 'digit 'text)
+ finger))
+
footnote =
#(define-music-function (parser location mark offset footnote item)
((markup?) number-pair? markup? symbol-list-or-music?)
@@ -1061,13 +1070,12 @@ for time signatures of @var{time-signature}.")
(revert-time-signature-setting time-signature))
rightHandFinger =
-#(define-event-function (parser location finger) (number-or-string?)
+#(define-event-function (parser location finger) (number-or-markup?)
(_i "Apply @var{finger} as a fingering indication.")
(make-music
'StrokeFingerEvent
- 'origin location
- (if (string? finger) 'text 'digit)
+ (if (number? finger) 'digit 'text)
finger))
scaleDurations =
Index: ly/script-init.ly
diff --git a/ly/script-init.ly b/ly/script-init.ly
index
0baf24258b2af8c41e8ebf3ef86e8ea085671082..5d33decace0e926d0189d14d8d6a3b3c75960053
100644
--- a/ly/script-init.ly
+++ b/ly/script-init.ly
@@ -46,9 +46,8 @@ staccatissimo = #(make-articulation "staccatissimo")
staccato = #(make-articulation "staccato")
stopped = #(make-articulation "stopped")
tenuto = #(make-articulation "tenuto")
-thumb = \tweak text \markup \scale #(cons (magstep 5) (magstep 5))
- \musicglyph #"scripts.thumb"
- #(make-music 'FingeringEvent)
+thumb = \finger \markup \scale #(cons (magstep 5) (magstep 5))
+ \musicglyph #"scripts.thumb"
trill = #(make-articulation "trill")
turn = #(make-articulation "turn")
upbow = #(make-articulation "upbow")
Index: scm/c++.scm
diff --git a/scm/c++.scm b/scm/c++.scm
index
8d1df2aed7487b22c742780e4f73c0c12833fbd2..f0c5d3aea9f546980949318d6498d1dcef483ba8
100644
--- a/scm/c++.scm
+++ b/scm/c++.scm
@@ -62,6 +62,9 @@
(define-public (number-or-string? x)
(or (number? x) (string? x)))
+(define-public (number-or-markup? x)
+ (or (number? x) (markup? x)))
+
(define-public (string-or-pair? x)
(or (string? x) (pair? x)))
Index: scm/lily.scm
diff --git a/scm/lily.scm b/scm/lily.scm
index
4905e0687b6977e1284728d4fa0eae561e16a510..e5e8cd93d67d871ef2be83499d2b572db9a5bee3
100644
--- a/scm/lily.scm
+++ b/scm/lily.scm
@@ -575,6 +575,7 @@ messages into errors.")
(,moment-pair? . "pair of moment objects")
(,number-list? . "number list")
(,number-or-grob? . "number or grob")
+ (,number-or-markup? . "number or markup")
(,number-or-pair? . "number or pair")
(,number-or-string? . "number or string")
(,number-pair? . "pair of numbers")
Index: scm/output-lib.scm
diff --git a/scm/output-lib.scm b/scm/output-lib.scm
index
024788036ec4b1ced6ca5caa28845ec2072dfa65..bcb65588a4f576e89aafe33019940f3e4b998fa8
100644
--- a/scm/output-lib.scm
+++ b/scm/output-lib.scm
@@ -872,24 +872,21 @@ and duration-log @var{log}."
;; fingering
(define-public (fingering::calc-text grob)
- (let* ((event (event-cause grob))
- (digit (ly:event-property event 'digit)))
-
- (number->string digit 10)))
+ (let ((event (event-cause grob)))
+ (or (ly:event-property event 'text #f)
+ (number->string (ly:event-property event 'digit) 10))))
(define-public (string-number::calc-text grob)
- (let ((digit (ly:event-property (event-cause grob) 'string-number)))
-
- (number->string digit 10)))
+ (let ((event (event-cause grob)))
+ (or (ly:event-property event 'text #f)
+ (number->string (ly:event-property event 'string-number) 10))))
(define-public (stroke-finger::calc-text grob)
- (let* ((digit (ly:event-property (event-cause grob) 'digit))
- (text (ly:event-property (event-cause grob) 'text)))
-
- (if (string? text)
- text
+ (let ((event (event-cause grob)))
+ (or (ly:event-property event 'text #f)
(vector-ref (ly:grob-property grob 'digit-names)
- (1- (max (min 5 digit) 1))))))
+ (1- (max 1
+ (min 5 (ly:event-property event 'digit))))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel