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: Urs Liska
Subject: Re: Find objects within a spanner
Date: Tue, 7 Feb 2017 14:58:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

Hi David,

thank you for the hints and explanations.


Am 07.02.2017 um 14:34 schrieb David Nalesnik:
> 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.  PaperColumn
> and NonMusicalPaperColumn will store references to many grobs (through
> the 'elements property from the axis-group-interface)
>
> --
>
> Or, you could get all elements on a line (through the 'all-elements
> property of the System grob) and filter by location.  This seems a bit
> inefficient to me.
>
> Sorry, no time right now for a working code snippet, but I hope this is 
> helpful.

Of course I'll have to look into it, but it seems like sufficient to
find something. Please don't bother coming up with some code - I'd like
to find out on my own ;-)

Just one question: Will the 'note-columns property give me access to
*all* elements in the staff or only to the ones in the current voice
context? Of course if I need some sort of skyline it has to look at all
elements. If the answer is "no" that would be a striking argument for
iterating over the whole system.

Am 07.02.2017 um 14:40 schrieb David Nalesnik:
> It strikes me that this could be a good subject to attack a user
> documentation for LilyPond internals.  Certainly as a Scores of Beauty
> tutorial.  It was one of the first things I wanted to know.

Actually I already have the intention to do this, once I'm through with
the challenge.

Best
Urs

>
> Best,
> David

-- 
address@hidden
https://openlilylib.org
http://lilypondblog.org




reply via email to

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