lilypond-devel
[Top][All Lists]
Advanced

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

Re: Cross-staff stem engraver (was: New frog in an empty pond?)


From: Pavel Roskin
Subject: Re: Cross-staff stem engraver (was: New frog in an empty pond?)
Date: Tue, 28 Feb 2012 23:04:04 -0500
User-agent: Internet Messaging Program (IMP) H3 (4.1.4)

Quoting Joe Neeman <address@hidden>:

I'm getting a message "Weird stem", and I don't see how to avoid it.
Perhaps I should create a totally new grob with a unique name, such as
StemSpan.  Is that possible?  What would be needed?


It would be nice to do this eventually, because having a different grob
name would make it easier for the users to tweak it. I think it would
involve editing scm/define-grobs.scm, but there may be a way to do it from
an .ly file also

It turn out the message comes from ly:stem::offset-callback and can be suppressed by redefining X-offset.

Don't use ly:axis-group-interface::add-element, because stems don't
implement the axis-group-interface. (Removing this will also remove the
axes warning.) Instead, use ly:grob-set-parent!. You'll probably want to
set both the X parent and the Y parent. Then the X and Y offsets of
new-stem will be measured relative to stem (instead of relative to the
whole system, which is the default).

That was it! I have a working solution now! It will need to be improved to ignore rests and other invisible stems, check the cross-staff property, avoid connecting incompatible stems and so on. The old stems should be made transparent. But all that should be simple. Once I have something easy to use, I plan to submit it to the LSR.

Actually, it looks like System is a better Y-parent for the new stem. Perhaps I'll try to use the common reference of the stems to be connected.

Here's what I have now (attached).

Thank you for your help!

--
Regards,
Pavel Roskin

Attachment: stemspan.ly
Description: Text Data


reply via email to

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