[Top][All Lists]

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

Re: Line-breaking with non-aligned barlines - again!

From: Thomas Morley
Subject: Re: Line-breaking with non-aligned barlines - again!
Date: Thu, 13 Dec 2018 00:00:07 +0100

Am Di., 11. Dez. 2018 um 13:56 Uhr schrieb David Sumbler <address@hidden>:

> This may well be the answer I need for my full score.  But now that you
> have introduced me to "strict-note-spacing" etc., I am again wondering
> whether there might perhaps be a way of getting Lilypond to make 2
> separate calculations of spacing, one for the harpsichord and another
> for the rest of the orchestra; or, in the case of my small example, one
> for the top stave and one for the bottom.  Perhaps this can be done by
> modifying the stavesFound variable, but I have little idea of how to go
> about this.

I doubt.

Here a hack, hackish as hackish could be. with the need to do a
plethora of manual adjustments. Fragile like hell and with a lot of
And _very_ expensive. You'll experience a slow-down even in the small example.
I can't recommend to use it --- but, well, here you are (also, see
inline comments):

\version "2.19.82"

\paper {
  %% indent needs to be zero
  indent = 0

#(define val -1)

sc =
\score {
    \repeat unfold 20 { a'16 b' c' d'' }
    \repeat unfold 4 { a'16 b' c' d'' }
  \layout {
      %% indent needs to be zero
    indent = 0
    \omit Score.BarNumber

m = {
  \time 2/4 b4 b
  \time 3/8 b4 b8
  \time 6/8 b4. b4 b8
  \time 5/8 b2 b8
  \time 2/4 \repeat unfold 8 b16
  \time 8/8 b1 b

  \new Staff
    \with {
      %% Probably needs to be adjusted
      \override VerticalAxisGroup.staff-staff-spacing =
        #'((basic-distance . 12)
           (minimum-distance . 18)
           (padding . 1))
  \new Lyrics
    \lyricmode {
      \override LyricText.after-line-breaking =
        #(lambda (grob)
          (set! val (1+ val))
          (let* ((paper-score
                     (ly:grob-layout grob)))
                    (ly:paper-score-paper-systems paper-score))
                    (vector->list pap-sys-vector))
                    (lambda (pap-sys)
                      (ly:prob-property pap-sys 'stencil))
          (ly:grob-set-property! grob 'stencil (list-ref pap-sys-stils val))))

      %% Likely this has to be repeated frequently with adjusted values
      \override LyricText.before-line-breaking =
        #(lambda (grob) (ly:grob-translate-axis! grob -8.6 X))

      %% Always need to adjust the duration, it needs to be the duration
      %% of the line of music above (or below)
      \withMusicProperty #'duration #(ly:make-duration 3 0 13)
      \withMusicProperty #'duration #(ly:make-duration 3 0 9)
      \withMusicProperty #'duration #(ly:make-duration 3 0 16)
  \new Staff \m


reply via email to

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