I'm not content with my skills in engraving coda jumps.  I suspect
Lilypond could do better if I knew how to code it.

My current method is to use a rehearsal mark to concatenate some
text and a Coda glyph, and then apply a trial-end-error X-offset
until it lines up the way I want it to, and then when the layout
changes, I usually have to adjust it again.

In my example code, the first score uses \toCoda to create coda
glyph centered very nicely over the barline.  I modify the
visibility properties of the rehearsal mark so that if the barline
is broken, the coda mark will not be visibile at the beginning of
a line.  I also set the outside-staff-priority so that the coda
glyph will be engraved in between the staff and the volta
brackets.  And yes, many of the coda marks are placed oddly in
the code, to demonstrate that the break-visibility property is
doing what I want it to do.

This code also scales well to the smaller size shown in the second
example, although I don't understand why a magnification factor of
1.0 results in a smaller size.

The third variable 'txtCoda' contains a more detailed representation
of what I like to use, but it requires manual manipulation to get it
to align, and one size does not fit all.

How can I create a coda mark which:

1) aligns the X-center line of the coda glyph with the X-center of
the barline;

2) places the arbitrary "to Coda" alongside the glyph, while leaving
the glyph itself centered over the barline; and

3) can be scaled easily (text and glyph) to different sizes, without
disturbing the alignment of the coda glyph to the barline?

An elegant solution to this would be very welcome.  Thank you for
your time.

Jim
\version "2.16.1"
#(set-global-staff-size 20)

toCoda = {
  \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
  \once \override Score.RehearsalMark #'outside-staff-priority = #5
  \mark \markup { \musicglyph #"scripts.coda" }
}

toCodasmall = {
  \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
  \once \override Score.RehearsalMark #'outside-staff-priority = #5
  \mark \markup { \magnify #1.0 \musicglyph #"scripts.coda" }
}

txtCoda = {
  \once \override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible
  \once \override Score.RehearsalMark #'X-offset = #-11.5
  \once \override Score.RehearsalMark #'outside-staff-priority = #5
  \mark \markup { \concat { "to Coda  " \raise #1 \musicglyph #"scripts.coda" } }
}

\score {
  \new Staff { 
    \toCoda R1 \toCoda \bar "||" | R1 \break
    \toCoda R1 \toCoda
    \repeat volta 2 { R1 } \alternative { R1 { R1 \toCoda } } \break
    \repeat volta 2 { R1 \toCoda } \alternative { R1 R1 } \break
  }
}

\score {
  \new Staff { 
    \toCodasmall R1 \toCodasmall \bar "||" | R1 \break
    \toCodasmall R1 \toCodasmall
    \repeat volta 2 { R1 } \alternative { R1 { R1 \toCodasmall } } \break
    \repeat volta 2 { R1 \toCodasmall } \alternative { R1 R1 } \break
  }
}

\score {
  \new Staff { 
    \txtCoda R1 \txtCoda \bar "||" | R1 \break
    \txtCoda R1 \txtCoda
    \repeat volta 2 { R1 } \alternative { R1 { R1 \txtCoda } } \break
    \repeat volta 2 { R1 \txtCoda } \alternative { R1 R1 } \break
  }
}

<<attachment: coda.png>>

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

Reply via email to