The @code{\addlyrics} function now works with arbitrary contexts
incuding @code{Staff}.
+@item
+String numbers can now also be used to print roman numerals
+(e.g. for unfretted string instruments).
+@lilypond[verbatim,quote,relative=2]
+c2\2
+\romanStringNumbers
+c\2
+\arabicStringNumbers
+c1\3
+@end lilypond
+
@item
The @code{thin-kern} property of the @code{BarLine} grob has been
renamed to @code{segno-kern}.
<g-0\3>
@end lilypond
+String numbers may also, as is customary with unfretted strings,
+be printed in Roman numerals and placed below the staff rather
+than above.
+
+@lilypond[verbatim,quote,relative=2]
+c2\2
+a\3
+\romanStringNumbers
+c\2
+\set stringNumberOrientations = #'(down)
+a\3
+\arabicStringNumbers
+g1\4
+@end lilypond
+
@snippets
@lilypondfile[verbatim,quote,texidoc,doctitle]
@lilypondfile[verbatim,quote,texidoc,doctitle]
{allowing-fingerings-to-be-printed-inside-the-staff.ly}
+@predefined
+@code{\arabicStringNumbers},
+@code{\romanStringNumbers}.
+@endpredefined
+
@seealso
Notation Reference:
@ref{Fingering instructions}.
@funindex \upbow
@funindex \downbow
@funindex \open
+@funindex \romanStringNumbers
@cindex bowing indications
@cindex up bow indication
@cindex down bow indication
@cindex open string indication
@cindex string, indicating open
+@cindex string numbers
Bowing indications are created as articulations, which are
described in @ref{Articulations and ornamentations}.
@end lilypond
@noindent
-and the following example shows three ways in which an open A
-string on a violin might be indicated:
+
+Roman numerals can be added as strings numbers (rather
+than the default circled Arabic numbers), as explained in
+@ref{String number indications}.
+
+Alternatively, string indications may be printed using
+markup commands; articulation scripts may also indicate
+open strings.
@lilypond[verbatim,quote,relative=2]
a4 \open
-a^\markup { \teeny "II" }
+\romanStringNumbers
+a\2
a2^\markup { \small "sul A" }
@end lilypond
@predefined
@code{\downbow},
@code{\upbow},
-@code{\open}.
+@code{\open},
+@code{\romanStringNumbers}.
@endpredefined
@seealso
Notation Reference:
@ref{Articulations and ornamentations},
+@ref{String number indications},
@ref{Slurs}.
stemNeutral = \revert Stem.direction
+%% string numbers
+
+romanStringNumbers = {
+ \override StringNumber.number-type = #'roman-upper
+ \override StringNumber.stencil = #ly:text-interface::print
+ \override StringNumber.font-encoding = #'latin1
+ \override StringNumber.font-shape = #'italic
+}
+arabicStringNumbers = {
+ \revert StringNumber.number-type
+ \revert StringNumber.stencil
+ \revert StringNumber.font-encoding
+ \revert StringNumber.font-shape
+}
+
+
%% tablature
% switch to full notation
"Note names."
'())
+(ly:add-interface
+ 'number-interface
+ "Numbers."
+ '(number-type))
+
(ly:add-interface
'only-prebreak-interface
"Kill this grob after the line breaking process."
between 0 and 1.")
(note-names ,vector? "Vector of strings containing names for
easy-notation note heads.")
+ (number-type ,symbol? "Numbering style. Choices include
+@code{roman-lower}, @code{roman-upper} and @code{arabic}.")
;;;
(cross-staff . ,script-or-side-position-cross-staff)
(font-encoding . fetaText)
(font-size . -5) ; don't overlap when next to heads.
+ (number-type . arabic)
(padding . 0.5)
(parent-alignment-X . ,CENTER)
(script-priority . 100)
self-alignment-interface
outside-staff-interface
side-position-interface
+ number-interface
string-number-interface
text-interface
text-script-interface))))))
(number-type
(assoc-get 'number-type details 'roman-lower))
(label-text
- (cond
- ((equal? number-type 'roman-lower)
- (fancy-format #f "~(~@r~)" base-fret))
- ((equal? number-type 'roman-upper)
- (fancy-format #f "~@r" base-fret))
- ((equal? 'arabic number-type)
- (fancy-format #f "~d" base-fret))
- ((equal? 'custom number-type)
- (fancy-format #f
- (assoc-get 'fret-label-custom-format
- details "~a")
- base-fret))
- (else (fancy-format #f "~(~@r~)" base-fret))))
+ (number-format number-type base-fret
+ (assoc-get 'fret-label-custom-format
+ details "~a")))
(label-stencil
(centered-stencil
(sans-serif-stencil
(reverse matches))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; numbering styles
+
+(define-public (number-format number-type num . custom-format)
+ "Print NUM accordingly to the requested NUMBER-TYPE.
+Choices include @code{roman-lower} (by default),
+@code{roman-upper}, @code{arabic} and @code{custom}.
+In the latter case, CUSTOM-FORMAT must be supplied
+and will be applied to NUM."
+ (cond
+ ((equal? number-type 'roman-lower)
+ (fancy-format #f "~(~@r~)" num))
+ ((equal? number-type 'roman-upper)
+ (fancy-format #f "~@r" num))
+ ((equal? number-type 'arabic)
+ (fancy-format #f "~d" num))
+ ((equal? number-type 'custom)
+ (fancy-format #f (car custom-format) num))
+ (else (fancy-format #f "~(~@r~)" num))))
+
;;;;;;;;;;;;;;;;
;; other
(define-public (string-number::calc-text grob)
(let ((event (event-cause grob)))
(or (ly:event-property event 'text #f)
- (number->string (ly:event-property event 'string-number) 10))))
+ (number-format
+ (ly:grob-property grob 'number-type)
+ (ly:event-property event 'string-number)))))
(define-public (stroke-finger::calc-text grob)
(let ((event (event-cause grob)))