Jump to content

Vertically aligning ossias and lyrics: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 1: Line 1:
This snippet demonstrates the use of the context properties <code>alignBelowContext</code> and <code>alignAboveContext</code> to control the positioning of lyrics and ossias.
This snippet demonstrates the use of the context properties <code>alignBelowContext</code> and <code>alignAboveContext</code> to control the positioning of lyrics and ossias.


<lilypond version="2.24.0">
<lilypond version="2.24">
\relative c' <<
\relative c' <<
   \new Staff = "1" { c4 c s2 }
   \new Staff = "1" { c4 c s2 }

Revision as of 18:53, 16 November 2025

This snippet demonstrates the use of the context properties alignBelowContext and alignAboveContext to control the positioning of lyrics and ossias.

\version "2.24"

\relative c' <<
  \new Staff = "1" { c4 c s2 }
  \new Staff = "2" { c4 c s2 }
  \new Staff = "3" { c4 c s2 }
  { \skip 2
    <<
      \lyrics {
        \set alignBelowContext = "1"
        lyrics4 below
      }
      \new Staff \with {
        alignAboveContext = "3"
        fontSize = -2
        \override StaffSymbol.staff-space = #(magstep -2)
        \remove "Time_signature_engraver"
      } {
        \tuplet 6/4 {
          \override TextScript.padding = 3
          c8[^"ossia above" d e d e f]
        }
      }
    >>
  }
>>

\paper {
  ragged-right = ##t
}