lilypond-user
[Top][All Lists]
Advanced

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

Re: Custom key signature at line break


From: Thomas Morley
Subject: Re: Custom key signature at line break
Date: Thu, 6 Sep 2012 23:24:25 +0200

2012/9/6 Janne Uusitalo <address@hidden>:
> Hi,
>
> if I typeset a key change from b major to g major, f remains sharp and
> LilyPond prints out the naturals necessary for c, g, d, and a. Makes
> perfect sense, but the standard I'm required to follow has it that an
> extra # for fis should precede the group of naturals. Is there a way
> to achieve this? I get close by creating a custom signature with the
> right set of symbols, but as the change occurs at line break, I'm
> stuck figuring out how to print this custom set at the end of line 1
> and only that of g major at the start of line 2. Any helpful ideas to
> share?
>
> BR,
> Janne
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user


Hi,

at the end of a line I'd change the order in which KeyCancellation and
KeySignature appears. This requires some new settings in KeySignature
'space-alist and BreakAlignment 'break-align-orders.

customBreak = {
 #(define key-signature-space-alist '(
                (time-signature extra-space . 1.15)
                (key-cancellation extra-space . 0.3)
                (breathing-sign extra-space . 1)
                (staff-bar extra-space . 1.1)
                (cue-clef extra-space . 0.5)
                (right-edge extra-space . 0.5)
                (first-note semi-fixed-space . 2.5)))
                
 \once\override  Score.KeySignature #'space-alist =
        #key-signature-space-alist
 \once \override Score.BreakAlignment #'break-align-orders =
                #'#(    
                ;; end of line
                    (breathing-sign
                     clef
                     staff-bar
                     key-signature
                     key-cancellation
                     time-signature)
                ;; middle of line
                    (breathing-sign
                     clef
                     key-cancellation
                     key-signature
                     staff-bar
                     time-signature)
                ;; begin of line
                    (clef
                     key-cancellation
                     key-signature
                     staff-bar
                     time-signature))
 \break
}

\new Staff \relative c' {
        \key b\major

        f4 ges \clef alto as b \breathe

        \customBreak

        \clef treble
        \key g\major
        \time 8/8
        \repeat volta 2 {
                 c d e f
        }
}

Seems to work with all tested versions (2.12.3 up to 2.17.2)
The code is mostly copied from an old file of mine, I hope I didn't
overlook anything.


HTH,
  Harm



reply via email to

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