lilypond-devel
[Top][All Lists]
Advanced

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

Re: change clef inside a grob-callback?


From: Joe Neeman
Subject: Re: change clef inside a grob-callback?
Date: Thu, 16 Jul 2009 22:39:03 -0700

On Thu, 2009-07-16 at 19:10 -0700, Mark Polesky wrote:
> Is there a way to change the clef from within a grob callback?

Not really. You can change the clef's glyph, but you can't really change
the clef's influence on the following notes. Reason being, the NoteHead
grobs are created around the same time as the Clef grob and their
positions are fixed at that time, so unless you want to somehow iterate
over and modify all the NoteHeads, it isn't really going to work.

> I'm trying to create an auto-clef-change function that will find the
> average staff-position within a chord and change the clef if needed. But
> I'm a little stuck. I found a way to calculate each chord's average
> staff-position, but it's within a grob-callback. And I can't figure out
> how to change the clef from there, or if it's even possible. So for the
> moment, I'm having the function display the would-be clef decisions in
> the console.
> 
> Maybe an entirely different approach is needed -- I don't know.
> Can anyone look this over and point me in a helpful direction?

I'd suggest a music function rather than a grob override.

Joe





reply via email to

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