[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Find ties enclosed in slur (while overriding stencil)
From: |
Thomas Morley |
Subject: |
Re: Find ties enclosed in slur (while overriding stencil) |
Date: |
Tue, 14 Mar 2017 12:27:08 +0100 |
2017-03-14 11:52 GMT+01:00 Urs Liska <address@hidden>:
> Hi,
>
> I'm trying to determine if a slur includes ties in order to do some
> layout calculations.
>
> I'm overriding a stencil and have retrieved the slur's 'note-columns.
> Now I want to know if any of these note-columns (or enclosed note heads
> has a tie attached to it.
>
> I see that NoteColumn has a note-heads property. However, accessing
> these note heads and then asking for their ly:grob-object NAME 'ties
> returns empty lists only.
>
> So what is the proper way to assess all the note columns within a slur
> and retrieve any included ties?
> The information I actually need is the note head's staff position and
> the tie's direction.
>
> Any suggestions?
> Urs
Hi Urs,
not an elaborated code, maybe a starting-point, though.
{
\override Slur.stencil =
#(lambda (grob)
(let* ((ncs (ly:grob-object grob 'note-columns))
(nhs
(append-map
(lambda (nc)
(ly:grob-array->list (ly:grob-object nc 'note-heads)))
(ly:grob-array->list ncs))))
(pretty-print
(map
(lambda (nh)
(map
(lambda (ev)
(ly:prob-property ev 'name))
(ly:prob-property
(ly:prob-property
(ly:grob-property nh 'cause)
'music-cause)
'articulations)))
nhs))
(ly:slur::print grob)))
c'1(~
c'
d'~
d'
e'
f'
g')
a'
}
Cheers,
Harm