lilypond-user
[Top][All Lists]
Advanced

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

Re: Shape of individual ties in chords


From: Thomas Morley
Subject: Re: Shape of individual ties in chords
Date: Wed, 22 Jan 2014 23:55:19 +0100

2014/1/17 David Kastrup <address@hidden>:
> Richard Shann <address@hidden> writes:
>
>> Reading over the documentation on changing the tie shape for ties in
>> chords I gather that it is not possible to do this at all:
>>
>> http://www.lilypond.org/doc/v2.18/Documentation/notation/modifying-shapes#modifying-ties-and-slurs
>
>> It is not possible to modify shapes of ties or slurs by changing the
>> control-points property if there are multiple ties or slurs at the
>> same musical moment – the \tweak command will also not work in this
>> case.  However, the tie-configuration property of TieColumn can be
>> overridden to set start line and direction as required.
>>
>> I think the documents should be more up front about that. Saying it is
>> not possible to do it one way, or another way, and then going on to
>> describe something else that *is* possible is a bit of weasel-wording.
>> Unless, that is, there is actually some LilyPond syntax to do this.
>
> Redirected to developer list.
>
> This is one case where I think it would make more sense to relinquish
> the restrictions rather than document them.  It seems like this would
> require transferring properties and/or tweaks from tie events to the
> tie-configuration of TieColumn.  There probably is already some issue in
> the bug tracker for this.
>
> Backend guys, any ideas?
>
> --
> David Kastrup



Hi,

sorry for the late reply, I was completely off for some time.

Below some coding just to show that it can be done.
It's a very first sketch, several issues are present (p.e. linebreak)
Might be a starting point, though.

\version "2.18.0"

affect-TieColumn =
#(define-music-function (parser location offsets)(list?)
#{
  \once
    \override TieColumn #'after-line-breaking =
      #(lambda (grob)
        (let* ((ties (ly:grob-array->list (ly:grob-object grob 'ties)))
               (c-ps
                 (map
                   (lambda (tie) (ly:grob-property tie 'control-points))
                   ties)))

      (define (offset-control-points coords offsets)
       (if (null? offsets)
           (car c-ps)
           (map
             (lambda (x y) (coord-translate x y))
             coords offsets)))

       (define (help offs pts new-pts)
         (if (null? offs)
             (reverse new-pts)
             (help (cdr offs) (cdr pts)
               (cons (offset-control-points (car pts) (car offs)) new-pts))))

      (for-each
         (lambda (tie cpts) (ly:grob-set-property! tie 'control-points cpts))
         ties
         (help offsets c-ps '()))))
#})

%% crazy values taken, to show it works
{
  <fis' cis'' a''>2 ~
  \affect-TieColumn #'( ((0 . -4)  (2 . 3) (4 . 5) (6 . 7));; bottom
                        ((-1 . 0) (0 . 0) (0 . 0) (0 . 0)) ;; middle
                        ((-5 . 3) (0 . 0) (0 . 0) (0 . 0)) ;; top
                                          )
  q
}


Cheers,
  Harm



reply via email to

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