\version "2.12.2"
\pointAndClickOff
%%----------------------------------------------------------
\header {
 title = \markup { \fontsize #-2 "Sergei Rachmaninoff - Prelude No. 6 Op. 23 (Extrait) " } 
 subtitle =  \markup { \fontsize #-2  #( ly:export (string-append  "Comparaison de gravure : en haut  édition de 1904 gravé à la main - en bas LilyPond "  ( lilypond-version ))) }
 subsubtitle = \markup { \fontsize #-1 \center-column { "Mesures 27–30 choisies en raison de leurs complications pour les graveurs." }}
 copyright = \markup {  "D'après les travaux de Adrew" \with-url #"http://www.musicbyandrew.ca/finale-lilypond-1.html" "http://www.musicbyandrew.ca/" }
 tagline = ##f
}
%%----------------------------------------------------------
#(set-global-staff-size 18) 
\paper {
   #(set-paper-size "a4")
   indent = 0
     
    top-margin =  0\mm
    bottom-margin =  5\mm
    after-title-space = 0\mm
        
    ragged-bottom =  ##t    
    ragged-last-bottom =  ##f           
    ragged-right = ##f  
}
%%----------------------------------------------------------
lh = \markup { \tiny \bold \bold "L.H." }
rh = \markup { \tiny \bold \bold "R.H." }
%%----------------------------------------------------------
RightHandOne = \relative c'' { 
    \override Score.BarNumber #'break-visibility = #'#(#f #t #t )
    \set Score.currentBarNumber = #27
    \bar ""
    \clef treble \key ees \major
    g8 bes\( ees g bes <d, d'> <ees ees'> f'\)
    <g, bes ees g>8\( <f bes des f> <g c ees> 
    <c, c'> ~ <c c'> <bes bes'> <aes aes'> <g g'>\)
    <ees' g ees'>8\( <bes ees bes'> 
    \override TieColumn #'tie-configuration =  #'((-1.0 . 0) ( 7.5 . 0))
    <aes aes'>4 ~ <aes aes'>8 <g g'> <f f'> <e e'>\)
    <c' e c'>8\( <g c g'> <c f> 
    \override TieColumn #'tie-configuration =  #'((-3.8 . 0) ( 4.0 . 0))
    <ees, ees'> ~ <ees ees'> <c c'> <des des'> <d d'>\) %30
    \once \override Voice.Rest #'Y-offset = #0.0 
    %r8
}

RightHandTwo = \relative c'' { 
    <bes, ees>4 r \change Staff = LH \stemUp bes16 ees f g bes 
    \change Staff = RH \stemDown ees f bes
    r8%\pp
    \once \override TextScript #'extra-offset = #'( -1 . 2.0)
    bes,16-\lh (\( c) 
    \once \override TextScript #'extra-offset = #'( -1 . 5.0)
    \once \override Beam #'positions = #'(-2.1 . -1.8) {ees -\rh f fis aes }
    \once \override Beam #'positions = #'(-1.2 . -2.2) {g ees8 des16} 
    c ces bes ees\)
    r8 
    \once \override TextScript #'extra-offset = #'( -1 . 2.2)
    ees,16-\lh(\( f) 
    \once \override TextScript #'extra-offset = #'( -1 . 5.5)
    ees'-\rh bes c f 
    \once \override Beam #'positions = #'(-2.7 . -3.0)
    ees c8 bes16 aes bes c g\)
    r8 
    \once \override TextScript #'extra-offset = #'( -1 . 2.0)
    c,16-\lh(\( e) 
    \once \override Beam #'positions = #'(-4.7 . -3.7) {
    \once \override TextScript #'extra-offset = #'( -1 . 5.0)
    f-\rh g aes bes} 
    \once \override Beam #'positions = #'(-3.7 . -4.7) {c aes8 g16} 
    aes f bes bes,\)
    %s8
}

LeftHandOne = \relative c, {
    \clef bass \key ees \major
    \stemNeutral ees16 bes' ees f g aes a c bes4_- c_-
    <des~ g, ees,>2-- \arpeggio^\pp des8 g,( aes bes)
    \stemUp b\arpeggio des c4~ c8 e,( f g)
    g8\arpeggio bes aes4~ aes8 e f aes
    %g16
}

LeftHandTwo = \relative c, {
    s1*2
    ees'2\arpeggio r2 
    \once \override Arpeggio #'positions = #'( 0 . 7)   ees,!2\arpeggio r2
    %ees8
}

%%----------------------------------------------------------
staffPiano = \new PianoStaff <<
    \new Staff = "RH" { 
        <<
        \new Voice {\voiceOne \RightHandOne}
        \new Voice {\voiceTwo \RightHandTwo}
        >>
    }

    \new Staff = "LH" {
        \set Staff.connectArpeggios = ##t
        <<
        \new Voice {\voiceOne \LeftHandOne}
        \new Voice {\voiceTwo \LeftHandTwo}
        >>
    }
>>
%%----------------------------------------------------------
\markup { \hspace #-4 \epsfile #X #124 #"handengraved-img.eps" }
%%----------------------------------------------------------


commentaire = \markup { 
 \column { 
     \fontsize #2.5 { #( ly:export (string-append  "LilyPond version  "  ( lilypond-version )))   }
     \fontsize #-1 { 
     "Quelques adaptations ponctuelles : m. 27 inversion des hampes et repositionnement du silence m.31;" 
     "ajustement des textes \"L.H\" et \"R.H\" ainsi que les ligatures des notes justaposées m.28, m.29, m.30."
     "Les modifications ont nécessités de remplacer localement et temporairement les définitions des voix."
              }
        } 
 }
%%----------------------------------------------------------
\score {  
    <<  
    \override Score.NoteCollision #'merge-differently-headed = ##f
    \override Score.TimeSignature #'transparent = ##t
    \staffPiano
    >>
    
    \midi { 
    }
    \layout {
        \context {
            \Staff
            \consists Span_arpeggio_engraver
        }
    }
    \header { piece = \markup{  \commentaire }}
}
%%------------------------------------------------------ EOF