Hi Kieren,

As you can see, the MetronomeMark is aligned to the first note in the bar (correctly speacing, that note's PaperColumn). The TextMark is aligned to the BarLine; more precisely, a BreakAlignment grob.
I don't know how easy it would be to change that.

Ah, turns out it's as easy as tweaking the break-align-symbols property. I'm not sure why it doesn't suffice to use the value staff-bar, but the value '(staff-bar key-signature clef) from TextMark does the job just fine.

So:

tempoChange =
#(define-music-function (firstNote secondNote) (ly:music? ly:music?)
   #{
     \tweak font-size -1
     \tweak self-alignment-X ##f
     \tweak break-align-symbols #'(staff-bar key-signature clef)
     \tempo \markup
     \put-adjacent #X #LEFT
     \put-adjacent #X #RIGHT
     \general-align #X #CENTER " = "
     \concat {
       \rhythm { \tweak style #'baroque #secondNote }
       \hspace #0.375
     }
     \concat {
       \hspace #0.25
       \rhythm { \tweak style #'baroque #firstNote }
     }
   #})

\relative {
  \time 3/4
  c'2.
  c
  \tempoChange 2. 2
  \time 2/2
  c1
}

But TBH I'm not convinced that this is such a good idea, since now we can't put a tempo marking at the beginning of the new section. One might argue that that's just as well, as the tempo relation should replace any other tempo marking, but I'm not sure that one can rule out that both are used simultaneously.

Lukas


Reply via email to