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 12:07:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 30.07.2018 um 11:36 schrieb Urs Liska:
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 ...


Hm, I thought I finally had the solution, based on ideas from an earlier post by you and the one by Trevor:

%%%%%%%%%%%%%%%%
\new Staff \relative {
  <<
    {
      \override Staff.NoteColumn.X-offset = 10
      c''2 c
    }
    \new Voice {
      <>^\markup " A pretty long text that should extend the measure  "
    }
  >>
% uncomment to make things break ...
%{
  <<
    {
      c8 c c c c2
    }
    \new Voice {
      <>^\markup " A pretty long text that should extend the measure  "
    }
  >>
%}
}
%%%%%%%%%%%%%%%%

This works perfectly for one measure (and is totally agnostic of what happens in the "music" voice), but as soon as you add (uncomment) the second measure, things overlap again. Inserting \textLengthOn again makes the markup push notes around. So I'm still not moving forward here ...

Urs



reply via email to

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