[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Appending coda on last line
From: |
Thomas Morley |
Subject: |
Re: Appending coda on last line |
Date: |
Sat, 19 May 2012 13:20:46 +0200 |
2012/5/19 Helge Kruse <address@hidden>:
> I have a score with "da capo al coda". And the coda is exactly one measure.
> Therefore I don't want to put the coda on a new line. But it should be a gap
> between the last measure of the main part and the coda. Additionally I would
> like to indicate that the last measure _is_ the coda.
>
> I have written the measures, but I failed to put them on one line. Can you
> help me?
>
> Helge
Hi Helge,
some time ago I wrote the snippet below. It's a little bit hackish and
would need some redesign/improvement for which I currently do not have
the time.
But for now it should work.
\version "2.15.36"
rochadeAlpha = {
\override Score.BreakAlignment #'break-align-orders =
#(make-vector 3 '(left-edge
ambitus
breathing-sign
staff-bar
clef
key-cancellation
key-signature
time-signature
custos))
\once \override Score.TimeSignature #'space-alist = #'(
(first-note fixed-space . 2.0)
(right-edge extra-space . 0.5)
(staff-bar minimum-space . 2.5))
\once \override Score.KeySignature #'space-alist = #'(
(time-signature extra-space . 1.15)
(first-note fixed-space . 1.0)
(right-edge extra-space . 0.5)
(staff-bar minimum-space . 2.5))
}
move = {
\rochadeAlpha
\once \override Score.BarLine #'extra-offset = #'(-0.5 . 0)
\once \override Score.SpanBar #'extra-offset = #'(-0.5 . 0)
\once \override Score.Clef #'extra-offset = #'(-0.5 . 0)
\once \override Score.KeyCancellation #'extra-offset = #'(-0.5 . 0)
\once \override Score.KeySignature #'extra-offset = #'(-0.5 . 0)
\once \override Score.TimeSignature #'extra-offset = #'(-0.5 . 0)
}
onceTextLengthOn = {
\once\override TextScript #'extra-spacing-width = #'(0 . 0)
\once\override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
}
staffStop = {
\onceTextLengthOn
\stopStaff
\cadenzaOn
}
staffStart = {
\once\override Score.BarNumber #'break-visibility = #'#(#f #t #t)
\startStaff
\cadenzaOff
\set Staff.forceClef = ##t
}
braceBar =
#(define-music-function (parser location braceExt)(number?)
(define ((braceBarLine markup) grob)
(ly:stencil-combine-at-edge (ly:bar-line::print grob)
X LEFT (grob-interpret-markup grob markup) 0.4))
(define braceMarkup
(make-line-markup
(list
(make-with-dimensions-markup '(0 . 0) '(0 . 0)
(make-translate-markup ;(cons 0 ext)
(cons 0 (+ 0.2 (/ braceExt -10)))
(make-left-brace-markup (+ braceExt 20)))))))
#{
\once\override Score.BarLine #'hair-thickness = #'1.6
\once \override Staff.BarLine #'stencil = #(braceBarLine braceMarkup)
\bar "|"
\move
\once\override Score.RehearsalMark #'self-alignment-X = #LEFT
#})
space =
#(define-music-function (parser location width) (number?)
#{
\noBreak
\staffStop
\onceTextLengthOn
s1*1/1000000-\markup \with-dimensions #(cons 0
width) #'(0 . 0) \null
\once \override Score.Clef #'font-size = #'2
\staffStart
\noBreak
#})
%------------ Test
AHrppartA = \relative c'{
<< { c'8 d e a c, b16 a r8\fermata e'16 d^\markup{D.C.} }
\\ { c16 a d a e' a, a' a, e8 d <c a'>} >> | % 37
\bar "||"
\key a \major
\space #8
\braceBar #60
\mark\markup "Coda"
\key a \major
\clef treble
b'16 cis d b cis a b gis <a e cis>2\arpeggio\fermata \bar "|."
}
AHrppartB = \relative c{
\clef bass
<< { e'8 d c b a[ gis] } \\ { <e a,>2 e4 } >>
<a e a,>8\fermata r
\key a \major
\space #8
\clef bass
\key a \major
d8 fis cis e' a,16 e cis e a,4\fermata
}
\score {
<<
\context PianoStaff <<
\set PianoStaff.instrumentName="Piano"
\context Staff = AHrppartA\AHrppartA
\context Staff = AHrppartB\AHrppartB
>>
>>
}
HTH,
Harm