Risto Vääräniemi wrote:
On 08/04/2008, Trevor Daniels wrote:The snippet 204 doesn't work very well with 2.11 because it uses negative padding to position the rhythm mark closer to the staff and that's not supported by 2.11.
I think there's another drawback of the snippet. I had a very similar problem, trying to add marks like "Moderato (* = 63)", yet using rehearsal marks at the same time for sectioning the piece. Problem is, Lily can't handle two RehearsalMark events on the same beat (don't know whether there's a workaround), so I wanted to use MetronomeMarks. Here's my snippet to do so; I suspect it should be fairly straightforward to modify to mimic the rhythmMark behaviour. Additionally, it might help some of you figuring out how a markup is used as a stencil; especially when you want to add parameters on every call and need to currify (right?) your markup function. It took me a while since I'm not familiar with Scheme... Of course it would be nice if the \tempo command would be run directly in \tempoChangeMarkup; however I'm running into type problems here. Is it possible to convert string->duration via Scheme? Else I always had to type \tempoChangeMarkup #"foo" #(make-duration 4) #"120" or am I wrong there? And is this: http://www.mail-archive.com/lilypond-user@gnu.org/msg27033.html solved by now? It seems to be a problem for the last argument (integer vs. digit/unsigned)... Thanks Alexander
<<inline: tempoChangeMarkup.png>>
\version "2.11.43" tempoMarkLabelSize = #0 tempoMarkNoteSize = #-6 #(define (tempoChangeMarkupFactory grob label noteValue tempo) (interpret-markup (ly:grob-layout grob) (ly:grob-alist-chain grob (ly:output-def-lookup (ly:grob-layout grob) 'text-font-defaults) ) (markup #:fontsize tempoMarkLabelSize #:italic #:concat (label (if (string-null? label) "(" " (")) #:hspace -1 #:fontsize tempoMarkNoteSize #:general-align Y DOWN #:note noteValue UP #:fontsize tempoMarkLabelSize #:italic #:concat("= " tempo ")") ) ) ) #(define (tempoChangeStencil label noteValue tempo) (lambda (grob) (tempoChangeMarkupFactory grob label noteValue tempo) ) ) tempoChangeMarkup = #(define-music-function (parser location label noteValue tempo) (string? string? string?) #{ \once \override Score.MetronomeMark #'stencil = #(tempoChangeStencil $label $noteValue $tempo) #}) \relative c' { \time 4/4 \clef treble \tempoChangeMarkup #"Moderato" #"4" #"63" % just initialize the override \tempo 4 = 63 % markup is printed c4 d e f | g a b c | \time 6/4 \mark \default % \rhythmMark would not be printed here! \tempoChangeMarkup #"presto" #"2." #"90" \tempo 2. = 90 c2. g | \break e \tempoChangeMarkup #"handling collision with RehearsalMark" #"4" #"120" \tempo 4 = 120 c | \time 4/4 \mark \default c1 }
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user