Hi Malte,
thanks for your suggestions.
Am 11.08.2016 um 13:09 schrieb Malte Meyn:
>
>
> 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.
This is interesting but of course completely unreliable: it will break
with any item going over the treble clef (e.g. a \tempo or a \mark).
>
> 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.
This works out perfectly, thank you.
>
> 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.
I had already figured that out before you replied. Unfortunately this
doesn't work out if you for example want to have the time signature
printed at every staff group. However, I found the way to do it: wrap
the context mod in a function, remove all time signatures by default and
apply the function to whichever staff should print the time signature.
See the attached files..
Best
Urs
>
> %%%%%%%%%%%%%%%%%%%%% 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
>
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
\version "2.19.47"
% Create a "watermark" style time signature with the following characteristics:
% - Remove time signature from all contexts where it is not explicitly included
% - font-size settable
% - top-align to the given staff
% - print behind music, without affecting any layout of music
% - flow through following stave without pushing them down
% By default time signatures are not printed at the Staff context
\layout {
\context {
\Staff
\remove "Time_signature_engraver"
}
}
% Add a watermark time signature to a given staff by writing
% \new Staff \with {
% \watermarkTimesig <color> <font-size>
% }
% (with the color argument being optional, defaulting to an 20% grey)
watermarkTimesig =
#(define-scheme-function (color font-size)((color? (list .8 .8 .8)) number?)
#{
\with {
\consists Time_signature_engraver
\override TimeSignature.font-size = #font-size
\override TimeSignature.X-extent = #'(0 . 0)
\override TimeSignature.space-alist.first-note = #'(fixed-space . 0)
\override TimeSignature.color = #color
\override TimeSignature.layer = -1
\override TimeSignature.Y-offset =
#(-
2 ; 2 staff spaces because it’s normally center-aligned
(* 2 (magstep font-size))) % two staff spaces = one digit height
\override TimeSignature.Y-extent = #'(+inf.0 . -inf.0)
}
#})
\version "2.19.47"
\include "watermark-timesig.ily"
music = \relative c'' {
\time 7/4
c1 c2.
\time 5/4
c2. c2
}
\score {
<<
\new StaffGroup <<
\new GrandStaff <<
% Add a watermark time signature top-aligned to this staff
\new Staff \with {
\watermarkTimesig 10
} \music
\new Staff \music
>>
\new Staff \music
>>
\new StaffGroup <<
% Add a watermark time signature top-aligned to this staff
\new Staff \with {
\watermarkTimesig #'(.8 .9 .3) 16
} \music
\new Staff \music
\new GrandStaff <<
\new Staff \music
\new Staff \music
>>
\new Staff \music
>>
>>
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user