4

I'd like to get lilypond to produce the ://: mark above the stave used in hymnals (at least) to indicate "repeat the preceding line of words here" - for an example of what I mean, see the mark above the stave in the first bar of the second page. Is it possible? I've spent some time looking a snippets to no avail - it doesn't appear to be a glyph I could include using \markup or anything like that...

I found a hack, which is to use the closest-approximate unicode glyph as a breath mark:

\override BreathingSign.text = "𝄏"
\breathe
2

1 Answer 1

2

How about something like this:

#(define-markup-command (repeat-text layout props) ()
   #:properties ((font-size 0))
   (let* ((dot (interpret-markup layout props (markup #:fontsize (- font-size) #:musicglyph "scripts.staccato")))
          (ddots (ly:stencil-add dot (ly:stencil-translate dot '(0.3 . 0.6))))
          (line (make-line-stencil 0.2 0 0 0.55 1.1))
          (stc (ly:stencil-add (ly:stencil-translate ddots '(-0.3 . 0.4)) line
                               (ly:stencil-translate line '(0.4 . -0.1))
                               (ly:stencil-translate ddots '(1.02 . 0)))))
     (ly:stencil-scale stc (magstep font-size) (magstep font-size))))

{ 1
  % with 2.23 the following can be done like
  % \after 2 \mark\markup\repeat-text 2.
  <<
    {s2 \mark\markup\repeat-text}
    2.
  >>
}
4
  • Wow, that's constructing the entire thing by hand, hardcore!
    – mcv21
    Jun 8, 2022 at 16:55
  • Also, alas, this doesn't seem to work - I put your define at the top of my ly and added "\mark\markup\repeat-text" into my music after the relevant note and get an error: Preprocessing graphical objects...repton.ly:7:17: In expression (make-path-stencil (quote #) 0.2 ...): repton.ly:7:17: Unbound variable: make-path-stencil
    – mcv21
    Jun 8, 2022 at 17:09
  • @mcv21 May I inquire what Lilypond version you are using? In case you are prior to 2.19 the make-path-stencil function does not yet exists. But instead we can use make-line-stencil, which is also more simple in syntax in this example. I’ve changed by code to do this, please try again if it works for you. In any case if you are still on 2.18 or earlier please consider updating Lilypond. 2.18 is many years old and has received many improvements and bug fixes.
    – Lazy
    Jun 8, 2022 at 18:06
  • Thanks, yes I am using 2.18 (it's what comes with my distro), and your revised version does work. Though I'm afraid I conclude my unicode-related bodge is a nicer visual effect.
    – mcv21
    Jun 18, 2022 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.