1

I would like if it is possible to print parenthesis in the ":" part of a repeat barline in Lilypond. The aim is to provide the same score for three different lyrics, one of them with a repetition, while the rest don't include this repeat.

  • It will be very difficult, not impossible. Could you find some other way of notating it? For example a *segno* with a note that it is only to be followed the first time? In any case, putting a *segno* in brackets is somewhat more straightforward. – Ole V.V. Feb 18 '21 at 23:06

1 Answers1

1

Good morning! I finally could solve my own question. Here you can read my solution:

%%%%%%%%%%%%%%%%%%%%

\version "2.19.0"


%parámetros del encabezamiento:
\header {
    title = "Parenthesize in repeat barline"
%   subtitle = "Antífonas para el Cántico Evangélico"
%   arranger = "Javier Ruiz"
%   tagline="www.cancionero-liturgico.org"
%   copyright="Editado con LilyPond para Linux"
    }


global =  {
    %clave de sol (G):
    \clef G
    %armadura:
    \key d \minor
    \tempo 4=69
    \set Score.tempoHideNote = ##f
    }


visperasuno = {
\relative c''{

\time 2/4
\partial8
g8
a8 a a a
a4 g8 g
a4. %s8

\once \set Staff.whichBar = ":|."
}
}


laudes = {
\relative c''{

\time 2/4
\partial8
g8
a4 a8 a
a4 g
a4. %s8

\bar "|."
}
}


visperasdos = {
\relative c''{

\time 2/4
\partial8
g8
a8 a a8 a
a4 g8 g
a4. %s8

\bar "|."
}
}


notaspianoarriba = {
\relative c''{

\time 2/4
\partial8
r8
<a f>4 \(<a e>
<a d,>4 <g e>
<a cis,>4.\) %s8

}
}


notaspianoabajo = {
\relative c'{

\clef F

\time 2/4
\partial8
r8
<a f>2~
<a f>4 <b e,>
<a a,>4. %s8

}
}


melodiapianoarriba = {
\notaspianoarriba
\bar "|."
}

melodiapianoabajo = {
\notaspianoabajo
\bar "|."
}


melodiapianoarribarep = {
\notaspianoarriba
\once \set Staff.whichBar = ":|."
}

melodiapianoabajorep = {
\notaspianoabajo
\once \set Staff.whichBar = ":|."
}


%%%%%%%%%%%%%%%%%%%%
%DEFINING NEW GLYPHS
%%%%%%%%%%%%%%%%%%%%

#(define (make-leftparen-sign-bar-line grob extent)
   (let ((stencil (ly:font-get-glyph (ly:grob-default-font grob)
                                     "accidentals.leftparen")))
        stencil))

#(add-bar-glyph-print-procedure "(" make-leftparen-sign-bar-line)

#(define (make-rightparen-sign-bar-line grob extent)
   (let ((stencil (ly:font-get-glyph (ly:grob-default-font grob)
                                     "accidentals.rightparen")))
        stencil))

#(add-bar-glyph-print-procedure ")" make-rightparen-sign-bar-line)


\defineBarLine "(:)|." #'("(:)|." "" "   |.")



melodiapianoarribasemirep = {
\notaspianoarriba
%\override Staff.BarLine.extra-offset = #'(0 . 0)
\set Staff.whichBar = "(:)|."
}

melodiapianoabajosemirep = {
\notaspianoabajo
%\override Staff.BarLine.extra-offset = #'(0 . 0)
\set Staff.whichBar = "(:)|."
}



textovisperasuno = \lyricmode {
su -- bió a la mon -- ta -- ña, Je -- sús,
    }
textovisperasunorep = \lyricmode {
ha -- bla -- ba y~en -- se -- ña -- ba, Je -- sús.
    }

textolaudes = \lyricmode {
por -- que~e -- llos ve -- rán a Dios.
    }

textovisperasdos = \lyricmode {
se -- rán lla -- ma -- dos hi -- jos de Dios.
    }


visperasunoStaff = \context Voice = visperasunoStaff
\with {\consists "Ambitus_engraver"}
<<
    \set Staff.instrumentName = "I Vísperas"
    \set Staff.midiInstrument = #"clarinet"
    \global
    \visperasuno
    >>

laudesStaff = \context Voice = laudesStaff
\with {\consists "Ambitus_engraver"}
<<
    \set Staff.instrumentName = "Laudes"
    \set Staff.midiInstrument = #"clarinet"
    \global
    \laudes
    >>

visperasdosStaff = \context Voice = visperasdosStaff
\with {\consists "Ambitus_engraver"}
<<
    \set Staff.instrumentName = "II Vísperas"
    \set Staff.midiInstrument = #"clarinet"
    \global
    \visperasdos
    >>

vozpianoarribaStaff = \context Voice = vozpianoarribaStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \relative c' \melodiapianoarriba
    >>

vozpianoabajoStaff = \context Voice = vozpianoabajoStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \set Score.tempoHideNote = ##f
    \relative c' \melodiapianoabajo
    >>

vozpianoarribarepStaff = \context Voice = vozpianoarribarepStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \relative c' \melodiapianoarribarep
    >>

vozpianoabajorepStaff = \context Voice = vozpianoabajorepStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \set Score.tempoHideNote = ##f
    \relative c' \melodiapianoabajorep
    >>

vozpianoarribasemirepStaff = \context Voice = vozpianoarribasemirepStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \relative c' \melodiapianoarribasemirep
    >>

vozpianoabajosemirepStaff = \context Voice = vozpianoabajosemirepStaff
<<
    \override Staff.StaffSymbol #'staff-space = #(magstep -0.35)
    \set Staff.midiInstrument = #"violin"
    \global
    \set Score.tempoHideNote = ##f
    \relative c' \melodiapianoabajosemirep
    >>

textovisperasunoStaff = \context Lyrics = textovisperasunoStaff <<
    \lyricsto visperasunoStaff \textovisperasuno
    >>

textovisperasunorepStaff = \context Lyrics = textovisperasunorepStaff <<
    \lyricsto visperasunoStaff \textovisperasunorep
    >>

textolaudesStaff = \context Lyrics = textolaudesStaff <<
    \lyricsto laudesStaff \textolaudes
    >>

textovisperasdosStaff = \context Lyrics = textovisperasdosStaff <<
    \lyricsto visperasdosStaff \textovisperasdos
    >>


\book {
    \score {
        <<
        \context ChoirStaff {
            <<
            \visperasunoStaff
            \textovisperasunoStaff
            \textovisperasunorepStaff
            \laudesStaff
            \textolaudesStaff
            \visperasdosStaff
            \textovisperasdosStaff
            >>
            }
        \context PianoStaff {
            <<
            \set PianoStaff.instrumentName = #"Órgano"
            \vozpianoarribasemirepStaff
            \vozpianoabajosemirepStaff
            >>
            }
        >>
        \layout {
                \context {
                \Lyrics
                \override LyricText #'font-size = #2
                }
             \context {
                \Score
                \override StaffSymbol #'staff-space = #(magstep +2)
                \override SpacingSpanner.base-shortest-duration = #(ly:make-moment 1/32)
                }
            }
        }
    \score {
        \unfoldRepeats
        <<
        \context ChoirStaff {
            <<
            \visperasunoStaff
            >>
            }
        \context PianoStaff {
            <<
            \vozpianoarribaStaff
            \vozpianoabajoStaff
            >>
            }
        >>
        \midi {
            \context {
                \Score
                tempoWholesPerMinute = #(ly:make-moment 70 4)
                }
            }
        }
    }