lilypond-user
[Top][All Lists]
Advanced

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

Re: Moving a slur down


From: Nick Payne
Subject: Re: Moving a slur down
Date: Wed, 07 Jan 2015 15:23:29 +1100
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 07/01/2015 04:00, Knute Snortum wrote:
Dear LilyPonders:

I am having trouble trying to move a slur down so that it doesn't collide with a note head from another voice.  See below:

%%% Start
\version "2.18.2"
\language "english"

global = {
  \key c \minor
  \time 2/4
}

\score {
  \new PianoStaff <<
    \new Staff {
      \global
      \relative c'' {
        << 
          { <c c,>2 | } 
          \\
          { \once \override Slur.Y-offset = #-2 g4 ( ef) | } 
        >>
      }
    }
    \new Staff {
      \global
      \clef bass
      \relative c {
        <<
          { c2 | } 
          \\
          { g4( ef) | }
        >>
      }
    }
  >>
}
%%% End

I use this function (can't remember where I found it):

%%% Start
\version "2.18.2"
\language "english"

\offsetSlurPos =
#(define-music-function (parser location offsets) (pair?)
   #{
     \once \override Slur.positions = #(lambda (grob)
                                         `(,(+ (car offsets) (cdar (ly:slur::calc-control-points grob))) .
                                            ,(+ (cdr offsets) (cdr (cadddr (ly:slur::calc-control-points grob))))))
   #})

global = {
  \key c \minor
  \time 2/4
}

\score {
  \new PianoStaff <<
    \new Staff {
      \global
      \relative c'' {
        <<
          { <c c,>2 | }
          \\
          { \offsetSlurPos #'(-2 . -2) g4 ( ef) | }
        >>
      }
    }
    \new Staff {
      \global
      \clef bass
      \relative c {
        <<
          { c2 | }
          \\
          { g4( ef) | }
        >>
      }
    }
  >>
}
%%% End

reply via email to

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