lilypond-user
[Top][All Lists]
Advanced

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

Re: \textLengthOn in polyphony and over MultiMeasureRests


From: Urs Liska
Subject: Re: \textLengthOn in polyphony and over MultiMeasureRests
Date: Mon, 30 Jul 2018 11:36:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Hi Torsten,

thanks for these explanations.


Am 29.07.2018 um 19:22 schrieb Torsten Hämmerle:
Trevor Bača-2 wrote
Torsten, how are you achieving the text centered above the pair of half
notes in the original example (ie, in the measure top-headed with
"Minima")? Try as I might, I can't get it!

Hi Trevor,

You've got me there! ;)

Standard \textLengthOn will push away neighbouring notes and you won't get
the markup text to neatly and symmetrically align with the barlines without
some tweaking.

\textLengthOn just sets the following two properties:

   \override TextScript.extra-spacing-width = #'(-0.0 . 0.4)
   \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)

By adapting extra-spacing-width, we can actually set the left and right
"margins" of the text. This way, we can attach the TextScript to the second
note and make it overlap the first note.

Finally (this is not necessary, though) I've shifted both notes to the right
by using extra-offset to better match the original.

<http://lilypond.1069038.n5.nabble.com/file/t3887/textlength-modified.png>

%%%%%%%
{
   \override TextScript.self-alignment-X = #CENTER

% custom version of \textLengthOn:
   \override TextScript.extra-spacing-width = #'(2.6 . 0.4)    % default:
#'(-0.0 . 0.4)
   \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)

% Shift NoteHead and Stem to the right
   \override NoteHead.extra-offset = #'(5 . 0)
   \override Stem.extra-offset = #'(5 . 0)

   R1
   \bar "||"
   c''2 c''^\markup \line { \typewriter "#'extra-offset" "trickery" }
   \bar "||"
}
%%%%%%

HTH,
Torsten


So if I see correctly this means your essentially doing a regular \textLengthOn that would push the neighboring notes away but prevent that by manually setting a "negative padding". And this has to be adjusted to the content around the element with the markup on it. Which makes it even less likely to get a decently working solution as a *function* that automatically determines the widths to set. I can imagine going through the note columns of the current system/measure and do some calculations, but earlier intense experiments with this area (I had to create manually drawn slur replacments) make be doubt that the width values needed for this are available at the point where I still can change the extra-spacing-width.

Plus: it seems this approach is problematic when more than one other note is in the area covered by the text (see attached PNG):

%%%%%%%
{
  \override TextScript.self-alignment-X = #CENTER
  \override TextScript.extra-spacing-width = #'(5 . 0.4)
  \override TextScript.extra-spacing-height = #'(-inf.0 . +inf.0)

  R1
  \bar "||"
  c''4 c'' c''2^\markup \line { \typewriter "#'extra-offset" "trickery" }
  \bar "||"
}
%%%%%%

Best
Urs, who is trying further ...

Attachment: document.png
Description: PNG image


reply via email to

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