Jump to content

Double TextSpan

From LilyPond wiki

in a polyphonic staff it is impossible to have two TextSpans one at the top and one at the bottom The solution is to make two voices

\version "2.24.0"

\paper { ragged-right = ##f }

\relative c' {
  \time 3/4
  %It's impossible to have two one textSpan at the top and one at the bottom
   \override TextSpanner.bound-details.left.text= \markup\normal-text\circle"1"
   <e f'>8 <g e'> <f d'> <g e'>^\startTextSpan <a f'> <bes g'>\stopTextSpan
   
  %solution 
  %separate the voices
  \voices 1,3
  <<
    { %first voices
      \override TextSpanner.bound-details.left.text= \markup\normal-text\circle"1"
      f'8 e d e^\startTextSpan f g\stopTextSpan
    }
    \\
    %second voice
    { 
      %push the notes
      \shiftOff
     \override  TextSpanner.bound-details.left.text= \markup\normal-text\circle "3"
      %make Beam invisible 
      \override Beam.stencil =##f
      a,8 g f g_\startTextSpan a bes\stopTextSpan
    }
  >>
}