lilypond-user
[Top][All Lists]
Advanced

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

Re: custom markup for \tempo


From: Wilbert Berendsen
Subject: Re: custom markup for \tempo
Date: Fri, 4 Apr 2014 11:13:54 +0200

Op Fri, 4 Apr 2014 10:19:40 +0200
Simon Bailey <address@hidden> schreef:

> hello, the list!
> 
> i have constructed the following:
> 
> %%% SNIP %%%
> #(define-markup-command
>   (nbTempo layout props expression beat tempo)
>   (markup? string? markup?)
>   (interpret-markup layout props
>     #{
>       \markup {
>         \override #'(baseline-skip . 2)
>         \column {
>           \concat { \teeny { \raise #0.5 { \note #beat #UP } }
> \normal-text { " = " #tempo } }
>           \normal-text #expression
>         }
>       }
>     #}
>     )
>   )
> 
> \relative c' {
>   \tempo \markup \nbTempo "a tempo" #"4" "90"
>   c1 c1
> }
> %%% SNAP %%%
> 
> however, I would like to replace the convoluted call "\tempo \markup
> \nbTempo" with just "\nbTempo".
> 
> How would I go about this? As an added bonus, the midi tempo could
> also be set in this function.

Make nbTempo a music function that accepts the arguments and calls the
markup command (which I renamed to nbTempomkup). Like this:


%%% SNIP %%%
#(define-markup-command
  (nbTempomkup layout props expression beat tempo)
  (markup? string? markup?)
  (interpret-markup layout props
    #{
      \markup {
        \override #'(baseline-skip . 2)
        \column {
          \concat {
            \teeny { \raise #0.5 { \note #beat #UP } } \normal-text
            { " = " #tempo }
          }
          \normal-text #expression
        }
      }
    #}))

nbTempo = #
(define-music-function
 (parser location expression beat tempo)
 (markup? string? markup?)
 #{
   \tempo \markup \nbTempomkup #expression #beat #tempo
 #})

\relative c' {
  \nbTempo "a tempo" #"4" "90"
  c1 c1
}
%%% SNAP %%%

Best!
Wilbert

-- 
Wilbert Berendsen
(http://www.wilbertberendsen.nl)




reply via email to

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