lilypond-user
[Top][All Lists]
Advanced

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

Re: Access a tie from a slur


From: David Nalesnik
Subject: Re: Access a tie from a slur
Date: Mon, 2 Jan 2017 19:33:29 -0600

Hi Urs,

On Mon, Jan 2, 2017 at 6:33 PM, Urs Liska <address@hidden> wrote:
> Hi all,
>
> the message title may be misleading, but it names the only idea I have
> for my current issue.
>
> I am asked to create a strange slur configuration similar to the
> attached example. The coloring is only for better referencing in the
> email, and please don't question the notational use of the challenge -
> it's asked for and I have to provide a solution (well, actually, right
> now I'm only investigating if there *is* a proper solution I can offer).
>
> The task is to have the blue slur reliably point to the middle of the
> magenta tie. For the example I have simply used \shape with the slur to
> make it demonstrate the goal. But I am after a proper solution.
>
> My question is if it is somehow possible to access the control points of
> the magenta tie while still being able to set the control points of the
> blue slur. I would imagine to have the slur end at the magenta f', then
> have some function implicitly create the tie there and use the tie's
> control points to set the slur's control points. (In this constellation
> the tie wouldn't actually be entered explicitly.)
>
> Does this sound plausible from the perspective of when which properties
> can be retrieved and when changed?
>

Not much time to work on this, but I can get you to the Tie's
control-points from the Slur.

This is a bit inefficient since it filters all the grobs in the line
to get at the Tie, since there's no pointer that I know of which could
connect the Slur and Tie.

It's also tailored to the use-case you give.

Anyway...

%%%%%

\version "2.19.53"

#(define slur-touches-tie
   (lambda (grob)
     (let* ((rb (ly:spanner-bound grob RIGHT))
            (sys (ly:grob-system grob))
            (when (grob::when rb))
            (elts (ly:grob-array->list
                   (ly:grob-object sys 'all-elements)))
            (my-tie (filter (lambda (g)
                           (and (grob::has-interface g 'tie-interface)
                                (equal? (grob::when g) when)))
                         elts))
            (tie-cps (ly:tie::calc-control-points (car my-tie))))
       (display my-tie)
       (newline)
       (display tie-cps)
       (ly:slur::calc-control-points grob))))

{
  \override Slur.control-points = #slur-touches-tie
  c'4( d' e' f')~
  f'1
}



reply via email to

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