lilypond-devel
[Top][All Lists]
Advanced

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

Re: Determining location of the staff lines


From: Carl Sorensen
Subject: Re: Determining location of the staff lines
Date: Wed, 3 Feb 2010 21:19:38 -0700

On 2/3/10 8:38 PM, "Carl Sorensen" <address@hidden> wrote:
> On 2/3/10 8:32 PM, "Eric Knapp" <address@hidden> wrote:
> 
>> Hi, everyone.
>> 
>> I'm working on developing StaffTab notation for the Chapman Stick. I
>> have attached an image that shows something I need to do. In a Scheme
>> engraver, I can get the string number that was notated. Then I need to
>> be able to draw the little rectangle on the staff to indicate which
>> string the composer suggests for this note. How do I know where the
>> location of the staff lines are so I can draw that rectangle?
> 
> You don't know the location of the staff lines, and you don't worry about
> the location of the staff lines.  You just need to set the staff-position
> property of the grob, and the layout engine takes care of it like magic.
> 
> See lily/tab-note-heads-engraver.cc for an example, where the tab-note-head
> is placed according to its string number.

Just a little more detail on this.  Stencils are always placed in relative
mode, i.e. they are placed relative to other stencils.  They have an
X-parent and a Y-parent.  So it's only necessary to know how to position a
grob relative to its parent.  Hence, you don't need to know where the staff
lines are; you just need to know where the string indicator needs to be
relative to its parent (which is probably the center staff line).

HTH,

Carl






reply via email to

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