lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tweaking grobs after line breaks


From: Jonathan Wilkes
Subject: tweaking grobs after line breaks
Date: Sat, 19 Sep 2009 12:57:07 -0700 (PDT)

Hello,
     I'm doing some tweaking of a score I found of Schumann's Traeumerei 
on IMSLP.  Not the greatest edition to copy from, but it's given me 
some experience tweaking in Lilypond.
     Now I'm trying to use the "my-callback" tweak shown in the NR, and I 
can't get it to change the positions of the first slur in m. 5.  I'd like 
the starting and ending positions of the slur to be at the same vertical 
position, right above the staff.
     Also, since it's just one page, I included all the code, because 
I'd be curious to hear if anyone has suggestions for input style/format in 
my code.  I'm starting to build a shorcuts.ly file to avoid typing so 
many overrides, but other than that I'd appreciate any feedback from 
any of the more experienced users.

Thanks,
Jonathan

snippet below:

\version "2.13.3"

#(define (my-callback grob)
            (let* (
                   ; have we been split?
                   (orig (ly:grob-original grob))
          
                   ; if yes, get the split pieces (our siblings) 
                   (siblings (if (ly:grob? orig)
                               (ly:spanner-broken-into orig) '() )))
          
             (if (and (>= (length siblings) 2)
                       (eq? (car (last-pair siblings)) grob)) 
               (ly:grob-set-property! grob 'control-points '((4 . 9) (6 . 13) 
(17 . 14) (21 . 12))))))

rh = { \new Staff = "rh" {
<<
\new Voice { \voiceOne
        \relative c' {
                \key f \major
                \partial 4 \once \override DynamicLineSpanner 
#'outside-staff-padding = #2 c(\p |
                \repeat volta 2 {
                f2~ f8)
                \once \override Slur #'positions = #'(2.5 . 6)                  
        
                e[(
                \once \override Hairpin #'rotation = #'(16 0 0)
                \once \override Hairpin #'to-barline = ##f
                \once \override Hairpin #'extra-offset = #'(0 . -0.5)
                \once \override Hairpin #'X-offset = #1.5
                \once \override Hairpin #'height = #0.4
                \once \override DynamicLineSpanner #'outside-staff-priority = 
##f
                \once \override DynamicLineSpanner #'avoid-slur = #'inside
                f^\< a] |
                \once \override Beam #'positions = #'(3.5 . 4)
                c\! f) f2 e8( d |
                \once \override Beam #'positions = #'(4 . 3.5)
                c[ f) g,( a]
                \once \override Beam #'positions = #'(3.5 . 3)
                bes[ d) f,( g] |
                a c g2)
                \once \override Slur #'outside-staff-priority = #1
                \once \override Slur #'after-line-breaking = #my-callback
                c,4^( \break |
                f2~ f8)
                \once \override Slur #'positions = #'(3 . 7)
                e[(
                \once \override Hairpin #'rotation = #'(19 0 0)
                \once \override Hairpin #'to-barline = ##f
                \once \override Hairpin #'extra-offset = #'(0 . -0.75)
                \once \override Hairpin #'X-offset = #1.5
                \once \override Hairpin #'height = #0.5
                \once \override DynamicLineSpanner #'outside-staff-priority = 
##f
                \once \override DynamicLineSpanner #'avoid-slur = #'inside      
        
                f^\< a] |
                c\! a') a4.\( g8[ f e] |
                f[ a d, f] e4. ees8 |
                d4 e!_\markup { \hspace #0.5 \italic \center-align "ritard." } 
\acciaccatura c8 c2*1/2\) e,8\rest \once \override Slur 
#'outside-staff-priority = #1 \once \override Slur #'extra-offset = #'(-2 . 0) 
c( \break |
                }
                f2~ f8) e([ f a] |
                c ees) ees2 d8( c |
                bes[ d g, a] bes4. a8 |
                g4. d8~ d4) b'8\rest f( |
                bes2~ bes8) a([ bes d] |
                f bes) bes2 a8( g |
                f[ a d, e] f4. e8 |
                d4. a8~ a4) \afterGrace g( { \once \override Stem 
#'stroke-style = #"grace" c,8 } |
                f2~ f8) e[( f a] |
                c f) f2 e8( d |
                c[ f) g,( a] bes[ d) f,( g] |
                a c g2) c,4( |
                f2~ f8) e[( f a] |
                c a') a4.\fermata g8[( f d] |
                c[ f) g,( a] bes[ d) g,( a] |
                bes[ d) d,^\p( \once \override NoteSpacing #'X-extent = #'(0 . 
2) <e c>] f!2) -\tweak #'staff-padding #0.5 \fermata |
                
        }
}
\new Voice { \voiceTwo
        \relative c {
                \partial 4 s4 |
                r <f c'>2. |
                r4 f'2.~ |
                f4 e2 c4~ |
                c c2 c4 |
                r4 <f, c'>2. |
                r4 <g' a>2.~ |
                a4. aes8 \once \override Slur #'Y-extent = #'(0 . 0) g([ c e, 
fis] |
                f!2) e4*2 |
                r4 <f, c'>2. |
                c''8 bes << { a2 } \new Voice { \voiceTwo s4 \change Staff = 
"lh" \stemUp d,8 \change Staff = "rh" \stemDown \once \override NoteSpacing 
#'X-extent = #'(1 . 2.5) fis } >> a4 |
                g4. ees8( d)[ g bes, c] |
                s4. c8 bes4 s |
                r4 <bes f'>2. |
                << { f''4 e2 } \new Voice { \voiceTwo s2 \change Staff = "lh" 
\once \override NoteColumn #'force-hshift = #-2 \stemUp a,8 \change Staff = 
"rh" \stemDown \once \override NoteSpacing #'X-extent = #'(0 . 2.5) cis } >> e4 
|
                d4. s8 s2 |
                s4. g,8 f4 e |
                r4 <f, c'>2. |
                r4 f'2.~ |
                f4 e2 c4~ |
                c c2 c4 |
                r4 <f, c'>2. |
                r4 <f' g d'>2.~ |
                f4 e2 d4~ |
                d bes4 a2 |
        }
}
>>
}
}

