lilypond-user
[Top][All Lists]
Advanced

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

How to shape the second tie after tieWaitForNote = ##t?


From: Knute Snortum
Subject: How to shape the second tie after tieWaitForNote = ##t?
Date: Sat, 28 Sep 2024 14:33:40 -0700

I am trying to change the shape of two ties after tieWaitForNote is set to true.  If I use the \shape command, the second tie is not affected.  Here is an MWE:

%%%
\version "2.24.4"

tieShapeA = \shape #'((0 . -1) (0 . 0) (0 . 0) (0 . 0)) \etc
tieShapeB = \shape #'((0 . 1) (0 . 0) (0 . 0) (0 . 0)) \etc

\relative {
  c'4 \set tieWaitForNote = ##t e-\tieShapeA ~ g-\tieShapeB ~ <e g> |
}
%%%

I searched old messages in this group and I found this:

https://www.mail-archive.com/lilypond-user@gnu.org/msg124329.html

It seems to be describing the same behavior.  The posted solution is some scheme code.  When I use this code in an MWE (only converting it to 2.24) it strangely doesn't work right after a line break.  Here is the MWE:

%%%
\version "2.24.4"
\language "english"

\paper {
  ragged-right = ##t
}

affect-TieColumn =
#(define-music-function (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 '()))))
#})

\relative {
  c'1 | \break % remove this break and the affect-TieColumn works
  c4 \set tieWaitForNote = ##t e~ g~
  \affect-TieColumn #'(
                        ((0 . 0) (0 . -1) (0 . -1) (0 . 0)) ;; bottom
                        ((0 . 0) (0 . 0) (0 . 0) (0 . -1))  ;; top
                      )
  <e g> |
}
%%%

So my question is, how do I change the shape of the second tie after a tieWaitForNote = ##t?

--
Knute Snortum


reply via email to

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