--- /dev/null
+\version "2.17.7"
+
+\header {
+
+ texidoc="Octavate symbols may be parenthesized or bracketed by using
+parentheses or brackets in the command string."
+
+}
+\score {
+ \new Staff {
+ \clef "G^(8)" g''1 |
+ \clef "bass_[15]" c,,1 |
+ \clef "C^(8)" c''1
+ }
+}
--- /dev/null
+\version "2.17.7"
+
+\header {
+ texidoc = "Optional octavation for clefs for cue notes is
+supported by using parentheses or brackets around the octavation number."
+}
+
+vI = \relative c'' { \clef "treble" \repeat unfold 40 g4 }
+\addQuote vIQuote { \vI }
+
+Solo = \relative c' {
+ \clef "treble_8" c1 |
+ \cueDuringWithClef #"vIQuote" #UP #"bass^(15)" { R1 } |
+ c1 | \break
+ c c
+ \clef "bass^8" c1 |
+ \cueDuringWithClef #"vIQuote" #UP #"G_[8]" { R1 R1 } |
+ c
+ \cueDuringWithClef #"vIQuote" #UP #"treble_(8)" { R1 \break R } |
+ c
+}
+
+\score {
+ <<
+ \new Staff \new Voice \Solo
+ >>
+}
SCM txt = scm_number_to_string (scm_from_int (abs_oct),
scm_from_int (10));
- g->set_property ("text",
- scm_list_n (ly_lily_module_constant ("vcenter-markup"),
- txt, SCM_UNDEFINED));
+ SCM style = get_property ("clefOctavationStyle");
+
+ SCM formatter = get_property ("clefOctavationFormatter");
+ if (ly_is_procedure (formatter))
+ g->set_property ("text", scm_call_2 (formatter, txt, style));
+
Side_position_interface::add_support (g, clef_);
g->set_parent (clef_, Y_AXIS);
/* read */
"clefGlyph "
"clefOctavation "
+ "clefOctavationStyle "
"clefPosition "
"explicitClefVisibility "
"forceClef ",
SCM txt = scm_number_to_string (scm_from_int (abs_oct),
scm_from_int (10));
- g->set_property ("text",
- scm_list_n (ly_lily_module_constant ("vcenter-markup"),
- txt, SCM_UNDEFINED));
+ SCM style = get_property ("cueClefOctavationStyle");
+
+ SCM formatter = get_property ("cueClefOctavationFormatter");
+ if (ly_is_procedure (formatter))
+ g->set_property ("text", scm_call_2 (formatter, txt, style));
+
Side_position_interface::add_support (g, clef_);
g->set_parent (clef_, Y_AXIS);
/* read */
"cueClefGlyph "
"cueClefOctavation "
+ "cueClefOctavationStyle "
"cueClefPosition "
"explicitCueClefVisibility "
"middleCCuePosition "
endRepeatType = #":|."
barNumberVisibility = #first-bar-number-invisible-and-no-parenthesized-bar-numbers
barNumberFormatter = #robust-bar-number-function
+ clefOctavationFormatter = #clef-octavation-markup
+ cueClefOctavationFormatter = #clef-octavation-markup
automaticBars = ##t
explicitClefVisibility = #all-visible
(clefGlyph ,string? "Name of the symbol within the music font.")
(clefOctavation ,integer? "Add this much extra octavation.
Values of 7 and -7 are common.")
+ (clefOctavationFormatter ,procedure? "A procedure that takes the
+Octavation number as a string and the style as a symbol and returns a markup.")
+ (clefOctavationStyle ,symbol? "Determines the way the octavateEight
+grob is displayed. Possible values are @samp{default}, @samp{parenthesized}
+and @samp{bracketed}.")
(clefPosition ,number? "Where should the center of the clef
symbol go, measured in half staff spaces from the center of the
staff.")
(cueClefGlyph ,string? "Name of the symbol within the music font.")
(cueClefOctavation ,integer? "Add this much extra octavation.
Values of 7 and -7 are common.")
+ (cueClefOctavationFormatter ,procedure? "A procedure that takes the
+Octavation number as a string and the style as a symbol and returns a markup.")
+ (cueClefOctavationStyle ,symbol? "Determines the way the octavateEight
+grob is displayed. Possible values are @samp{default}, @samp{parenthesized}
+and @samp{bracketed}.")
(cueClefPosition ,number? "Where should the center of the clef
symbol go, measured in half staff spaces from the center of the
staff.")
(let ((e '())
(c0 0)
(oct 0)
- (match (string-match "^(.*)([_^])([1-9][0-9]*)$" clef-name)))
+ (style 'default)
+ (match (string-match "^(.*)([_^])([^0-9a-zA-Z]*)([1-9][0-9]*)([^0-9a-zA-Z]*)$" clef-name)))
(if match
(begin
(set! clef-name (match:substring match 1))
(set! oct
(* (if (equal? (match:substring match 2) "^") -1 1)
- (- (string->number (match:substring match 3)) 1)))))
+ (- (string->number (match:substring match 4)) 1)))
+ (set! style
+ (cond ((equal? (match:substring match 3) "(") 'parenthesized)
+ ((equal? (match:substring match 3) "[") 'bracketed)
+ (else style)))))
(set! e (assoc-get clef-name supported-clefs))
(if e
- (let* ((musics (map make-prop-set
- `(((symbol . clefGlyph) (value . ,(car e)))
- ((symbol . middleCClefPosition)
- (value . ,(+ oct
- (cadr e)
- (assoc-get (car e) c0-pitch-alist))))
- ((symbol . clefPosition) (value . ,(cadr e)))
- ((symbol . clefOctavation) (value . ,(- oct))))))
+ (let* ((prop-list `(((symbol . clefGlyph) (value . ,(car e)))
+ ((symbol . middleCClefPosition)
+ (value . ,(+ oct
+ (cadr e)
+ (assoc-get (car e) c0-pitch-alist))))
+ ((symbol . clefPosition) (value . ,(cadr e)))
+ ((symbol . clefOctavation) (value . ,(- oct)))))
+ ;; the clefOctavationStyle property is set only when
+ ;; not 'default to calm display-lily-tests.scm
+ (prop-list (if (eq? style 'default)
+ prop-list
+ (append
+ prop-list
+ `(((symbol . clefOctavationStyle)
+ (value . ,style))))))
+ (musics (map make-prop-set prop-list))
(recalc-mid-C (make-music 'ApplyContext))
(seq (make-music 'SequentialMusic
'elements (append musics (list recalc-mid-C))))
(let ((e '())
(c0 0)
(oct 0)
- (match (string-match "^(.*)([_^])([1-9][0-9]*)$" clef-name)))
+ (style 'default)
+ (match (string-match "^(.*)([_^])([^0-9a-zA-Z]*)([1-9][0-9]*)([^0-9a-zA-Z]*)$" clef-name)))
(if match
(begin
(set! clef-name (match:substring match 1))
(set! oct
(* (if (equal? (match:substring match 2) "^") -1 1)
- (- (string->number (match:substring match 3)) 1)))))
+ (- (string->number (match:substring match 4)) 1)))
+ (set! style
+ (cond ((equal? (match:substring match 3) "(") 'parenthesized)
+ ((equal? (match:substring match 3) "[") 'bracketed)
+ (else style)))))
(set! e (assoc-get clef-name supported-clefs))
(if e
- (let* ((musics (map make-prop-set
- `(((symbol . cueClefGlyph) (value . ,(car e)))
- ((symbol . middleCCuePosition)
- (value . ,(+ oct
- (cadr e)
- (assoc-get (car e) c0-pitch-alist))))
- ((symbol . cueClefPosition) (value . ,(cadr e)))
- ((symbol . cueClefOctavation) (value . ,(- oct))))))
+ (let* ((prop-list `(((symbol . cueClefGlyph) (value . ,(car e)))
+ ((symbol . middleCCuePosition)
+ (value . ,(+ oct
+ (cadr e)
+ (assoc-get (car e) c0-pitch-alist))))
+ ((symbol . cueClefPosition) (value . ,(cadr e)))
+ ((symbol . cueClefOctavation) (value . ,(- oct)))))
+ (prop-list (if (eq? style 'default)
+ prop-list
+ (append
+ prop-list
+ `(((symbol . cueClefOctavationStyle)
+ (value . ,style))))))
+ (musics (map make-prop-set prop-list))
(recalc-mid-C (make-music 'ApplyContext))
(seq (make-music 'SequentialMusic
'elements (append musics (list recalc-mid-C))))
`((symbol . cueClefGlyph)
(symbol . middleCCuePosition)
(symbol . cueClefPosition)
- (symbol . cueClefOctavation))))
+ (symbol . cueClefOctavation)
+ (symbol . cueClefOctavationStyle))))
(recalc-mid-C (make-music 'ApplyContext))
(seq (make-music 'SequentialMusic
'elements (append musics (list recalc-mid-C))))
;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; clefs
+
+(define-public (clef-octavation-markup oct style)
+ "The octavation sign formatting function. @var{oct} is supposed to be
+a string holding the octavation number, @var{style} determines the
+way the octavation number is displayed."
+ (let* ((delim (if (symbol? style)
+ (case style
+ ((parenthesized) (cons "(" ")"))
+ ((bracketed) (cons "[" "]"))
+ (else (cons "" "")))
+ (cons "" "")))
+ (text (string-concatenate (list (car delim) oct (cdr delim)))))
+
+ (make-vcenter-markup text)))
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; metronome marks