lilypond-user
[Top][All Lists]
Advanced

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

Implementing reliable cross-staff stems


From: Pavel Roskin
Subject: Implementing reliable cross-staff stems
Date: Fri, 30 Dec 2011 17:47:49 -0500

Hello!

I'm trying to implement cross-staff stems that would not get
disconnected when the distance between staves changes.

Ideally, I need a function that would extend the stem from the note in
the lower staff exactly until it meets the stem of the note on the
staff above.

As a simpler solution, I want the stem length to be as long as
the distance between staves plus or minus a constant.

Since I need both the context and the particular note, I decided to go
with the \applyOutput approach and filter out non-stems.

That's where I got so far:

#(define (longerstem grob grob-origin context)
   (if (memq 'stem-interface (ly:grob-interfaces grob))
       (set! (ly:grob-property grob 'length)
             (cdr (assoc 'Y-extent (ly:context-grob-definition context
                     'VerticalAlignment))))))

<< \applyOutput #'Voice #longerstem c4 >>

I get this in the output:

programming error: no pure Y common refpoint

Does anyone have an idea how to deal with it?

-- 
Regards,
Pavel Roskin



reply via email to

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