Re: Spacing lyrics to avoid visible bar lines only

2018-11-05 Thread Joel
On 31. Oct 2018, 23:13 +, Thomas Morley , wrote:
> Am Mi., 31. Okt. 2018 um 18:11 Uhr schrieb joelhamme :
> >
> > My fellow singers in choir have been asking me to improve the visual 
> > chunking
> > of choir staves. They wanted to have closed bar lines on the right edge of
> > each choir staff.
> >
> > Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
> > results in collisions with the lyrics, which is particularly unappealing
> > with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
> > to `Lyrics` and hiding them as described in ^[notation lyrics].
> >
> > However, for aesthetical reasons I prefer removing all span bars, except
> > non-defaults and single bar bars at the end of each line. So this would
> > leave all repeats and double bar lines but no single bars unless there's a
> > line break, much like ^[semi choir staff snippet]
> >
> > I've found a way to do this, except that there's some spacing issue with the
> > lyrics at single bars that aren't even shown. In choir staves, lyrics can
> > move below a bar line to take up the available space, which leaves a more
> > pleasing appearance and saves space on the page. Sadly, I could either make
> > the lyrics avoid all bar lines or not at all, but not only the ones that are
> > actually shown.
> >
> > To the point:
> > I would like to make the lyrics avoid some span bars while not avoiding the
> > bar lines I've omitted using a call back.
> >
> > To illustrate I've compiled a somewhat minimal example using long words to
> > trigger some collisions. For convenience I've also uploaded it to
> > ^[lilybin].
> >
> > 
> >
> > ```lilypond
> > \version "2.18.2"
> >
> > link = {
> > \once \override Score.RehearsalMark.self-alignment-X = #LEFT
> > \mark \markup \normalsize {
> > \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
> > }
> > }
> >
> > redspn = \once \override Score.SpanBar.color = #red
> > grnbar = \once \override Score.BarLine.color = #green
> >
> > notes = {
> > \link
> > c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
> > }
> >
> > words = \lyricmode {
> > Breathes | \markup { \with-color #red breathes } |
> > br | \markup { \with-color #green breathes } |
> > breathes | br | breathes |
> > }
> >
> > \score {
> > \new ChoirStaff <<
> > \new Staff \relative c'' \notes \addlyrics \words
> > \new Staff \relative c'' \notes
> > > >
> >
> > \layout {
> > indent = 0
> > \context { \ChoirStaff
> > \consists "Span_bar_engraver"
> > \override BarLine.after-line-breaking =
> > #(lambda (grob)
> > (if
> > (and (= 0 (ly:item-break-dir grob))
> > (string=? (ly:grob-property grob 'glyph-name) "|") )
> > (ly:grob-set-property! grob 'allow-span-bar #f)))
> > }
> >
> > % \context { \Lyrics
> > % \consists "Bar_engraver"
> > % \hide BarLine
> > % \override BarLine.after-line-breaking =
> > % #(lambda (grob)
> > % (if
> > % (and (= 0 (ly:item-break-dir grob)))
> > % (string=? (ly:grob-property grob 'glyph-name) "|")
> > % (ly:grob-set-property! grob 'stencil #f))
> > % )
> > % }
> > }
> > }
> > ```
> >
> > The red colour indicates an unacceptable collision, whereas the green colour
> > indicates the desired loose spacing under bars that are not spanned across
> > staves. The commented-out section removes the relevant bar line stencils
> > from the lyrics, but fails to loosen the spacing where there are no longer
> > any bars to avoid.
> >
> > Can I conditionally add bar lines to lyrics without otherwise affecting
> > their spacing?
> >
> > Sorry this got so long, any help would be much appreciated.
> >
> > Cheers,
> > Joel
> >
> > [notation lyrics]:
> > http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
> > [semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
> > [lilybin]: http://lilybin.com/wmw4xx/6
>
> How about:
>
> \version "2.18.2"
>
> %% srfi-1 is not present inside \layout (needed for 'every')
> %% Thus defined at toplevel
> #(define set-extra-spacing-height-for-span-bars
> (lambda (grob)
> (let* ((pap-col (ly:item-get-column grob))
> (nmpc (ly:grob-object pap-col 'left-neighbor))
> (nmpc-elts-array (ly:grob-object nmpc 'elements))
> (nmpc-elts-ls (if (ly:grob-array? nmpc-elts-array)
> (ly:grob-array->list nmpc-elts-array)
> '()))
> (sp-bl
> (filter
> (lambda (g) (grob::has-interface g 'span-bar-interface))
> nmpc-elts-ls))
> (sp-bl-glyphs
> (map (lambda (g) (ly:grob-property g 'glyph-name)) sp-bl)))
> (if (every (lambda (gl) (not (string=? "|" gl))) sp-bl-glyphs)
> '(-inf.0 . +inf.0)
> '(0 . 0)
>
>
>
> link = {
> \once \override Score.RehearsalMark.self-alignment-X = #LEFT
> \mark \markup \normalsize {
> \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
> }
> }
>
> redspn = \once \override Score.SpanBar.color = #red
> grnbar = \once \override Score.BarLine.color = #green
>
> notes = {
> 

Re: Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread Thomas Morley
Am Mi., 31. Okt. 2018 um 18:11 Uhr schrieb joelhamme :
>
> My fellow singers in choir have been asking me to improve the visual chunking
> of choir staves. They wanted to have closed bar lines on the right edge of
> each choir staff.
>
> Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
> results in collisions with the lyrics, which is particularly unappealing
> with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
> to `Lyrics` and hiding them as described in ^[notation lyrics].
>
> However, for aesthetical reasons I prefer removing all span bars, except
> non-defaults and single bar bars at the end of each line. So this would
> leave all repeats and double bar lines but no single bars unless there's a
> line break, much like ^[semi choir staff snippet]
>
> I've found a way to do this, except that there's some spacing issue with the
> lyrics at single bars that aren't even shown. In choir staves, lyrics can
> move below a bar line to take up the available space, which leaves a more
> pleasing appearance and saves space on the page. Sadly, I could either make
> the lyrics avoid all bar lines or not at all, but not only the ones that are
> actually shown.
>
> To the point:
> I would like to make the lyrics avoid some span bars while not avoiding the
> bar lines I've omitted using a call back.
>
> To illustrate I've compiled a somewhat minimal example using long words to
> trigger some collisions. For convenience I've also uploaded it to
> ^[lilybin].
>
> 
>
> ```lilypond
> \version "2.18.2"
>
> link = {
>   \once \override Score.RehearsalMark.self-alignment-X = #LEFT
>   \mark \markup \normalsize {
> \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
>   }
> }
>
> redspn = \once \override Score.SpanBar.color = #red
> grnbar = \once \override Score.BarLine.color = #green
>
> notes = {
>   \link
>   c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
> }
>
> words = \lyricmode {
>   Breathes | \markup { \with-color #red breathes } |
>   br | \markup { \with-color #green breathes } |
>   breathes | br | breathes |
> }
>
> \score {
>   \new ChoirStaff <<
> \new Staff \relative c'' \notes \addlyrics \words
> \new Staff \relative c'' \notes
>   >>
>
>   \layout {
> indent = 0
> \context { \ChoirStaff
>   \consists "Span_bar_engraver"
>   \override BarLine.after-line-breaking =
> #(lambda (grob)
>   (if
> (and (= 0 (ly:item-break-dir grob))
>  (string=? (ly:grob-property grob 'glyph-name) "|") )
> (ly:grob-set-property! grob 'allow-span-bar #f)))
> }
>
> % \context { \Lyrics
> % \consists "Bar_engraver"
> % \hide BarLine
> % \override BarLine.after-line-breaking =
> %   #(lambda (grob)
> % (if
> %   (and (= 0 (ly:item-break-dir grob)))
> %(string=? (ly:grob-property grob 'glyph-name) "|")
> %   (ly:grob-set-property! grob 'stencil #f))
> %   )
> % }
>   }
> }
> ```
>
> The red colour indicates an unacceptable collision, whereas the green colour
> indicates the desired loose spacing under bars that are not spanned across
> staves. The commented-out section removes the relevant bar line stencils
> from the lyrics, but fails to loosen the spacing where there are no longer
> any bars to avoid.
>
> Can I conditionally add bar lines to lyrics without otherwise affecting
> their spacing?
>
> Sorry this got so long, any help would be much appreciated.
>
> Cheers,
> Joel
>
> [notation lyrics]:
> http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
> [semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
> [lilybin]: http://lilybin.com/wmw4xx/6

How about:

\version "2.18.2"

%% srfi-1 is not present inside \layout (needed for 'every')
%% Thus defined at toplevel
#(define set-extra-spacing-height-for-span-bars
  (lambda (grob)
(let* ((pap-col (ly:item-get-column grob))
   (nmpc (ly:grob-object pap-col 'left-neighbor))
   (nmpc-elts-array (ly:grob-object nmpc 'elements))
   (nmpc-elts-ls (if (ly:grob-array? nmpc-elts-array)
   (ly:grob-array->list nmpc-elts-array)
   '()))
   (sp-bl
 (filter
   (lambda (g) (grob::has-interface g 'span-bar-interface))
   nmpc-elts-ls))
   (sp-bl-glyphs
  (map (lambda (g) (ly:grob-property g 'glyph-name)) sp-bl)))
 (if (every (lambda (gl) (not (string=? "|" gl))) sp-bl-glyphs)
 '(-inf.0 . +inf.0)
 '(0 . 0)



link = {
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark \markup \normalsize {
\with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
  }
}

redspn = \once \override Score.SpanBar.color = #red
grnbar = \once 

Re: Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread Jan-Peter Voigt
Hello Joel,

when I typeset choir scores, which I do most often, I use the
self-alignment-X override for long syllables:

words = \lyricmode {
  Breathes | \once \override LyricText.self-alignment-X = #-.5 \markup {
\with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  \once \override LyricText.self-alignment-X = #-.6 breathes | br |
breathes |
}

That harmonizes spacing. If you read some of my former posts you will
know I do inject those overrides with the edition-engraver because it
would be very tedious to place them alll inside the lyrics.
But with a small command
sax = #(define-music-function (parser location v)(number?) #{ \once
\override LyricText.self-alignment-X = #v #})

(or shorter in the V2.19 form - this doesn't work 2.18.2)
sax = \once \override LyricText.self-alignment-X = \etc

its not that much text, if you place them inside the lyrics:
   Breathes | \sax #-.5 \markup { \with-color #red breathes } |


I hope this small hint helps
Cheers,
Jan-Peter


Am 31.10.18 um 17:58 schrieb joelhamme:
> My fellow singers in choir have been asking me to improve the visual chunking
> of choir staves. They wanted to have closed bar lines on the right edge of
> each choir staff.
> 
> Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
> results in collisions with the lyrics, which is particularly unappealing
> with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
> to `Lyrics` and hiding them as described in ^[notation lyrics].
> 
> However, for aesthetical reasons I prefer removing all span bars, except
> non-defaults and single bar bars at the end of each line. So this would
> leave all repeats and double bar lines but no single bars unless there's a
> line break, much like ^[semi choir staff snippet]
> 
> I've found a way to do this, except that there's some spacing issue with the
> lyrics at single bars that aren't even shown. In choir staves, lyrics can
> move below a bar line to take up the available space, which leaves a more
> pleasing appearance and saves space on the page. Sadly, I could either make
> the lyrics avoid all bar lines or not at all, but not only the ones that are
> actually shown.
> 
> To the point:
> I would like to make the lyrics avoid some span bars while not avoiding the
> bar lines I've omitted using a call back.
> 
> To illustrate I've compiled a somewhat minimal example using long words to
> trigger some collisions. For convenience I've also uploaded it to
> ^[lilybin].
> 
>  
> 
> ```lilypond
> \version "2.18.2"
> 
> link = {
>   \once \override Score.RehearsalMark.self-alignment-X = #LEFT
>   \mark \markup \normalsize {
>   \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
>   }
> }
> 
> redspn = \once \override Score.SpanBar.color = #red
> grnbar = \once \override Score.BarLine.color = #green
> 
> notes = {
>   \link
>   c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
> }
> 
> words = \lyricmode {
>   Breathes | \markup { \with-color #red breathes } |
>   br | \markup { \with-color #green breathes } |
>   breathes | br | breathes |
> }
> 
> \score {
>   \new ChoirStaff <<
> \new Staff \relative c'' \notes \addlyrics \words
> \new Staff \relative c'' \notes
>   >>
> 
>   \layout {
> indent = 0
> \context { \ChoirStaff
>   \consists "Span_bar_engraver"
>   \override BarLine.after-line-breaking =
> #(lambda (grob)
>   (if
> (and (= 0 (ly:item-break-dir grob))
>  (string=? (ly:grob-property grob 'glyph-name) "|") )
> (ly:grob-set-property! grob 'allow-span-bar #f)))
> }
>   
>   % \context { \Lyrics
> % \consists "Bar_engraver"
> % \hide BarLine
> % \override BarLine.after-line-breaking =
> %   #(lambda (grob)
> % (if
> %   (and (= 0 (ly:item-break-dir grob)))
> %(string=? (ly:grob-property grob 'glyph-name) "|")
> %   (ly:grob-set-property! grob 'stencil #f))
> %   )
> % }
>   }
> }
> ```
> 
> The red colour indicates an unacceptable collision, whereas the green colour
> indicates the desired loose spacing under bars that are not spanned across
> staves. The commented-out section removes the relevant bar line stencils
> from the lyrics, but fails to loosen the spacing where there are no longer
> any bars to avoid.
> 
> Can I conditionally add bar lines to lyrics without otherwise affecting
> their spacing?
> 
> Sorry this got so long, any help would be much appreciated.
> 
> Cheers,
> Joel
> 
> [notation lyrics]:
> http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
> [semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
> [lilybin]: http://lilybin.com/wmw4xx/6
> 
> 
> 
> 
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
> 
> 

Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread joelhamme
My fellow singers in choir have been asking me to improve the visual chunking
of choir staves. They wanted to have closed bar lines on the right edge of
each choir staff.

Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
results in collisions with the lyrics, which is particularly unappealing
with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
to `Lyrics` and hiding them as described in ^[notation lyrics].

However, for aesthetical reasons I prefer removing all span bars, except
non-defaults and single bar bars at the end of each line. So this would
leave all repeats and double bar lines but no single bars unless there's a
line break, much like ^[semi choir staff snippet]

I've found a way to do this, except that there's some spacing issue with the
lyrics at single bars that aren't even shown. In choir staves, lyrics can
move below a bar line to take up the available space, which leaves a more
pleasing appearance and saves space on the page. Sadly, I could either make
the lyrics avoid all bar lines or not at all, but not only the ones that are
actually shown.

To the point:
I would like to make the lyrics avoid some span bars while not avoiding the
bar lines I've omitted using a call back.

To illustrate I've compiled a somewhat minimal example using long words to
trigger some collisions. For convenience I've also uploaded it to
^[lilybin].

 

```lilypond
\version "2.18.2"

link = {
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark \markup \normalsize {
\with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
  }
}

redspn = \once \override Score.SpanBar.color = #red
grnbar = \once \override Score.BarLine.color = #green

notes = {
  \link
  c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
}

words = \lyricmode {
  Breathes | \markup { \with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  breathes | br | breathes |
}

\score {
  \new ChoirStaff <<
\new Staff \relative c'' \notes \addlyrics \words
\new Staff \relative c'' \notes
  >>

  \layout {
indent = 0
\context { \ChoirStaff
  \consists "Span_bar_engraver"
  \override BarLine.after-line-breaking =
#(lambda (grob)
  (if
(and (= 0 (ly:item-break-dir grob))
 (string=? (ly:grob-property grob 'glyph-name) "|") )
(ly:grob-set-property! grob 'allow-span-bar #f)))
}

% \context { \Lyrics
% \consists "Bar_engraver"
% \hide BarLine
% \override BarLine.after-line-breaking =
%   #(lambda (grob)
% (if
%   (and (= 0 (ly:item-break-dir grob)))
%(string=? (ly:grob-property grob 'glyph-name) "|")
%   (ly:grob-set-property! grob 'stencil #f))
%   )
% }
  }
}
```

The red colour indicates an unacceptable collision, whereas the green colour
indicates the desired loose spacing under bars that are not spanned across
staves. The commented-out section removes the relevant bar line stencils
from the lyrics, but fails to loosen the spacing where there are no longer
any bars to avoid.

Can I conditionally add bar lines to lyrics without otherwise affecting
their spacing?

Sorry this got so long, any help would be much appreciated.

Cheers,
Joel

[notation lyrics]:
http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
[semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
[lilybin]: http://lilybin.com/wmw4xx/6




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread Joel
My fellow singers in choir have been asking me to improve the visual chunking 
of choir staves. They wanted to have closed bar lines on the right edge of each 
choir staff.

Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and 
results in collisions with the lyrics, which is particularly unappealing with 
thick repeat bars. This can be quickly fixed by adding `Bar_engraver` to 
`Lyrics` and hiding them as described in ^[notation lyrics].

However, for aesthetical reasons I prefer removing all span bars, except 
non-defaults and single bar bars at the end of each line. So this would leave 
all repeats and double bar lines but no single bars unless there's a line 
break, much like ^[semi choir staff snippet]

I've found a way to do this, except that there's some spacing issue with the 
lyrics at single bars that aren't even shown. In choir staves, lyrics can move 
below a bar line to take up the available space, which leaves a more pleasing 
appearance and saves space on the page. Sadly, I could either make the lyrics 
avoid all bar lines or not at all, but not only the ones that are actually 
shown.

To the point:
I would like to make the lyrics avoid some span bars while not avoiding the bar 
lines I've omitted using a call back.

To illustrate I've compiled a somewhat minimal example using long words to 
trigger some collisions. For convenience I've also uploaded it to ^[lilybin].



```lilypond
\version "2.18.2"

link = {
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark \markup \normalsize {
  \with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
  }
}

redspn = \once \override Score.SpanBar.color = #red
grnbar = \once \override Score.BarLine.color = #green

notes = {
  \link
  c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
}

words = \lyricmode {
  Breathes | \markup { \with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  breathes | br | breathes |
}

\score {
  \new ChoirStaff <<
    \new Staff \relative c'' \notes \addlyrics \words
    \new Staff \relative c'' \notes
  >>

  \layout {
    indent = 0
    \context { \ChoirStaff
      \consists "Span_bar_engraver"
      \override BarLine.after-line-breaking =
        #(lambda (grob)
          (if
            (and (= 0 (ly:item-break-dir grob))
                 (string=? (ly:grob-property grob 'glyph-name) "|") )
            (ly:grob-set-property! grob 'allow-span-bar #f)))
    }

        % \context { \Lyrics
    % \consists "Bar_engraver"
    % \hide BarLine
    % \override BarLine.after-line-breaking =
    %   #(lambda (grob)
    %     (if
    %       (and (= 0 (ly:item-break-dir grob)))
    %            (string=? (ly:grob-property grob 'glyph-name) "|")
    %       (ly:grob-set-property! grob 'stencil #f))
    %   )
    % }
  }
}
```

The red colour indicates an unacceptable collision, whereas the green colour 
indicates the desired loose spacing under bars that are not spanned across 
staves. The commented-out section removes the relevant bar line stencils from 
the lyrics, but fails to loosen the spacing where there are no longer any bars 
to avoid.

Can I conditionally add bar lines to lyrics without otherwise affecting their 
spacing?

Sorry this got so long, any help would be much appreciated.

Cheers,
Joel

[notation lyrics]: 
http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
[semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
[lilybin]: http://lilybin.com/wmw4xx/6
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread joelhamme
My fellow singers in choir have been asking me to improve the visual chunking
of choir staves. They wanted to have closed bar lines on the right edge of
each choir staff.

Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
results in collisions with the lyrics, which is particularly unappealing
with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
to `Lyrics` and hiding them as described in ^[notation lyrics].

However, for aesthetical reasons I prefer removing all span bars, except
non-defaults and single bar bars at the end of each line. So this would
leave all repeats and double bar lines but no single bars unless there's a
line break, much like ^[semi choir staff snippet]

I've found a way to do this, except that there's some spacing issue with the
lyrics at single bars that aren't even shown. In choir staves, lyrics can
move below a bar line to take up the available space, which leaves a more
pleasing appearance and saves space on the page. Sadly, I could either make
the lyrics avoid all bar lines or not at all, but not only the ones that are
actually shown.

To the point:
I would like to make the lyrics avoid some span bars while not avoiding the
bar lines I've omitted using a call back.

To illustrate I've compiled a somewhat minimal example using long words to
trigger some collisions. For convenience I've also uploaded it to
^[lilybin].

 

```lilypond
\version "2.18.2"

link = {
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark \markup \normalsize {
\with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
  }
}

redspn = \once \override Score.SpanBar.color = #red
grnbar = \once \override Score.BarLine.color = #green

notes = {
  \link
  c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
}

words = \lyricmode {
  Breathes | \markup { \with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  breathes | br | breathes |
}

\score {
  \new ChoirStaff <<
\new Staff \relative c'' \notes \addlyrics \words
\new Staff \relative c'' \notes
  >>

  \layout {
indent = 0
\context { \ChoirStaff
  \consists "Span_bar_engraver"
  \override BarLine.after-line-breaking =
#(lambda (grob)
  (if
(and (= 0 (ly:item-break-dir grob))
 (string=? (ly:grob-property grob 'glyph-name) "|") )
(ly:grob-set-property! grob 'allow-span-bar #f)))
}

% \context { \Lyrics
% \consists "Bar_engraver"
% \hide BarLine
% \override BarLine.after-line-breaking =
%   #(lambda (grob)
% (if
%   (and (= 0 (ly:item-break-dir grob)))
%(string=? (ly:grob-property grob 'glyph-name) "|")
%   (ly:grob-set-property! grob 'stencil #f))
%   )
% }
  }
}
```

The red colour indicates an unacceptable collision, whereas the green colour
indicates the desired loose spacing under bars that are not spanned across
staves. The commented-out section removes the relevant bar line stencils
from the lyrics, but fails to loosen the spacing where there are no longer
any bars to avoid.

Can I conditionally add bar lines to lyrics without otherwise affecting
their spacing?

Sorry this got so long, any help would be much appreciated.

Cheers,
Joel

[notation lyrics]:
http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
[semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
[lilybin]: http://lilybin.com/wmw4xx/6




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Spacing lyrics to avoid visible bar lines only

2018-10-31 Thread joelhamme
My fellow singers in choir have been asking me to improve the visual chunking
of choir staves. They wanted to have closed bar lines on the right edge of
each choir staff.

Adding the `Span_bar_engraver` to `ChoirStaff` adds a lot of clutter and
results in collisions with the lyrics, which is particularly unappealing
with thick repeat bars. This can be quickly fixed by adding `Bar_engraver`
to `Lyrics` and hiding them as described in ^[notation lyrics].

However, for aesthetical reasons I prefer removing all span bars, except
non-defaults and single bar bars at the end of each line. So this would
leave all repeats and double bar lines but no single bars unless there's a
line break, much like ^[semi choir staff snippet]

I've found a way to do this, except that there's some spacing issue with the
lyrics at single bars that aren't even shown. In choir staves, lyrics can
move below a bar line to take up the available space, which leaves a more
pleasing appearance and saves space on the page. Sadly, I could either make
the lyrics avoid all bar lines or not at all, but not only the ones that are
actually shown.

To the point:
I would like to make the lyrics avoid some span bars while not avoiding the
bar lines I've omitted using a call back.

To illustrate I've compiled a somewhat minimal example using long words to
trigger some collisions. For convenience I've also uploaded it to
^[lilybin].

 

```lilypond
\version "2.18.2"

link = {
  \once \override Score.RehearsalMark.self-alignment-X = #LEFT
  \mark \markup \normalsize {
\with-url #"http://lilybin.com/wmw4xx/6; "http://lilybin.com/wmw4xx/6;
  }
}

redspn = \once \override Score.SpanBar.color = #red
grnbar = \once \override Score.BarLine.color = #green

notes = {
  \link
  c1 \redspn | \repeat volta 2 { c | c \grnbar | c } | c | c | c \bar "|."
}

words = \lyricmode {
  Breathes | \markup { \with-color #red breathes } |
  br | \markup { \with-color #green breathes } |
  breathes | br | breathes |
}

\score {
  \new ChoirStaff <<
\new Staff \relative c'' \notes \addlyrics \words
\new Staff \relative c'' \notes
  >>

  \layout {
indent = 0
\context { \ChoirStaff
  \consists "Span_bar_engraver"
  \override BarLine.after-line-breaking =
#(lambda (grob)
  (if
(and (= 0 (ly:item-break-dir grob))
 (string=? (ly:grob-property grob 'glyph-name) "|") )
(ly:grob-set-property! grob 'allow-span-bar #f)))
}

% \context { \Lyrics
% \consists "Bar_engraver"
% \hide BarLine
% \override BarLine.after-line-breaking =
%   #(lambda (grob)
% (if
%   (and (= 0 (ly:item-break-dir grob)))
%(string=? (ly:grob-property grob 'glyph-name) "|")
%   (ly:grob-set-property! grob 'stencil #f))
%   )
% }
  }
}
```

The red colour indicates an unacceptable collision, whereas the green colour
indicates the desired loose spacing under bars that are not spanned across
staves. The commented-out section removes the relevant bar line stencils
from the lyrics, but fails to loosen the spacing where there are no longer
any bars to avoid.

Can I conditionally add bar lines to lyrics without otherwise affecting
their spacing?

Sorry this got so long, any help would be much appreciated.

Cheers,
Joel

[notation lyrics]:
http://lilypond.org/doc/v2.19/Documentation/notation/techniques-specific-to-lyrics#placing-syllables-horizontally
[semi choir staff snippet]: http://lsr.di.unimi.it/LSR/Item?id=299
[lilybin]: http://lilybin.com/wmw4xx/6




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user