lilypond-user
[Top][All Lists]
Advanced

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

Re: Making accidentals consume no space ... and yet offset correctly


From: Trevor Bača
Subject: Re: Making accidentals consume no space ... and yet offset correctly
Date: Mon, 20 Aug 2007 10:21:45 -0500

On 8/20/07, Trevor Bača <address@hidden> wrote:
> Hi,
>
> Back in February I was trying to figure out how to "remove accidentals
> from the spacing problem"; ie, I wanted to prevent accidentals from
> consuming (horizontal) space ... and, yet, I also wanted accidentals
> to offset the correct amount away from their parent noteheads.
>
> I've made some more progress on this problem and I'm posting the
> results here. However, my current best solution relies on
> extra-offset, which is kinda ugly. I'm hoping that maybe somebody with
> better Scheme can take me the last step and provide a non-extra-offset
> way of getting what I want.
>
>
> %%% THREE SCORES %%%
>
>    \version "2.11.29"
>
>    \paper { ragged-right = ##t }
>    \layout { \context { \Score
>       proportionalNotationDuration = #(ly:make-moment 1 32) } }
>
>    \new Staff {
>       c''8
>       d''8
>       e''8
>       f''8
>    }
>
>    \new Staff {
>       \override Accidental #'X-extent = #'(0 . 0)
>       \override Staff.AccidentalPlacement #'right-padding = #-0.15
>       c''8
>       dis''8
>       eis''8
>       fis''8
>    }
>
>    \new Staff {
>       \override Accidental #'X-extent = #'(0 . 0)
>       \override Staff.AccidentalPlacement #'right-padding = #-0.15
>       \override Accidental #'extra-offset = #'(-1.5 . 0)
>       c''8
>       dis''8
>       eis''8
>       fis''8
>    }
>
> %%% END %%%
>
> Above are three different scores stacked on top of each other. The
> first score has no accidentals and serves as a type of reference
> spacing. The second score causes the accidentals to truly take up no
> space (which is good) but overprints the accidentals on top of
> noteheads (which is bad). The third score gives me exactly what I want
> ... but relies on extra-offset (which is kludgy).
>
> Question: is there a way to get the output of that last (third) score
> *without* falling back on extra-offset?
>
> (It seems like overriding Accidental #'X-offset should work ... but
> see a previous post that shows Accidental respecting *Y-offset* but,
> alas, not X-offset.)
>
> (It also feels like maybe passing in a *procedure* for the x-value of
> extra-offset should work ... maybe the procedure that determines
> accidental width ... but I haven't yet figured out how to do this.)


Whoa.

I just ran against .30 and the behavior that I'm looking for seems to
be natively implemented with need for *no* overrides whatsoever. This
is massively cool.

For example, look at the output of these two scores:

%%% TWO SCORES %%%

  \version "2.11.30"

  \paper { ragged-right = ##t }
  \layout { \context { \Score
     proportionalNotationDuration = #(ly:make-moment 1 32) } }

  \new Staff {
     c''8
     d''8
     e''8
     f''8
  }

  \new Staff {
     c''8
     dis''8
     eis''8
     fis''8
  }

%%% END %%%


Notice that the spacing is *exactly* the same -- accidentals consume
no extra space because they already have plenty of space.

Outstanding. Maybe this was a bug that crept into the proportional
spacing (or a feature that crept *out* of the proportional spacing)
package over the last couple of releases. But whatever the source,
this is very, very cool and is going to fix some very intricate
spacing details I've got going in my current score.


Trevor.


-- 
Trevor Bača
address@hidden

Attachment: happy-accidental-spacing.png
Description: PNG image


reply via email to

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