2

I'm trying to reproduce a music sheet with Lilypond, and it has an introduction separate from the main theme, but still on the same "line / staff / group of staves", just like so : enter image description here

And I don't know how to reproduce that. What command would help me in that case ?

My code so far :

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

\version "2.20.0"


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

mff = ^ \markup { \italic Introduction }

pianoUpper = \relative c' {
    \override DynamicLineSpanner.staff-padding = #3
    \override BreathingSign.text = \markup {
        \musicglyph #"scripts.caesura.straight"
    }

    \clef "treble"
    \key d \minor

    \time 4/4

    <f a>2 \mff \f <f c'> |
    <f bes d>1 |
    \> << {bes4( a)} \\ {d,2} >> <e g>2 |
    %   \once \override Hairpin.to-barline = ##f
    f \fermata \breathe \! \bar "||" <a f'> \f |
    <c e> <b d> |
    <c e> <a c> |
}


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

pianoLower = \relative c {
    \override BreathingSign.text = \markup {
        \musicglyph #"scripts.caesura.straight"
    }
    \clef "bass"
    \key d \minor

    f2 a |
    bes1 |
    g2 c, |
    f \fermata \breathe f |
    c g' |
    c, f |
}


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


\score {
    <<
    \new PianoStaff <<
    \new Staff = "upper" \pianoUpper
    \new Staff = "lower" \pianoLower
    >>
    >>
}

produces :

enter image description here

2

This trick puts your introduction inside of a score inside of a markup inside of the pianoStaff instrumentName.

enter image description here

See the code here: lilypond code of answer in lilybin.com

| improve this answer | |
  • That's really cool ! A question, though. Is there a way of knowing the length of the introduction, in order to align with the rest of the sheet when indenting ? Especially since I'm trying to write a collection, and similar alignment would be neat within the different pieces. – JambonSama Jun 18 at 7:49
  • @JambonSama I'm afraid for now there is none I am aware of. Thankfully it is a single value that you have to manually code though. – Paco Vila Jun 18 at 9:23

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.