Extensions de text

Certes indicacions d’execució, per exemple rallentando o accelerando, s’escriuen com a text i s’estenen sobre molts compassos mitjançant línies de punts. Aquests objectes, que reben el nom de ‘spanners’ o objectes d’extensió, es poden crear des d’una nota fins una altra usant la sintaxi següent:

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

La cadena de text que imprimeix s’estableix a través de propietats d’objecte. De forma predeterminada s’imprimeix en estil cursiva, però es poden aconseguir diferents efectes de format utilitzant blocs \markup, com es descriue a Donar format al text.

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

L’estil de la línia, així com la cadena de text, es definir com una propietat d’objecte. Aquesta sintaxi es descriu a Estils de línia.

Instruccions predefinides

\textSpannerUp, \textSpannerDown, \textSpannerNeutral.

Advertiments i problemes coneguts

El LilyPond sols pot utilitzar un objecte d’extensió de text per cada veu.

Fragments de codi seleccionats

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]

Vegeu també

Referència de la notació: Estils de línia, Matisos dinàmics, Donar format al text.

Fragments de codi: Text, Expressive marks.

Referència de funcionament interno: TextSpanner.


Referència de la notació del GNU LilyPond v2.25.32 (development-branch).