lilypond-user
[Top][All Lists]
Advanced

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

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


From: David Sumbler
Subject: Re: Line-breaking with non-aligned barlines - again!
Date: Sun, 23 Dec 2018 15:20:26 +0000

-----Original Message-----
From: Thomas Morley <address@hidden>
To: David Sumbler <address@hidden>
CC: lilypond-user <address@hidden>
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
limitations.
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'' }
    \break
    \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
  \break
  \time 5/8 b2 b8
  \time 2/4 \repeat unfold 8 b16
  \break
  \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))
    }
    \m
  \new Lyrics
    \lyricmode {
      \override LyricText.after-line-breaking =
        #(lambda (grob)
          (set! val (1+ val))
          (let* ((paper-score
                   (ly:score-embedded-format
                     sc
                     (ly:grob-layout grob)))
                  (pap-sys-vector
                    (ly:paper-score-paper-systems paper-score))
                  (pap-sys-ls
                    (vector->list pap-sys-vector))
                  (pap-sys-stils
                  (map
                    (lambda (pap-sys)
                      (ly:prob-property pap-sys 'stencil))
                    pap-sys-ls)))
          (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)
      "foo"
      \withMusicProperty #'duration #(ly:make-duration 3 0 9)
      "foo"
      \withMusicProperty #'duration #(ly:make-duration 3 0 16)
      "foo"
    }
  \new Staff \m
> > 


Cheers,
  Harm

******************************

Wow!  As ever, I am astonished by what you can achieve with Lilypond. 
But I have followed your recommendation not to use it!  I finally
managed to get the result I wanted by setting the keyboard part on its
own, using \scaleDurations, invisible bar-lines and force line breaks,
then splitting it into separate eps files each containing one line of
the PianoStaff.  I then attached these to an invisible note on an
invisible stave at the top of the main score.  The problems I had
formerly had with positioning them were solved by setting 
  \once \override TextScript.X-extent = #'(0 . 0)

I attach an image of one of the resultant pages in case it is of any
interest to anyone.

Thanks for all your help with this problem.

David

Attachment: Result.pdf
Description: Adobe PDF document


reply via email to

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