]> git.donarmstrong.com Git - lilypond.git/commitdiff
Factorize the format-metronome-markup
authorReinhold Kainhofer <reinhold@kainhofer.com>
Tue, 7 Oct 2008 16:59:24 +0000 (18:59 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 16 Nov 2008 17:00:58 +0000 (18:00 +0100)
This allows the metronome-markup function to be called from anywhere in the
score, e.g. to generate the markup for a (sub)title (header field!) or to
generate text markup without changing the midi performance at all.

scm/translation-functions.scm

index 901bff0944e40e0385d8ce81443de09a569fe599..b78bfd6e553064fe5a91ca8990769abf50efc2ce 100644 (file)
@@ -7,18 +7,21 @@
 
 ;; metronome marks
 (define-public (format-metronome-markup text dur count context)
-  (let* ((hide-note (eq? #t (ly:context-property context 'tempoHideNote)))
-        (note-mark (if (and (not hide-note) (ly:duration? dur))
+  (let* ((hide-note (eq? #t (ly:context-property context 'tempoHideNote))))
+    (metronome-markup text dur count hide-note)))
+
+(define-public (metronome-markup text dur count hide-note)
+  (let* ((note-mark (if (and (not hide-note) (ly:duration? dur))
                       (make-smaller-markup
                       (make-note-by-number-markup (ly:duration-log dur)
                                                   (ly:duration-dot-count dur)
                                                   1))
-                     (make-null-markup)))
+                     #f))
          (note-markup (if (and (not hide-note) (number? count) (> count 0) )
                         (make-concat-markup (list
                           (make-general-align-markup Y DOWN note-mark)
                           (make-simple-markup " ")
-                          (make-simple-markup  "=")
+                          (make-simple-markup "=")
                           (make-simple-markup " ")
                           (make-simple-markup (number->string count))))
                       #f))