lilypond-user
[Top][All Lists]
Advanced

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

Re: Specific large "watermark" time signature


From: Malte Meyn
Subject: Re: Specific large "watermark" time signature
Date: Thu, 11 Aug 2016 13:09:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0



Am 11.08.2016 um 09:54 schrieb Urs Liska:
manually editing Y-offset doesn't
seem like a good idea, as I don't have the impression there's an easy
relation that could be set up between font-size and Y-offset.

There is such a relation: The time signature in the Score context is aligned to the top of the Score, in this case it’s the top of the treble clef. So one has to offset by 1.75 (approximate height of treble clef above the Staff) and two staff spaces scaled by font-size (because a time signature digit is two staff spaces tall). See first example below. This might break when there are other things that go above the treble clef.

Alternatively you can print the time signature in the topmost staff (if you never remove it by \RemoveEmptyStaves) and set it’s Y-extent to empty. See second example below.

Concerning your second wish in the comments: You can put \consists and \remove into the \layout { \context { … } } blocks so you don’t have to use \with.

%%%%%%%%%%%%%%%%%%%%% FIRST EXAMPLE

\version "2.19.46"

\layout {
  tsfs = 15.3 % time signature font size
  \context {
    \Score
    \consists Time_signature_engraver
    \override TimeSignature.font-size = \tsfs
    \override TimeSignature.X-extent = #'(0 . 0)
    \override TimeSignature.space-alist.first-note = #'(fixed-space . 0)
    \override TimeSignature.color = #'(0.8 0.8 0.9)
    \override TimeSignature.layer = -1
    \override TimeSignature.Y-offset =
    #(-
      (* -2 (magstep tsfs)) ; two staff spaces = one digit height
      1.75) % height of treble clef above topmost staff line
  }
  \context {
    \Staff
    \remove Time_signature_engraver
  }
}

\score {
  \new StaffGroup <<
    \new GrandStaff <<
      \new Staff \relative c' {
        \time 7/4
        c1 c2.
        \time 5/4
        c2. c2
      }
      \new Staff \relative c {
        \clef bass
        c1 c2.
        c2. c2
      }
    >>
    \new Staff \relative c'' {
      c1 c2. c2. c2
    }
  >>
}

%%%%%%%%%%%%%%%%%%%%% SECOND EXAMPLE

\version "2.19.46"

tsfs = 15.3 % time signature font size

\layout {
  \context {
    \Staff
    \remove Time_signature_engraver
  }
}

\score {
  \new StaffGroup <<
    \new GrandStaff <<
      \new Staff \with {
        \consists Time_signature_engraver
        \override TimeSignature.font-size = \tsfs
        \override TimeSignature.X-extent = #'(0 . 0)
\override TimeSignature.space-alist.first-note = #'(fixed-space . 0)
        \override TimeSignature.color = #'(0.8 0.8 0.9)
        \override TimeSignature.layer = -1
        \override TimeSignature.Y-offset =
        #(-
          2 ; 2 staff spaces because it’s normally center-aligned
          (* 2 (magstep tsfs))) % two staff spaces = one digit height
        \override TimeSignature.Y-extent = #'(+inf.0 . -inf.0)
      }\relative c' {
        \time 7/4
        c1 c2.
        \time 5/4
        c2. c2
      }
      \new Staff \relative c {
        \clef bass
        c1 c2.
        c2. c2
      }
    >>
    \new Staff \relative c'' {
      c1 c2. c2. c2
    }
  >>
}

%%%%%%%%%%%%%%%%%%%%% END



reply via email to

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