Ossia staves with clefs and time signatures: Difference between revisions
m New category |
Add paper-height so that the extra space between the rendering and code is decreased |
||
| (One intermediate revision by the same user not shown) | |||
| Line 17: | Line 17: | ||
%LSR modified by P.P.Schneider on Feb.2014 | %LSR modified by P.P.Schneider on Feb.2014 | ||
showMeter = { \once \revert Staff.TimeSignature.stencil } | showMeter = { \once \revert Staff.TimeSignature.stencil } | ||
| Line 60: | Line 58: | ||
} | } | ||
\paper { tagline = ##f } | \paper { | ||
tagline = ##f | |||
paper-height = 3\in | |||
} | |||
</lilypond> | </lilypond> | ||
Latest revision as of 14:12, 11 July 2026
Under Notation Reference > Staff notation > Modifying single staves (section 1.6.2) > Ossia staves, one technique is given in which a separate staff is created for the ossia, and \context Staff="ossia" places notes on the ossia staff.
The technique recommends removing the time signature engraver and making clefs transparent. If there is a key signature, then the "Key_engraver" may also need to be removed.
\remove "Time_signature_engraver" \override Clef #'transparent = ##t
Problem: If there is a meter, clef, or key change in the middle of an ossia passage, those will be invisible.
Solution: Instead of removing the engravers, override the relevant stencils to be #f, hiding them where they are not needed. Then it's easy to \once \revert the stencil(s) where needed.
In this example, the change to 3/4 time appears in the ossia staff at the end of the first system, and both the clef and meter appear at the beginning of the second system (whereas they are hidden at the start of the first system).
\version "2.24"
%% http://lsr.di.unimi.it/LSR/Item?id=774
%here starts the snippet:
%LSR modified by P.P.Schneider on Feb.2014
showMeter = { \once \revert Staff.TimeSignature.stencil }
outline = {
\time 4/4 s1*2
\showMeter \time 3/4 s2.
\showMeter \time 4/4 s1*2
}
\score {
<<
\new Staff = "ossia" \with {
\override Clef.stencil = ##f
\override KeySignature.stencil = ##f
\override TimeSignature.stencil = ##f
fontSize = #-3
\override StaffSymbol.staff-space = #(magstep -3)
\override StaffSymbol.thickness = #(magstep -3)
} {
\stopStaff
\outline
}
\new Staff <<
\outline
{
\repeat unfold 16 { b'16 }
<<
{ \repeat unfold 60 { b'16 } }
\context Staff="ossia" {
\revert Staff.Clef.stencil
\startStaff
\repeat unfold 22 { b'8 }
\override Clef.stencil = ##f
\stopStaff
}
>>
}
>>
>>
}
\paper {
tagline = ##f
paper-height = 3\in
}