8.1.3 Objetos extensos de texto

Ciertas indicaciones de ejecución, p.ej., rallentando o accelerando, se escriben como texto y se extienden sobre muchos compases mediante líneas de puntos. Estos objetos, que reciben el nombre de ‘spanners’ u objetos de extensión, se pueden crear desde una nota hasta otra usando la siguiente sintaxis:

\relative {
  \override TextSpanner.bound-details.left.text = "rit."
  b'1\startTextSpan
  e,\stopTextSpan
}
[image of music]

La cadena de texto que imprimir se establece a través de propiedades de objeto. De forma predeterminada se imprime en estilo cursiva, pero se pueden conseguir distintos efectos de formato utilizando bloques \markup, como se describe en Formatear el texto.

\relative {
  \override TextSpanner.bound-details.left.text =
    \markup { \upright "rit." }
  b'1\startTextSpan c
  e,\stopTextSpan
}
[image of music]

Tanto el estilo de la línea como la cadena de texto, se pueden definir como una propiedad de objeto. Esta sintaxis se describe en Estilos de línea.

Instrucciones predefinidas

\textSpannerUp, \textSpannerDown, \textSpannerNeutral, \startTextSpan, \stopTextSpan.

Advertencias y problemas conocidos

LilyPond solo puede manejar un objeto de extensión de texto por cada voz.

Los textos de los extremos de un elemento de extensión de texto pueden presentar colisiones.

{
  \once \override TextSpanner.bound-details.left.text = "The text is"
  \once \override TextSpanner.bound-details.right.text = "too long"
  c'2\startTextSpan d'2\stopTextSpan
}
[image of music]

En Espaciado horizontal podemos encontrar soluciones alternativas.

Fragmentos de código seleccionados

Dynamics spanner with custom text

Postfix functions for custom crescendo text spanners. The spanners should start on the first note of the measure. One has to use -\mycresc, otherwise the spanner start will rather be assigned to the next note.

% Two functions for (de)crescendo spanners where you can explicitly
% give the spanner text.
mycresc =
#(define-music-function (mymarkup) (markup?)
   (make-music 'CrescendoEvent
               'span-direction START
               'span-type 'text
               'span-text mymarkup))
mydecresc =
#(define-music-function (mymarkup) (markup?)
   (make-music 'DecrescendoEvent
               'span-direction START
               'span-type 'text
               'span-text mymarkup))

\relative c' {
  c4-\mycresc "custom cresc" c4 c4 c4 |
  c4 c4 c4 c4 |
  c4-\mydecresc "custom decresc" c4 c4 c4 |
  c4 c4 c4 c4 |
  c4 c4\! c4 c4
}
[image of music]

Véase también

Referencia de la notación: Estilos de línea, Matices dinámicos, Formatear el texto.

Fragmentos de código: Texto, Marcas de expresión.

Referencia de funcionamiento interno: TextSpanner.


Referencia de la notación de GNU LilyPond v2.25.32 (development-branch).