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


From: David Sumbler
Subject: Re: Line-breaking with non-aligned barlines
Date: Fri, 26 Oct 2018 22:52:50 +0100

-----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
Date: Fri, 26 Oct 2018 18:56:15 +0200

> Hi,
> 
> you likely know lily breaks only at matching BarLines.
> So you have to insert a \bar "" at appropriate place. Which is tricky
> here, because there is _no_ appropriate place.
> 
> Well, then create one, i.e.
> instead of the original event, insert same simultaneous music like
> << e { s \bar "" s } >>
> and then figure out which duration the first skip must have.
> 
> Which is tricky as well. For that purpose I use:
> ctxMom =
>   \applyContext
>   #(lambda (ctx)
>     (format #t "\nin context~a: ~a" ctx (ly:context-current-moment
> ctx)))
> 
> and insert \ctxMom where I wrote \break (below I've did it in
> FifteenHarpsUpper) and before the second skip of the inserted
> simultaneous music in FifteenFlute.
> Now I can scale the duration of the first skip until both values of
> \ctxMom match.
> 
> %%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.19.81"
> 
> ctxMom =
>   \applyContext
>   #(lambda (ctx)
>     (format #t "\nin context~a: ~a" ctx (ly:context-current-moment
> ctx)))
> 
> 
> \language "english"
> 
> #(set-global-staff-size 16)
> 
> gliss = \markup { \larger \italic "gliss." }
> 
> FifteenFlute = {
>   <<
>     { \relative {
>       R1 | R1\fermataMarkup |
>         \override Staff.TimeSignature.stencil = ##f
>         \time 25/16
>         \scaleDurations 8/4 { bf''8[(\mf a16]) r }
>         \scaleDurations 7/4 { bf8[( a16]) r }
>         \scaleDurations 6/4 { bf8[( a16]) r }
>         bf8[( a16]) r
>         \time 4/4
>         \tuplet 5/4 {
>           bf8( c df ef
>           << e { s1*15/320 \bar "" \ctxMom s } >>
>         }
>         fs2
>         \time 7/8
>         \scaleDurations 7/8 { e4 ds cs bs) }
>         \time 9/16
>         R1*9/16\fermataMarkup
>         \time 4/4
>     } }
>   >>
> }
> 
> ScoreFifteenFirstViolinA = {
>   <<
>     { \relative {
>       d'8(\p\>\glissando^\gliss g)\! r4
>       \override DynamicText.X-offset = #-2
>       g8(\mp\>\glissando^\gliss b)\! r4 |
>       b8(\mf\>\glissando^\gliss d)\! r4
>       \revert DynamicText.X-offset
>       d8(\f\>\glissando^\gliss e)\! r4\fermata |
>       R1*3 | R1\fermataMarkup |
>     } }
>   >>
> }
> 
> FifteenHarpsUpper = {
>   <<
>     { \relative {
>       R1 |
>       R1\fermataMarkup |
>       \key a \major
>       a''16\mf \repeat unfold 9 { gs a } b bs cs d ds e cs a e cs e
> gs
> a |
>       \break
>       \ctxMom
>       \repeat unfold 9 { b as } b cs ds e b gs e8 r \acciaccatura ds'
> e r\fermata |
>     } }
>   >>
> }
> 
> FifteenHarpsLower = {
>   <<
>     \clef bass
>     { \relative {
>        R1 | R1\fermataMarkup |
>       \key a \major
>       \clef treble
>       \repeat unfold 4 { a16 e' cs e a e cs e } | \repeat unfold 2 {
> a, fs' d fs a fs d fs } |
>       gs, e' d e gs e d e gs,8 r \clef bass \acciaccatura ds e
> r\fermata |
>      } }
>   >>
> }
> 
> \score {
>   <<
>     \new Staff \with { instrumentName = "Flute" } \FifteenFlute
>     \new PianoStaff \with { instrumentName = "Harpsichord" } <<
>       \new Staff \FifteenHarpsUpper
>       \new Staff \FifteenHarpsLower >>
>     \new Staff \with { instrumentName = "Violins I" }
> \ScoreFifteenFirstViolinA
>   >>
>   \layout {
>    \context { \Score
>               \remove "Timing_translator"
>               \remove "Default_bar_line_engraver"
>             }
>    \context {
>      \Staff
>      \consists "Timing_translator"
>      \consists "Default_bar_line_engraver"
>    }
>    \context {
>      \Voice
>      \remove "Forbid_line_break_engraver"
>    }
>    indent = 26\mm
>  }
> }
> %%%%%%%%%%%%%%%%%%%%%%%%
> 
> 
> HTH,
>   Harm

Thank you very much for all of that.

Your very first sentence answers my original question: what I had
missed was the fact that there must be a barline (possibly invisible)
in every stave at the musical moment a line break is required.

The ctxMom routine is beyond my understanding, I am afraid, both as
regards the Scheme code and also how it is used.  I can see that it
must be useful if one has a lot of such passages to typeset; but
fortunately I only have this one, and I was able to calculate the
values for the spacer rests myself.  To make sure I was doing it
correctly and also because I am not quite sure yet where I want the
line break to be in the final score, I calculated the values for all
three possible breaks (end of bars 3, 4 and 5).  I then tried inserting
a \break at each of these points in turn.

A break at the end of bar 4 or bar 5 worked fine, but I could not get
Lilypond to allow a break at the end of bar 3.  I eventually concluded
that this must be because of the beam in the flute part, so I removed
it in the code and the line break then worked.  After searching the IR
I discovered that in order to make it work with a beam I needed to add
\once \override Beam.breakable = ##t

I doubt that I shall want a line break at this point, and in any case I
could subtly alter the time values so that the beam does not cross the
barline.  But as things are the break here is still unsatisfactory
because the semiquaver just after the break has 2 long beams stretching
back to the start of the line, whereas one would ideally want 1 long
beam and a short one.  I haven't managed to figure out how this can be
changed: any ideas would be welcome.

David




reply via email to

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