]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/translation-functions.scm
Allows optional octavation for clefs
[lilypond.git] / scm / translation-functions.scm
index 33acfbc7b42178a6f2c5ca585a989d73d6c27bdf..78defd203f741043f5546eb4b41397c018699c6c 100644 (file)
 ;;;; 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