lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \tempo - how to remove parentheses around metronome marks ?


From: Thomas Morley
Subject: Re: \tempo - how to remove parentheses around metronome marks ?
Date: Fri, 16 Jan 2015 00:40:30 +0100

2015-01-16 0:21 GMT+01:00 pls <address@hidden>:
> Hi Harald,
>
> this is one possibility:
> {
>   \tempo \markup {
>     \concat {
>       "Moderato "
>       \smaller \general-align #Y #DOWN \note #"4" #1
>       " = "
>       \smaller \general-align #Y #DOWN #"112"
>
>     }
>   }
>   c'1 c'1 c'1
> }
>
> hth
> patrick
> On 16.01.2015, at 00:01, Harald Christiansen <address@hidden> wrote:
>
> Hi,
>
> \tempo "Moderato, " 4=112
>
> How do I remove the parentheses around metronome marks ?

The parentheses are hardcoded in translation-functions.scm
see: 'metronome-markup'


Use Patricks suggestion or you can write your own formatting functions.

Some time ago I did:

#(define (my-format-metronome-markup event context)
  (let ((hide-note (ly:context-property context 'tempoHideNote #f))
        (text (ly:event-property event 'text))
        (dur (ly:event-property event 'tempo-unit))
        (count (ly:event-property event 'metronome-count)))

    (my-metronome-markup text dur count hide-note)))

#(define (my-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))
                        #f))
         (count-markup (cond ((number? count)
                              (if (> count 0)
                                  (make-simple-markup (number->string count))
                                  #f))
                             ((pair? count)
                              (make-concat-markup
                               (list
                                (make-simple-markup (number->string
(car count)))
                                (make-simple-markup " ")
                                (make-simple-markup "–")
                                (make-simple-markup " ")
                                (make-simple-markup (number->string
(cdr count))))))
                             (else #f)))
         (note-markup (if (and (not hide-note) count-markup)
                          (make-concat-markup
                           (list
                            (make-general-align-markup Y DOWN note-mark)
                            (make-simple-markup " ")
                            (make-simple-markup "=")
                            (make-simple-markup " ")
                            count-markup))
                          #f))
         (text-markup (if (not (null? text))
                          (make-bold-markup text)
                          #f)))
    (if text-markup
        (if (and note-markup (not hide-note))
            (make-line-markup (list text-markup note-markup))
            (make-line-markup (list text-markup)))
        (if note-markup
            (make-line-markup (list note-markup))
            (make-null-markup)))))

\layout {
  \context {
    \Score
    metronomeMarkFormatter = #my-format-metronome-markup
  }
}


\relative c'' {
  \tempo
    "Charmant bewegter und größer werden bis Tempo "
    4=75
  \compressFullBarRests
  R2*26
}


Maybe we should not hardcode parentheses but use an optional argument for them.

HTH,
 Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]