|
From: | Peter Crighton |
Subject: | \shapeTieColumn does not work after line break |
Date: | Sat, 18 Apr 2015 16:22:09 +0200 |
See the exchange below between myself and David. Hoping for an elegant solution to this problem.---------- Forwarded message ----------
From: David Nalesnik <address@hidden>
Date: Thu, Oct 16, 2014 at 11:18 AM
Subject: Re: shapeTieColumn
To: Neil Thornock <address@hidden>Hi Neil,Honestly, I'm at a loss here. You might want to forward this to the lists to see if someone else has an idea.On Thu, Oct 16, 2014 at 11:05 AM, Neil Thornock <address@hidden> wrote:Any ideas?I'm using your shapeTieColumn function. After a line break, the function works only if it is not the top staff of a system. So this breaks:Hi David,Not sure this is worth an email to the Lily list...
{ s1 \break <c' d' e'>8.~ \shapeTieColumn #'((()) (()) (((0 . -4) (0 . 1) (0 . 0) (0 . 0))) (()) (())) <c' d' e'> }I've been poking around with this, and I really have no idea. It _should_ work.I added two print lines to the function to check if the offsets are happening. They are. Run the following on your snippet:%%%%%%%% function for offsetting control-points of a TieColumn %%%%%%%%%%%%%%%%%shapeTieColumn =#(define-music-function (parser location all-offsets) (list?)#{\once \override TieColumn #'after-line-breaking =#(lambda (grob)(let ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))) ;(display ties) (newline)(for-each(lambda (tie offsets-for-broken-pair)(let* ((orig (ly:grob-original tie))(siblings (ly:spanner-broken-into orig)))(format #t "before: ~a~%" (ly:grob-property orig 'control-points))(for-each(lambda (piece offsets-for-piece)(if (pair? offsets-for-piece)(set! (ly:grob-property piece 'control-points)(map(lambda (x y) (coord-translate x y))(ly:tie::calc-control-points piece)offsets-for-piece))))(if (null? siblings)(list orig)siblings)offsets-for-broken-pair)(format #t "after: ~a~%" (ly:grob-property orig 'control-points))))ties all-offsets)))#})%%%%%%%%%%%%%The problem also happens when the \break isn't manual. Try:{\repeat unfold 8 { R1 }<c' d' e'>8.~\shapeTieColumn #'( (()) (()) ( ((0 . 4) (0 . 1) (0 . 0) (0 . 0))))<c' d' e'> r8 r2 \repeat unfold 8 { R1 }}%%%%%%%%%%%%%%%%My only guess is that the tweaking is happening at the wrong time--too late? Even though 'control-points is showing a change, the item has already been finished?Best,David
[Prev in Thread] | Current Thread | [Next in Thread] |