On Sat, Apr 18, 2015 at 9:22 AM, Peter Crighton <[email protected] > wrote:
> I am reviving this old message because I stumbled over the problem, too. > Does anyone know how to make \shapeTieColumn (from openLilyLib) work in > the top staff of a system after a line break? > > > 2014-10-17 16:23 GMT+02:00 Neil Thornock <[email protected]>: > >> See the exchange below between myself and David. Hoping for an elegant >> solution to this problem. >> >> ---------- Forwarded message ---------- >> From: David Nalesnik <[email protected]> >> Date: Thu, Oct 16, 2014 at 11:18 AM >> Subject: Re: shapeTieColumn >> To: Neil Thornock <[email protected]> >> >> >> Hi Neil, >> >> On Thu, Oct 16, 2014 at 11:05 AM, Neil Thornock <[email protected]> >> wrote: >> >>> Hi David, >>> Not sure this is worth an email to the Lily list... >>> >>> 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: >>> >>> { s1 \break <c' d' e'>8.~ \shapeTieColumn #'((()) (()) (((0 . -4) (0 . >>> 1) (0 . 0) (0 . 0))) (()) (())) <c' d' e'> } >>> >>> Any ideas? >>> >>> 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? >> >> Honestly, I'm at a loss here. You might want to forward this to the >> lists to see if someone else has an idea. >> >> Unfortunately, I still don't know how to fix this. The offsetted control-points are obviously not being used to create the typesetted object. Could ly:tie::calc-control-points be being called once more after this function calls it and resetting control-points? Could the shape of the tie have been already finalized? Can't say. Any ideas? --David
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
