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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to