Hi Reinhold,

There's a problem using tempoHideNote if there's no markup text, since
it returns SCM_BOOL_F to the engraver, resulting in a programming
error:

\set Score.tempoHideNote = ##t
\tempo 4 = 60

returns `Object is not a markup.'

I've attached a patch which gets rid of the error message, but I'm not
sure whether it's the best method method for fixing this. What do you
think?

Incidentally, I wonder whether ly:context-property should have the
option of returning a default, like ly:grob-property...

Cheers,
Neil
From ae6b04fdad7b662593cc49245d9a681556cb839c Mon Sep 17 00:00:00 2001
From: Neil Puttock <[EMAIL PROTECTED]>
Date: Thu, 25 Sep 2008 00:13:44 +0100
Subject: [PATCH] Ensure format-metronome-markup always returns markup.

- if tempoHideNote = ##t and there's no tempo string or markup, return
\null.
---
 scm/translation-functions.scm |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm
index 0f4e4ce..2e4b8a6 100644
--- a/scm/translation-functions.scm
+++ b/scm/translation-functions.scm
@@ -7,21 +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)))
+	 (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))
-		      #f))
-         (note-markup (if (and note-mark (number? count) (> count 0) )
+		      (make-null-markup)))
+         (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 (number->string count))))
-                        #f))
+                      (make-null-markup)))
          (text-markup (if (not (null? text))
                         (make-bold-markup text)
                         #f)))
-- 
1.5.4.3

_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to