lilypond-devel
[Top][All Lists]
Advanced

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

Re: Obtaining the current staff's context id from withing a voice?


From: Neil Puttock
Subject: Re: Obtaining the current staff's context id from withing a voice?
Date: Wed, 7 Jul 2010 20:40:05 +0100

On 7 July 2010 13:19, Reinhold Kainhofer <address@hidden> wrote:

> So, how can I force the new lyrics context to be placed above the current
> staff (for which I don't know the context id)? Alternatively, is there a way
> to obtain the staff's context id from within a voice?

The only way I can think of doing this is to get the parent context
via associatedVoiceContext.  But you'd also need to be able to set the
context id directly, since staves usually have no name unless you know
you're going to use align(Above|Below)Context or \change.

\applyContext
#(lambda (ctx)
   (ly:context-set-property! ctx 'alignAboveContext
    (ly:context-id
     (ly:context-parent
      (ly:context-property ctx 'associatedVoiceContext)))))

Cheers,
Neil



reply via email to

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