Hi,

> 2015-04-16 3:36 GMT+02:00 Trevor Bača <trevorb...@gmail.com>:
>
>> Hi,
>>
>> Using the \shape command to length repeat ties works great between notes.
>> But weird behavior seems to arise with lengthened repeat ties between
>> chords:
>>
>>
>> ### BEGIN ###
>>
>> \version "2.19.17"
>> \language "english"
>>
>>
>> \new Staff \with {
>>     \shape #'((-2 . 0) (-1 . 0) (-0.5 . 0) (0 . 0)) RepeatTie
>>
>>     \override RepeatTie.X-extent = ##f
>> } {
>>     <c' g'>1
>>     <c' g'>1 \repeatTie
>>     <c' g'>1 \repeatTie
>>     <c' g'>1 \repeatTie
>> }
>>
>> ### END ###
>>
>>
>> (Image attached.)
>>
>> Would anyone have any clues as to how to make the repeat ties all have
>> the same length?
>>
>>
In order to use a shape-like command with repeat ties in a chord, we have
to get at the individual ties organized by the RepeatTieColumn.

Here's a variant of \shapeTieColumn (at
https://github.com/openlilylib/openlilylib/tree/master/notation-snippets/shaping-bezier-curves/shape-tie-column)
which achieves that.  Each tie within the chord is represented with its own
list of offsets.

%%%%
\version "2.19.17"
\language "english"


shapeRepeatTieColumn =
#(define-music-function (parser location all-offsets) (list?)
   #{
     \override RepeatTieColumn #'before-line-breaking =
     #(lambda (grob)
        (let ((ties (ly:grob-array->list (ly:grob-object grob 'ties))))
          (for-each
           (lambda (tie offsets-for-tie)
             (if (number-pair-list? offsets-for-tie)
                 (set! (ly:grob-property tie 'control-points)
                       (map
                        (lambda (x y) (coord-translate x y))
                        (ly:semi-tie::calc-control-points tie)
offsets-for-tie))))
           ties all-offsets)))
   #})

\new Staff \with {
  \shapeRepeatTieColumn #'(
                            ((-2 . 0) (-1 . 0) (-0.5 . 0) (0 . 0))
                            ((-2 . 0) (-1 . 0) (-0.5 . 0) (0 . 0))
                            )
  \override RepeatTie.X-extent = ##f
} {
  <c' g'>1
  <c' g'>1 \repeatTie
  <c' g'>1 \repeatTie
  <c' g'>1 \repeatTie
}

%%%%%

HTH,
David
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to