1

I'm trying to put custom text in voltas when engraving with Lilypond. The problem is not to add text, but to add it with the formatting I want. I am aware that a similar question was asked and answered ( Markup text inside second volta bracket ) but it doesn't answer my problem because the result is really ugly. It's what I already have, except the method is different; I tried it, so except if I did something wrong, it's not what I want.

What I have for now looks like :

enter image description here

The idea is that the text in the voltas would rather look like the text I put under the B and the C in the first two measures.

My code for now is :

%%%%%%%%%%
%% VERSION
%%%%%%%%%%

\version "2.20.0"

\paper {
    #(include-special-characters)
}


%%%%%%%%%
%% LYRICS
%%%%%%%%%

singerLyrics = \lyricmode {
    _ |
    _ |
    _ |
    _ |
}

null = {
    \time 4/4
    
}


%%%%%%%%%%%
%% PIANO UP
%%%%%%%%%%%

aaaa = _ \markup { \italic \teeny "Suite" }
bbbb = \tweak DynamicText.self-alignment-X #LEFT
    #(make-dynamic-script 
        (markup 
        #:with-dimensions '(0 . 5) '(0 . 0) #:line 
            (#:normal-text #:italic #:teeny "Fin")))

pianoUpper = \relative c' {
    \override DynamicLineSpanner.staff-padding = #3
    \override BreathingSign.text = \markup {
        \musicglyph #"scripts.caesura.straight"
    }
    \clef "treble"
    \key f \major
    
    \time 4/4
    
    bes1 \bbbb
    \set Score.repeatCommands = #'((volta "Suite"))
    c \aaaa
    \set Score.repeatCommands = #'((volta #f)) \bar "||"
    \set Score.repeatCommands = #'((volta "Fin"))
    d
    \set Score.repeatCommands = #'((volta #f))
    \bar "||"
    e_"D.S. al Fine" \bar "S-S"
    \break
}


%%%%%%%%%%%%
%% PIANO LOW
%%%%%%%%%%%%

pianoLower = \relative c {
    \clef "bass"
    \key f \major
    
}


%%%%%%%%
%% SCORE
%%%%%%%%

\score {
    <<
    \new PianoStaff <<
    \new Staff = "upper" <<
    \new Voice \pianoUpper
    \new NullVoice = "singer" \null
    >>
    \new Lyrics \with { alignAboveContext = "upper" } \lyricsto singer \singerLyrics
    \new Staff = "lower" \pianoLower
    >>
    >>
}

Any idea how to obtain that ?

2

This seems to work. Just don't put anything before \text. Modified
\set Score.repeatCommands = #(list(list 'volta finVoltaTxt) 'end-repeat) to same form as \set Score.repeatCommands = #(list(list 'volta suiteVoltaTxt)) because the two variables suiteVoltaTxt and finVoltaTxt should really be together; not one done one way, the other done another way.

suiteVoltaTxt = \markup { \text \italic Suite}
finVoltaTxt = \markup { \text \italic Fin}

pianoUpper = \relative c' {
  \key f \major
  \time 4/4
   
   bes1
   \set Score.repeatCommands = #(list(list 'volta suiteVoltaTxt))
   c1 
   \set Score.repeatCommands = #(list(list 'volta finVoltaTxt) 'end-repeat)
   d1
   \set Score.repeatCommands = #'((volta #f))
   e |
  
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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