lilypond-user
[Top][All Lists]
Advanced

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

Re: Access Score.NoteColumn from a given note column


From: Urs Liska
Subject: Re: Access Score.NoteColumn from a given note column
Date: Tue, 4 Apr 2017 13:49:06 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Hi David,


Am 03.04.2017 um 15:04 schrieb David Nalesnik:
> On Mon, Apr 3, 2017 at 6:59 AM, Urs Liska <address@hidden> wrote:
>>
>> Am 03.04.2017 um 13:57 schrieb Urs Liska:
>>> Is there a way to either affect the Grob in the Score context (probably
>>> not) or to retrieve a list/array of all NoteColumns that happen at the
>>> same time in other contexts?
> The associated paper column will contain grobs from other contexts:
>
> \new PianoStaff <<
>   \new Staff
>   \relative {
>     \override Score.NoteHead.before-line-breaking =
>     #(lambda (nh)
>        (let*
>         ((col (ly:item-get-column nh))
>          (elts (ly:grob-array->list (ly:grob-object col 'elements)))
>          (ncs (filter (lambda (elt) (grob::has-interface elt
> 'note-column-interface)) elts))
>          (nc (ly:grob-parent nh Y))
>          (id (ly:grob-property nh 'id))
>          (mod (assoc-ref mods id)))
>         (if mod
>             (for-each (lambda (n)
>                         (ly:grob-set-property! n 'X-offset mod))
>               ncs))
>         ))
>     c'1 ~ \tweak #'id "one" c2 e
>   }
>   \new Staff
>   \relative {
>     R1
>     c'2 c
>   }
> HTH,
> David

Thanks, this is exactly what I needed. I'm slowly getting my head around
navigating this information (as is extensively documented in the list
archives ;-) ), but obviously I stopped short of trying out *this*
combination.

Urs

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




reply via email to

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