lilypond-user
[Top][All Lists]
Advanced

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

Re: Custom dynamic mark on several lines


From: Aaron Hill
Subject: Re: Custom dynamic mark on several lines
Date: Sun, 30 Aug 2020 15:13:43 -0700
User-agent: Roundcube Webmail/1.4.2

On 2020-08-30 2:39 pm, Claire Meyer wrote:
Arf, I'm still struggling :

dals = \tweak DynamicText.self-alignment-X #LEFT
#(make-dynamic-script
#{ \markup \normal-text
\center-column {
\override
#`(direction . ,UP)
\dir-column { "smol" "Very very very tol" }
medium }
#})

I also want to center horizontally (here, the first and second line are
left-aligned, and the third is centered).

Ah, you will need to use \center-align on each element:

%%%%
\markup {
  \column {
    \override #`(direction . ,UP)
    \dir-column {
      \center-align \line { d e }
      \center-align \line { a b c }
    }
    \center-align \line { f g h }
  }
}
%%%%

Note that by doing this, you don't need to use \center-column specifically.

If you are using this pattern frequently enough, you could wrap it all up in a new markup command:

%%%%
\version "2.20.0"

#(define-markup-command
  (centered-three-lines layout props arg1 arg2 arg3)
  (markup? markup? markup?)
  (interpret-markup layout props #{
    \markup \column {
      \override #`(direction . ,UP)
      \dir-column {
        \center-align #arg2
        \center-align #arg1
      }
      \center-align #arg3
    } #}))

\markup \centered-three-lines
  \line { a b c }
  \line { d e }
  \line { f g h }
%%%%


-- Aaron Hill



reply via email to

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