lilypond-user
[Top][All Lists]
Advanced

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

Re: accidental spacing (multiple signs): X-extent and ly:accidental-inte


From: Carl Sorensen
Subject: Re: accidental spacing (multiple signs): X-extent and ly:accidental-interface::width
Date: Wed, 9 Sep 2009 09:01:37 -0600



On 9/8/09 3:21 PM, "Torsten Anders" <address@hidden> wrote:

> Hello Lilyponders,
> 
> I am still looking for a way to avoid collisions of accidentals
> consisting of multiple signs. I searched various sources including the
> Internals Reference and finally came across the accidental slot/
> property X-extent (the extent of accidentals in the X direction).
> 
>    
> http://lilypond.org/doc/v2.12/Documentation/user/lilypond-internals/Accidental
> 
> Firstly, I would like to know whether changing this slot/property is
> actually a good idea for avoiding collisions of accidentals.
> 
> Anyway, the documentation says it is hard coded, but I could actually
> change it: it indeed allows for an increased accidental spacing
> between accidentals and graphical objects such as bar lines.
> 
> I attached two examples that only differ in one line. In
> closeSpacing.ly X-extent is explicitly set to its default, and there
> is much collision of accidentals and other graphical objects.
> 
>      \override Accidental #'X-extent = #ly:accidental-interface::width
> 
> By contrast, widerSpacing.ly sets X-extent to the following value
> resulting in a much better though still not good result (instead of
> globally changing this value it should later be set for individual
> accidentals).
> 
>      \override Accidental #'X-extent = #'(0.5 . 3.0)
> 
> The improvement is that accidentals do not overlap each other in the
> chord anymore, and the space between the bar line and the chord is
> increased to give way for the accidentals (something that a simple
> horizontal shift of the accidental would not do). However, accidentals
> still overlap with the preceeding note.
> 
> I tried to understand X-extent and ly:accidental-interface::width, but
> I could not find any further documentation. I even tried searching the
> source, using the nice grep interface of gitweb. However, I had no
> success.
> 
>    
> http://git.savannah.gnu.org/gitweb/?p=lilypond.git=search=HEAD=grep=accidental
> -interface 
> <http://git.savannah.gnu.org/gitweb/?p=lilypond.git&a=search&h=HEAD&st=grep&s=
> accidental-interface>
> 
> So, I have a few questions.
> 
>    - What exactly does this pair of numbers mean? Why are there two
> values to specify the width of a graphical object?


The pair of numbers is an interval that is used as the extent of the grob.
The first number is the coordinate of the "lowest" part of the extent (left
for X, down for Y), and the second number is the coordinate of the highest
part of the extent (right for X, up for Y).

The coordinates are in units of staff-space.

There are some interval functions in scm/lily-library.scm that give some
idea of what an interval is.


>    - What is the definition of ly:accidental-interface::width?

see lily/accidental.cc.  I think you can't grep for
ly:accidental-interface::width and find it because the name
ly:accidental-interface::width isn't actually in the source; it's created by
the macro MAKE_SCHEME_CALLBACK(Accidental_interface, width, 1)

Basically, ly:accidental-interface::width just gets the X extent of the
accidental, IIUC.

HTH,

Carl







reply via email to

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