lilypond-user
[Top][All Lists]
Advanced

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

Re: slur and system breaks - take 2


From: Neil Puttock
Subject: Re: slur and system breaks - take 2
Date: Fri, 31 Aug 2007 23:34:04 +0100

Hi Oded,

On 8/29/07, Oded Ben-Tal <address@hidden> wrote:

any way of correcting these things by tweaking?

As far as I know, there's no simple way of correcting these; in a similar situation to yours I've used the following overrides,  which unfortunately involve a degree of trial and error:

For the first half of the slur, the easiest tweak is to change Slur #'positions. It's a bit limited in scope, since LilyPond only treats it as a suggestion for the start and end points of a slur: if the points are considered too outlandish, it has no effect.

\once \override Slur #'positions = #'(6 . 8.4)

The second half of the slur is a bit more difficult to tweak, since you don't want an override to influence both elements of the slur. The solution I've found useful is adapted from section 9.3.8, "Difficult tweaks". This uses a scheme function to check whether a spanner object (slur or tie, etc. ) has been broken in two across a break, then sets a property only on the second element (i.e. the part of the slur after the break):

#(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)))))) %The override

By setting the slur property #'control-points, you can set the slur shape manually (a third-order Bézier curve).

The scheme function is called using the property #'after-line-breaking as follows:

\once \override Slur #'after-line-breaking = #my-callback

Here's your code with the overrides included:

\version "2.11.30"
    
     #(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))))))

upper =  \relative c''
   { \clef treble \time 6/4 r1.
    a8([ g e' e, d c] g'[ \change Staff = down \stemUp g, f e])
    \once \override Slur #'positions = #'(6 . 8.4) %This is a bit short of the upper stave, could use #'control-points instead
    \once \override Slur #'after-line-breaking = #my-callback <gis d'>4^( ~
\break
    <gis d'>8[ c \change Staff = up \stemDown a' a,] \stemUp f'4) ~ f8([ e
bes' bes, f' e]) r1. r1. r1. }

lower =  \relative c, { \clef bass r1.
    c,8([ c' g' bes e g] bes) r \stemDown bes,,_([ bes' e, e'])
    f,,_([ f' c' f]) \stemUp a,,( a') g,([ g' e' g]) bes,,( bes') r1. r1. r1.
}

\score {
    \new PianoStaff <<
    \new Staff = "up" \upper
    \new Staff = "down" \lower
    >>
    \layout {
        \context { \Staff
            \override VerticalAxisGroup #'minimum-Y-extent = #'(-6 . 6) %Make both staves same height under 2.11
        }
    }
}

The bad news is that the scheme override only works under 2.11 for the property control-points. From your pictures, it looks as if you're using 2.10 ( the fixed distance between staves is a giveaway).

Regards,
Neil

Attachment: brahms.PNG
Description: PNG image


reply via email to

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