lilypond-user
[Top][All Lists]
Advanced

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

Re: Dot positions in chord with overlapping voices


From: Jean Abou Samra
Subject: Re: Dot positions in chord with overlapping voices
Date: Tue, 17 May 2022 23:31:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1



Le 13/05/2022 à 00:29, Owen Lamb a écrit :
Hi all,

I'm engraving the following:

<<
  {
    \time 12/8
    g'4. ~ 8 f' e'
  }
  \\
  <c' a'>2.
>>

In order to keep the top dot and tie from colliding, I'd like the dots associated with the second voice to be placed on the left of the dotted quarter notehead. How can this be done?

N.B. My goal is also Gould's preferred way of engraving such chords; see p. 58: Overlapping Chords. By default, LilyPond outputs her example chords as she would have them "in cramped conditions":

<<
  {
    \cadenzaOn
    <f' a'>2. <e' g'>
  } \\ {
    <c' f''>2. <d' d''>
  }
>>



Hi Owen,

You could try something like this:

\version "2.22.2"

\layout {
  \context {
    \Staff
    \remove Dot_column_engraver
  }
  \context {
    \Voice
    \consists Dot_column_engraver
  }
}

<<
  {
    \cadenzaOn
    \once \override NoteColumn.force-hshift = 0.9
    <f' a'>2.
    \once \override NoteColumn.force-hshift = 1.05
    <e' g'>
  } \\ {
    \once \override Dots.extra-offset = #'(-0.2 . 0)
    <c' f''>2.
    \once \override Dots.extra-offset = #'(-2.4 . 0)
    <d' d''>
  }
>>


Moving the Dot_column_engraver from Staff to Voice gives each
voice a dot configuration that would be appropriate if it
were standalone (so it changes the vertical positions of the
dots). You may or may not want to keep it.

The rest is using extra-offset, which is a cheap solution, and
sadly the easiest solution because the padding of DotColumn
currently isn't configurable. (This may be worth opening
a feature request on the tracker.) It looks hardcoded at exactly
the width of one dot, if I have read dots.cc correctly.

As is often the case, you can also define a Scheme function
to override the positions manually, specifying them relative
to the note column and not relative to the default position
that is computed. This doesn't use extra-offset, so it also
has the theorical advantage of playing nicer with other
parameters that depend on this value.

\version "2.22.2"

dotsOffsets =
#(define-music-function (offs) (number-list?)
   #{
     \once \override Staff.DotColumn.positioning-done =
     #(lambda (dot-col)
        (let ((dots (ly:grob-array->list (ly:grob-object dot-col 'dots))))
          (for-each
           (lambda (d o)
             (ly:grob-translate-axis! d o X))
           (sort dots ly:grob-vertical<?)
           offs)))
   #})

<<
  {
    \cadenzaOn
    \dotsOffsets #'(1.2 2.5 2.5 1.5)
    \once \override NoteColumn.force-hshift = 0.9
    <f' a'>2.
    \dotsOffsets #'(1.05 3.2 3.2 1.05)
    \once \override NoteColumn.force-hshift = 1.05
    <e' g'>
  } \\ {
    <c' f''>2.
    <d' d''>
  }
>>

Best,
Jean




reply via email to

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