lilypond-user
[Top][All Lists]
Advanced

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

Re: Find objects within a spanner


From: David Nalesnik
Subject: Re: Find objects within a spanner
Date: Tue, 7 Feb 2017 07:50:25 -0600

On Tue, Feb 7, 2017 at 7:34 AM, David Nalesnik <address@hidden> wrote:
> Hi Urs,
>
> On Mon, Feb 6, 2017 at 5:26 AM, Urs Liska <address@hidden> wrote:
>> Hi all,
>>
>> if I override a Tie/Slur's stencil I can easily (well, now, after your
>> help ...) get to the note columns at both ends.
>>
>> Is it possible to retrieve a list of all objects *between* those ends too?
>> Concretely I would like to know if there are ties within a slurred
>> phrase and to determine peak notes/stems in order to do some sort of
>> collision-handling-like layout decisions.
>>
>
> One way would be to follow pointers.  Most objects store references to
> other objects.  In the case of Slur, consulting Internal Properties at
> http://lilypond.org/doc/v2.19/Documentation/internals/slur_002dinterface
> shows that a grob array of note columns traversed is available through
> the 'note-columns property (which you would access through
> ly:grob-object). BTW, you'd probably want to use ly:grob-array->list
> to work with the array more conveniently..
>
> There are then pointers to other objects held by each NoteColumn grob.
>
> You can "go higher," too: use parentage (ly:grob-parent), or get the
> grob's associated paper column with ly:item::get-column.

Use ly:item::get-column on the spanner's bounds (ly:spanner-bound) or
on any *Item*, for example, one of the spanned NoteColumns.



reply via email to

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