10

I am typesetting scores using Lilypond and would like to print a Da Capo, but haven't found a standard command to do so. I am currently working around this issue by using \mark "D.C.".

However, the mark is sometimes placed on the next line. Also, I would rather use a single command and be sure to always get the same result, rather than having to type the text out every time.

3 Answers 3

3

For future readers:
Newer versions of LilyPond (v2.23 and above) have an inbuilt way to encode Da Capo and related repeats.

There is a new repeat structure \repeat segno, this works somewhat similarly to \repeat volta. There are also new commands like \volta, \fine and \section that work with this new structure. Using these, you won't have to type out the text at all.

Here is a simple example of a Da Capo repeat:

\version "2.23.6"

contents = {
    \new Staff {
        \repeat segno 2 {
            a'1 |
            b'1 |
            \volta 2 \fine
        }
    }
}   
    
%% PDF
\score {
    \contents
    \layout { }
}

%% MIDI
\score {
    \unfoldRepeats
    \contents
    \midi { }
}

simple example of Da Capo repeat

See this page of the documentation for more detail:
1.4.1 Long Repeats - Segno repeat structure

10

As alephzero noted you have to set the visibility of the mark. Because these kind of marks frequently need the same treatment you can setup your own commands for them so you don't have to remember the details of the visibility controls and clutter up your code.

For example I keep a common library file around with a bunch of commands that I use a lot. Among them are some commands for getting marks the way I like them. These can then be used in my music just by calling \DS or whichever variant I want:

DSfine = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small "D.S. al fine" }
}

DS = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small "D.S." }
}

DCfine = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small "D.C. al fine" }
}

DCcoda = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small "D.C. al coda" }
}

DScoda = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small "D.S. al coda" }
}

Fine = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small \italic "fine" }
}

GotoCoda = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#t #t #f)
  \mark \markup { \small \musicglyph #"scripts.coda" }
}

Coda = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#f #t #t)
  \mark \markup { \small \musicglyph #"scripts.coda" }
}

Segno = {
  \once \override Score.RehearsalMark #'break-visibility = #'#(#f #t #t)
  \mark \markup { \small \musicglyph #"scripts.segno" }
}
7

When some music notation is attached to a bar line that coincides with the end of a system in the score, you may want to print the notation at the end of that system, at the start of the next system, or even in both places (for example a key signature change).

Lilypond "knows" the standard rules for various types of notation. The defaults are listed in http://lilypond.org/doc/v2.18/Documentation/notation/visibility-of-objects#using-break_002dvisibility, but you can override them as shown on that page.

To force your "fake rehearsal mark" to appear in the middle of a system or at the end, but not at the beginning, use

\once \override Score.RehearsalMark.break-visibility = #begin-of-line-invisible

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.