lh = { \new Staff = "lh" {
        << \new Voice { \voiceOne
          \relative c {
                \key f \major
                \clef bass
                \once \override Staff.VerticalAxisGroup #'Y-offset = #10        
        
                \partial 4 d4\rest |
                f,4\sustainOn <c' a'>2.~ |
                <c a'>4 d'2 c8( bes |
                a4) bes8( a g4) f8( g |
                a4 g2.) |
                s4 <c, a'>2.~ |
                <c a' f,>4 e'2. |
                <d a>4. \stemDown <c~ f,>8 <c g>4. \once \override Slur 
#'padding = #0 \once \override Slur #'positions = #'(5 . 5.5) <c a>8( \stemUp |
                \once \override Beam #'positions = #'(6.5 . 6.25) b![ g' a, b)] 
s2 |
                s4 <c, a'>2. |
                r8 g' fis a \stemDown d2~ \stemUp |
                d4. s8 s2 |
                bes8[ d g, a~] a[ g g, a] |
                s1 |
                s4 cis'8 e \stemDown \once \override NoteColumn #'force-hshift 
= #-1 \once \override Stem #'length = #1.5 a2~ \stemUp |
                a4. \change Staff = "rh" \stemDown bes8_( a[ d) f,_( g] |
                f[ a \change Staff = "lh" \stemUp d,) <cis e>] d4 s4 |
                f,,4 <c' a'>2.~ |
                <c a'>4 d'2 c8( bes |
                a4) bes8( a g4) f8( g |
                a4 g2.) |
                s4 <c, a'>2.~ |
                <c a' f,>4 s2. |
                <a' c>4 << {c2} \new Voice { \voiceThree bes8( a g4) } >> s4 |
                s4 <c, g'>4~ <f, c'>2 |
                
                
                
          }
        }
        \new Voice { \voiceTwo
          \relative c {
                \partial 4 s4 |
                f,1~ |
                f4 \grace { \stemUp \once \override Beam #'positions = #'(2.5 . 
3) bes16[ \once \override NoteSpacing #'X-extent = #'(0 . 1.75) f'~] \stemDown 
} f2. |
                c4 c2
                \once \override Slur #'outside-staff-priority = #2
                \once \override Slur #'positions = #'(-5 . -6)
                \once \override DynamicLineSpanner #'outside-staff-priority = #1
                \once \override Hairpin #'height = #0.5
                \once \override Hairpin #'rotation = #'(10 0 0)
                \once \override Hairpin #'X-offset = #2
                \once \override Hairpin #'Y-extent = #'(0 . 0)
                \once \override Hairpin #'padding = #0
                a8(\< c |
                f4)\! c8( d c[ bes g a] |
                << { \stemUp f4) \stemDown s2. | s4 } \new Voice { \voiceFour 
f1_~ | \once \override Stem #'stencil = ##f \once \override NoteHead #'stencil 
= #point-stencil f4 } >>
                \grace { \stemUp \once \override Beam #'positions = #'(3.2 . 4) 
cis'16[ \once \override NoteSpacing #'X-extent = #'(0 . 1.5) a'~] \stemDown } 
a2.~ |
                << { \once \override Stem #'stencil = ##f \once \override 
NoteHead #'stencil = #point-stencil a4.  } \new Voice { \voiceFour d,4. } >>
                s8  s4. s8 |
                g2 <c c,>8[( d, bes g] |
                <<  { \stemUp f4) \stemDown s2. } \new Voice { \voiceTwo f1 } >>
                r8 c' d2~ d8 fis |
                g4. <c, fis>8 <d g>4. ees8 |
                d4. d8~( d[ g g, a] |
                \stemUp bes,4) \stemDown <f'' d'>2. |
                d8\rest <g d'>8 a2~ a8 cis |
                d4. <g, cis>8 <a d>4. bes8 |
                a2~ a8 bes~ <bes c> c, |
                f,1~ |
                f4 \grace { \stemUp \once \override Beam #'positions = #'(2.5 . 
3) bes16[ \once \override NoteSpacing #'X-extent = #'(0 . 1.75) f'~] \stemDown 
} f2. |
                c4 c2 a8(\< c |
                f4)\! c8( d c bes g a |
                << { \stemUp f4) s2. \stemDown | s4 } \new Voice { \voiceTwo 
f1~ | \once \override Stem #'stencil = ##f \once \override NoteHead #'stencil = 
#point-stencil f4 } >>
                <g b b'>2. \stemDown |
                c4 c2 <bes g'>8 <d a'> |
                <g bes>4 c,8\p c,
                
                
          }
        }
        >>
        }
}

\score { \new PianoStaff {
        <<
        \rh
        \lh
        >>
        }
}


      




reply via email to

[Prev in Thread] Current Thread [Next in Thread]