[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: Alignment issues of Time signature above the staff
From:       Chen Leo <leo04chen () outlook ! com>
Date:       2020-03-29 6:10:42
Message-ID: SL2PR04MB30335793478264A804971581BECA0 () SL2PR04MB3033 ! apcprd04 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

Hi Kevin,


Thank you for your reply.


For the first problem, you will have to set break-align-symbol to ##f to reproduce \
the problem. That is because by default break-align-symbol is set to \
#'time-signature. so commenting out the override shouldn't help.


Secondly, using \override TimeSignature.X-extent = #'(0 . 0) causes collisions when \
texts and notes are displayed above the staff because lilypond is not adding vertical \
spacing above the staff. And it seems like now all the time signatures are shifted a \
bit to the right instead of aligning right after the bar line.


Thirdly, the bar numbers are raised to align vertically with the time-signatures, \
which is not something I would like to have. It will be nice if you can share any \
ideas on how that can be solved.


Leo

Here's an example:

\version "2.20.0"

\layout {
  \context {
    \type "Engraver_group"
    \consists "Time_signature_engraver"
    \consists "Axis_group_engraver"
    \name "TimeSig"
    \alias "Staff"
    % original settings from "http://lsr.di.unimi.it/LSR/Snippet?id=272"
    %{
      \override TimeSignature.font-size = #3
      \override TimeSignature.break-align-symbol = ##f
      \override TimeSignature.X-offset =
        #ly:self-alignment-interface::x-aligned-on-self
      \override TimeSignature.self-alignment-X = #CENTER
      \override TimeSignature.after-line-breaking =
      #shift-right-at-line-begin
    %}
    % settings after adjustments
    {
    \override TimeSignature.font-size = #4
    \override TimeSignature.X-offset =
      #ly:self-alignment-interface::x-aligned-on-self
    \override TimeSignature.self-alignment-X = #LEFT
    \override TimeSignature.X-extent = #'(0 . 0)
    }
  }
  \context {
    \Score
    \accepts TimeSig
  }
  \context {
    \Staff
    \remove "Time_signature_engraver"
  }
}

timeSignatures = { \numericTimeSignature \time 4/4 s1 \time 3/8 s4. \time 3/4 s2. \
\break \time 4/4 s1 }

\score {
  <<
    \new TimeSig \timeSignatures
    \new Staff \relative c' { c4 ^\markup \column {"a" "b" "c"} ( d4 e4 f4 ) a''4
                              ^\markup \column {"a" "b" "c"} ( g8 ) R2. c1 }
    \new Staff \relative c' { R1 R4. \clef bass a2. c1 }
    \new Staff \relative c' { R1 R4. R2. c1 }
  >>
}


________________________________
·¢¼þÈË: Kevin Barry <barrykp@gmail.com>
·¢ËÍʱ¼ä: 2020Äê3Ô 28ÈÕ 08:48
ÊÕ¼þÈË: Chen Leo <leo04chen@outlook.com>
³­ËÍ: lilypond-user@gnu.org <lilypond-user@gnu.org>
Ö÷Ìâ: Re: Alignment issues of Time signature above the staff

Hi Chen,

