lilypond-user
[Top][All Lists]
Advanced

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

Re: ragged-right and \rhythm


From: Jean Abou Samra
Subject: Re: ragged-right and \rhythm
Date: Wed, 17 Aug 2022 15:14:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0



Le 17/08/2022 à 11:31, Lukas-Fabian Moser a écrit :

That said, there aren’t that many paper/layout variables. Setting selected ones manually like you suggest could be OK. Maybe also check what happens with very long rhythms, do they get broken? Maybe try ly:one-line-auto-height-breaking? I didn’t test anything (vacation).

I'm probably only showing my ignorance: ly:XXX-breaking are page-breaking algorithms; I would have thought that these, belonging to \paper { ... }, cannot be used inside a \markup \score { ... } at all?



I thought that they could conceptually make sense in \markup \score
because the score fills the breaking problem by itself, unlike the usual
case where there can be several scores in a book(part) with one breaking
problem for the whole book(part) and thus it wouldn't make sense to set
the breaking algorithm per score. However, it looks like \markup \score
doesn't use the page-breaking variable anyway, Paper_score::calc_breaking ()
runs only line breaking and no page breaking, which makes a lot of sense.
Looking at the Constrained_breaking class, I think just setting
ragged-right = ##t in \rhythm should be OK. Alternatively, if you
feel like it, introduce a variant of Paper_score::get_paper_systems
/ ly:paper-score-paper-systems (the function used by \markup \score)
that does not run Constrained_breaking but just spaces everything
on one line. (It does sound more complicated, although perhaps more
elegant.)

Should I leave it to you to create an issue and MR?


Daniel, as a workaround for the time being, you can use

\version "2.23.11"

#(define-markup-command (rhythm layout props music)
  (ly:music?)
  #:properties ((font-size -2))
  (let* ((mkup
          #{
            \markup \score {
              \new StandaloneRhythmVoice \with {
                \magnifyStaff #(magstep font-size)
              }
              { #music }
              \layout { ragged-right = ##t }
            }
          #})
         (stil (interpret-markup layout props mkup)))
    (ly:stencil-aligned-to stil X LEFT)))


\paper {
  ragged-right = ##f
}

\markup \rhythm { 8 8 }



Jean




reply via email to

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