lilypond-user
[Top][All Lists]
Advanced

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

Re: Tie collision with note


From: Stan Sanderson
Subject: Re: Tie collision with note
Date: Sun, 20 Mar 2011 16:46:25 -0500

Indeed, a much cleaner and more elegant approach.
Regards,
Stan

On Mar 20, 2011, at 2:05 PM, Nicholas Moe wrote:

Thanks, Stan, for all your help on this. I checked out LilyPondTool
and JEdit and was able to see how to get control points from the slur
tweak tool. But as I was trying to figure out how to use the slur
tweak tool, I came across another tweak that works even better. I
adapted \shapeSlur from the Lilypond Snippet Repository
(http://lsr.dsi.unimi.it/LSR/Item?id=63) and turned it into \shapeTie.
(Thanks, LSR!) With this I can specify offsets for each control point
of the tie. This way, the tweak scales with the layout of the music.

Here's the example with the addition of this tweak:

%-----------------------------------------------------
\version "2.13.54"

shapeTie =
 #(define-music-function (parser location offsets) (list?)
   #{
      \once \override Tie #'control-points = #(alter-curve $offsets)
   #})

#(define ((alter-curve offsets) grob)
  ;; get default control-points
  (let ((coords (ly:tie::calc-control-points grob))
        (n 0))
    ;; add offsets to default coordinates
    (define loop (lambda (n)
                   (set-car! (list-ref coords n)
                             (+ (list-ref offsets (* 2 n))
                                (car (list-ref coords n))))
                   (set-cdr! (list-ref coords n)
                             (+ (list-ref offsets (1+ (* 2 n)))
                                (cdr (list-ref coords n))))
                   (if (< n 3)
                       (loop (1+ n)))))
    ;; return altered coordinates
    (loop n)
    coords))


\relative c' {
\clef "bass"
\voiceOne
<<
                { d1~ d2 c }
                \new Voice {
                        \voiceThree
                        \shiftOff
                        \shapeTie #'(1 -.25 1 -.25 -1.375 -.25 -1.375 -.25)
                        a1~
                        \shiftOn
                        a2 g
                }
                \new Voice {
                        \voiceTwo
                        d2\( f
                        e2 e\)
                }

}

%-------------------------------------------------

Best,

Nick

On Sun, Mar 20, 2011 at 11:30 AM, Stan Sanderson
<address@hidden> wrote:

On Mar 20, 2011, at 1:21 AM, Nicholas Moe wrote:

That makes the tie how I want it, but I need to shift the middle notes
to the right in the second measure to show that they are their own
voice, whilst keeping the stems up. How could I do that?

Nick


I understand. How about this (thanks, JEdit and LilyPondTool!)

\version "2.13.54"

\relative c' {
\clef "bass"
\voiceOne
       <<
               { d1~ d2 c }
               \new Voice {
                       \voiceThree
                       \shiftOff
\once \override Tie #'control-points = #'( ( 2.2771
. 2.348) ( 3.8427 . 3.344) ( 7.3296 . 3.486) ( 10.176 . 2.348) )
                       a1~
                       \shiftOn
                       a2 g
               }
               \new Voice {
                       \voiceTwo
                       d2\( f
                       e2 e\)
               }
       >>
       }

Stan




_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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