lilypond-user
[Top][All Lists]
Advanced

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

Re: How to get Staff context-id from a grob?


From: David Kastrup
Subject: Re: How to get Staff context-id from a grob?
Date: Fri, 11 Oct 2013 10:47:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

"Jan Rosseel" <address@hidden> writes:

> Hello, 
>
>  
>
> I have a problem that I've been trying to crack, but I'm failing. 
>
>  
>
> In my backend, I am processing grobs, and I would need to get the
> context-id of the StaffSymbol that a certain grob belongs to.

Grobs don't belong to contexts.  They are created by an engraver with
ly:engraver-make-grob, and the engraver passed to engraver-make-grob
determines just which acknowledgers get to see this grob based on the
engraver's context.

But while the engraver/context where the grob is created determine where
it is announced, the grob itself is not particularly related to the
context.

> Here's the bigger picture:
>
>  
>
>  
>
> \new Staff = foobar {  
>
> ... << some music>>>
>
> }
>
>  
>
> For all grobs that orginate from notes in "some music" I need to be able
> to get to the "foobar" string. 
>
>  
>
> Is this possible from scheme code? 

You can place an engraver in the Staff or even some subordinated Voice
that will then acknowledge the grob and look for "foobar".  But it is
somewhat pointless since the engraver's action does not actually depend
on the grob at all.  Its relation to foobar is established when the
engraver is instantiated in a particular context.

So it probably boils down to the good old question: what are you
_really_ trying to achieve here?

-- 
David Kastrup




reply via email to

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