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: Jan Rosseel
Subject: Re: How to get Staff context-id from a grob?
Date: Mon, 14 Oct 2013 17:20:30 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

David Kastrup <dak <at> gnu.org> writes:

> 
> "Jan Rosseel" <jan <at> rosseel.com> 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.

I was a bit afraid of this answer. And it's indeed logical if we look at
Urs'question as well(what happens if the music expression is used in
multiple staffs?) It just didn't hit me because I don't use my music
expressions in multiple contexts. I was being a bit entrenched in my way of
working and didn't see the *real* bigger picture anymore, only my bigger
picture.

> > 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?

I'm trying to achieve exactly what I'm writing. In SCORA, the viewer app
only knows about grobs, but it should somehow be able to figure out in what
context (read: voice, or set of partcombine'd voices, or otherwise put: a
staff) the grob was used. That would allow me to send an annotation one
wants to make on the grob to the right voice. 
To spell it out: the conductor makes an annotation on a certain note on his
score, and I need to be able to route it to, for example, the bassoon's
personalized score. I have other ways to figure it out, but was hoping there
would be a more direct way. 






reply via email to

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