I was able to solve the second of your problems (the whole bar rests
being shifted by the time signatures in the TimeSig context) by
adding:
\override TimeSignature.X-extent = ##f
(You could also use the value #'(0 . 0) if the warnings are off
putting, but I noticed that that doesn't *quite* fix it fully.)

I tried to reproduce your description of the first problem (time
signatures aligning over cue clefs), but even commenting out the
break-align-symbol override didn't make it appear. I was able to
correct the alignment of the first time signature by removing the
line:
\override TimeSignature.after-line-breaking = #shift-right-at-line-begin

After both of the above modifications everything looks OK to me, but
perhaps we need a fuller example.

Kevin

On Sat, 28 Mar 2020 at 10:30, Chen Leo <leo04chen@outlook.com> wrote:
> 
> Hi, I am trying to put time signatures above the staffs according to \
> "http://lsr.dsi.unimi.it/LSR/Item?id=272". 
> 
> 
> I discovered an issue, that is whenever a clef change is made, the time signature \
> on the next bar fails to align to the bar line, it aligns to the cue clef in the \
> previous bar instead. After some research, I found out that this is because the \
> TimeSignature property "break-align-symbol" is set to "##f". I set \
> "break-align-symbol" back to "#'time-signature", and this problem is solved, \
> however, the horizontal alignments of the other time signatures are messed up. \
> (Using the code presented below, the 4/4 in the first bar moves to the right & the \
> bar rest on the third bar stretches to the right. ) Are there any ways to align all \
> the time signatures to their corresponding bar lines without changing the \
> alignments of other objects? Thank you. 
> 
> 
> \version "2.20.0"
> 
> 
> 
> \layout {
> 
> \context {
> 
> \type "Engraver_group"
> 
> \consists "Time_signature_engraver"
> 
> \consists "Axis_group_engraver"
> 
> \name "TimeSig"
> 
> \alias "Staff"
> 
> \override TimeSignature.font-size = #4
> 
> \override TimeSignature.break-align-symbol = #'time-signature
> 
> \override TimeSignature.X-offset =
> 
> #ly:self-alignment-interface::x-aligned-on-self
> 
> \override TimeSignature.self-alignment-X = #LEFT
> 
> \override TimeSignature.after-line-breaking =
> 
> #shift-right-at-line-begin
> 
> }
> 
> \context {
> 
> \Score
> 
> \accepts TimeSig
> 
> }
> 
> \context {
> 
> \Staff
> 
> \remove "Time_signature_engraver"
> 
> }
> 
> }
> 
> 
> 
> timeSignatures = { \numericTimeSignature \time 4/4 s1 \time 3/8 s4. \time 3/4 s2. }
> 
> 
> 
> \score {
> 
> <<
> 
> \new TimeSig \timeSignatures
> 
> \new Staff \relative c' { c4 ( d4 e4 f4 ) a4 ( g8 ) R2. }
> 
> \new Staff \relative c' { R1 R4. \clef bass a2. }
> 
> \new Staff \relative c' { R1 R4. R2. }
> 
> > > 
> 
> }
> 
> 


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);"> <div style="margin: 0px; font-size: 12pt; font-family: \
Calibri, Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255)"> <p \
style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; margin: 0px"><span \
lang="en-US" style="margin: 0px; font-family: Arial, Helvetica, sans-serif">Hi \
Kevin,</span></p> <p style="font-size: 10.5pt; font-family: µÈÏß; text-align: \
justify; margin: 0px"><br> </p>
<p style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; margin: \
0px"><span lang="en-US" style="margin: 0px; font-family: Arial, Helvetica, \
sans-serif">Thank you for your reply.</span></p> <p style="font-size: 10.5pt; \
font-family: µÈÏß; text-align: justify; margin: 0px"><br> </p>
<p style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; margin: \
0px"><span lang="en-US" style="margin: 0px; font-family: Arial, Helvetica, \
sans-serif">For the first problem, you will have to set break-align-symbol to ##f to \
reproduce the problem.&nbsp;</span><span style="margin: 0px; font-family: Arial, \
Helvetica, sans-serif; letter-spacing: 0px">That  is because by default \
break-align-symbol is set to #'time-signature. so commenting out the override \
shouldn't help.</span></p> <p style="font-size: 10.5pt; font-family: µÈÏß; \
text-align: justify; margin: 0px"><span style="margin: 0px; letter-spacing: 0px"><br> \
</span></p> <p style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; \
margin: 0px"><span style="margin: 0px; font-family: Arial, Helvetica, sans-serif; \
letter-spacing: 0px">Secondly, using&nbsp;\override TimeSignature.X-extent = #'(0 . \
0) causes collisions when texts  and notes are displayed above the staff because \
lilypond is not adding vertical spacing above the staff. And it seems like now all \
the time signatures are shifted a bit to the right instead of aligning right after \
the bar line.</span></p> <p style="font-size: 10.5pt; font-family: µÈÏß; text-align: \
justify; margin: 0px"><span style="margin: 0px; letter-spacing: 0px"><br> </span></p>
<p style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; margin: \
0px"><span style="margin: 0px; font-family: Arial, Helvetica, sans-serif; \
letter-spacing: 0px">Thirdly, the bar numbers are raised to align vertically with the \
time-signatures, which  is not something I would like to have. It will be nice if you \
can share any ideas on how that can be solved.</span></p> <p style="font-size: \
10.5pt; font-family: µÈÏß; text-align: justify; margin: 0px"><span style="margin: \
0px; letter-spacing: 0px"><br> </span></p>
<p style="font-size: 10.5pt; font-family: µÈÏß; text-align: justify; margin: \
0px"><span style="margin: 0px; font-family: Arial, Helvetica, sans-serif; \
letter-spacing: 0px">Leo</span></p> <br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; background-color: rgb(255, 255, 255)"> Here's an example:</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; background-color: rgb(255, 255, 255)"> <br>
</div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; background-color: rgb(255, 255, 255)"> <span style="margin: 0px">\version \
&quot;2.20.0&quot;<br> </span>
<div style="margin: 0px"><br>
</div>
<div style="margin: 0px">\layout {<br>
</div>
<div style="margin: 0px">&nbsp; \context {<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \type &quot;Engraver_group&quot;<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \consists \
&quot;Time_signature_engraver&quot;<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; \consists &quot;Axis_group_engraver&quot;<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \name &quot;TimeSig&quot;<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \alias &quot;Staff&quot;<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; % original settings from \
&quot;http://lsr.di.unimi.it/LSR/Snippet?id=272&quot;<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; %{<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \override TimeSignature.font-size = \
#3<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \override \
TimeSignature.break-align-symbol = ##f<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \override TimeSignature.X-offset =<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; &nbsp; \
#ly:self-alignment-interface::x-aligned-on-self<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \override \
TimeSignature.self-alignment-X = #CENTER<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \override \
TimeSignature.after-line-breaking =<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; #shift-right-at-line-begin<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; %}<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; % settings after adjustments<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; {<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \override TimeSignature.font-size = #4<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \override TimeSignature.X-offset =<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; \
#ly:self-alignment-interface::x-aligned-on-self<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; \override TimeSignature.self-alignment-X = \
#LEFT<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; \override TimeSignature.X-extent = #'(0 . \
0)<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; }<br>
</div>
<div style="margin: 0px">&nbsp; }<br>
</div>
<div style="margin: 0px">&nbsp; \context {<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \Score<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \accepts TimeSig<br>
</div>
<div style="margin: 0px">&nbsp; }<br>
</div>
<div style="margin: 0px">&nbsp; \context {<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \Staff<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \remove \
&quot;Time_signature_engraver&quot;<br> </div>
<div style="margin: 0px">&nbsp; }<br>
</div>
<div style="margin: 0px">}<br>
</div>
<div style="margin: 0px"><br>
</div>
<div style="margin: 0px">timeSignatures = { \numericTimeSignature \time 4/4 s1 \time \
3/8 s4. \time 3/4 s2. \break \time 4/4 s1 }<br> </div>
<div style="margin: 0px"><br>
</div>
<div style="margin: 0px">\score {<br>
</div>
<div style="margin: 0px">&nbsp; &lt;&lt;<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \new TimeSig \timeSignatures<br>
</div>
<div style="margin: 0px">&nbsp; &nbsp; \new Staff \relative c' { c4 ^\markup \column \
{&quot;a&quot; &quot;b&quot; &quot;c&quot;} ( d4 e4 f4 ) a''4<span style="margin: \
0px">&nbsp;</span><br> </div>
<div style="margin: 0px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^\markup \column {&quot;a&quot; \
&quot;b&quot; &quot;c&quot;} ( g8 ) R2. c1 }<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; \new Staff \relative c' { R1 R4. \clef bass \
a2. c1 }<br> </div>
<div style="margin: 0px">&nbsp; &nbsp; \new Staff \relative c' { R1 R4. R2. c1 }<br>
</div>
<div style="margin: 0px">&nbsp; &gt;&gt;<br>
</div>
<span style="margin: 0px">}</span></div>
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" \
style="font-size:11pt"><b>·¢¼þÈË:</b> Kevin Barry &lt;barrykp@gmail.com&gt;<br> \
<b>·¢ËÍʱ¼ä:</b> 2020Äê3Ô 28ÈÕ 08:48<br> <b>ÊÕ¼þÈË:</b> Chen Leo \
&lt;leo04chen@outlook.com&gt;<br> <b>³­ËÍ:</b> lilypond-user@gnu.org \
&lt;lilypond-user@gnu.org&gt;<br> <b>Ö÷Ìâ:</b> Re: Alignment issues of Time signature \
above the staff</font> <div>&nbsp;</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">Hi Chen,<br>
<br>
I was able to solve the second of your problems (the whole bar rests<br>
being shifted by the time signatures in the TimeSig context) by<br>
adding:<br>
\override TimeSignature.X-extent = ##f<br>
(You could also use the value #'(0 . 0) if the warnings are off<br>
putting, but I noticed that that doesn't *quite* fix it fully.)<br>
<br>
I tried to reproduce your description of the first problem (time<br>
signatures aligning over cue clefs), but even commenting out the<br>
break-align-symbol override didn't make it appear. I was able to<br>
correct the alignment of the first time signature by removing the<br>
line:<br>
\override TimeSignature.after-line-breaking = #shift-right-at-line-begin<br>
<br>
After both of the above modifications everything looks OK to me, but<br>
perhaps we need a fuller example.<br>
<br>
Kevin<br>
<br>
On Sat, 28 Mar 2020 at 10:30, Chen Leo &lt;leo04chen@outlook.com&gt; wrote:<br>
&gt;<br>
&gt; Hi, I am trying to put time signatures above the staffs according to &quot;<a \
href="http://lsr.dsi.unimi.it/LSR/Item?id=272">http://lsr.dsi.unimi.it/LSR/Item?id=272</a>&quot;.<br>
 &gt;<br>
&gt;<br>
&gt;<br>
&gt; I discovered an issue, that is whenever a clef change is made, the time \
signature on the next bar fails to align to the bar line, it aligns to the cue clef \
in the previous bar instead. After some research, I found out that this is because \
the TimeSignature  property &quot;break-align-symbol&quot; is set to &quot;##f&quot;. \
I set &quot;break-align-symbol&quot; back to &quot;#'time-signature&quot;, and this \
problem is solved, however, the horizontal alignments of the other time signatures \
are messed up. (Using the code presented below, the 4/4 in the  first bar moves to \
the right &amp; the bar rest on the third bar stretches to the right. ) Are there any \
ways to align all the time signatures to their corresponding bar lines without \
changing the alignments of other objects? Thank you.<br> &gt;<br>
&gt;<br>
&gt;<br>
&gt; \version &quot;2.20.0&quot;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; \layout {<br>
&gt;<br>
&gt;&nbsp;&nbsp; \context {<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \type &quot;Engraver_group&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \consists &quot;Time_signature_engraver&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \consists &quot;Axis_group_engraver&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \name &quot;TimeSig&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \alias &quot;Staff&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \override TimeSignature.font-size = #4<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \override TimeSignature.break-align-symbol = \
#'time-signature<br> &gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \override TimeSignature.X-offset =<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
#ly:self-alignment-interface::x-aligned-on-self<br> &gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \override TimeSignature.self-alignment-X = #LEFT<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \override TimeSignature.after-line-breaking =<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #shift-right-at-line-begin<br>
&gt;<br>
&gt;&nbsp;&nbsp; }<br>
&gt;<br>
&gt;&nbsp;&nbsp; \context {<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \Score<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \accepts TimeSig<br>
&gt;<br>
&gt;&nbsp;&nbsp; }<br>
&gt;<br>
&gt;&nbsp;&nbsp; \context {<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \Staff<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \remove &quot;Time_signature_engraver&quot;<br>
&gt;<br>
&gt;&nbsp;&nbsp; }<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; timeSignatures = { \numericTimeSignature \time 4/4 s1 \time 3/8 s4. \time 3/4 \
s2. }<br> &gt;<br>
&gt;<br>
&gt;<br>
&gt; \score {<br>
&gt;<br>
&gt;&nbsp;&nbsp; &lt;&lt;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \new TimeSig \timeSignatures<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \new Staff \relative c' { c4 ( d4 e4 f4 ) a4 ( g8 ) R2. \
}<br> &gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \new Staff \relative c' { R1 R4. \clef bass a2. }<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; \new Staff \relative c' { R1 R4. R2. }<br>
&gt;<br>
&gt;&nbsp;&nbsp; &gt;&gt;<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
</div>
</span></font></div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic