lilypond-user
[Top][All Lists]
Advanced

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

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


From: Trevor Bača
Subject: Making accidentals consume no space ... and yet offset correctly
Date: Mon, 20 Aug 2007 08:39:09 -0500

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.)




-- 
Trevor Bača
address@hidden

Attachment: accidental-spacing.png
Description: PNG image


reply via email to

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