| [ << Musical notation ] | [Top][Contents][Index] | [ Specialist notation >> ] |
| [ < Writing text ] | [ Up : Writing text ] | [ Text scripts > ] |
Text objects overview
Simple text objects are entered as strings between double quotes (these are optional for a single word). The markup mode is a richer tool that can accept a variety of advanced text formatting and graphical enhancements, as detailed in Formatting text.
As such, markup blocks may be used:
- in any
TextScriptobject (attached to notes with-,^or_); see Text scripts; - as ‘spanners’, when some indications are prolonged over several beats or bars; see Text spanners;
- in any mark printed above the score, such as
RehearsalMarkorMetronomeMarkobjects respectively introduced with the\markor\tempokeywords; see Text marks; - as stand-alone text blocks, entered at the top level outside of any
\scoreblock (in this specific case the\markupor\markuplistcommand is mandatory, and cannot be omitted in favor of a simple text string between double quotes); see Separate text; - in any definition inside the
\headerblock (e.g.,title,subtitle,composer), or in specific elements defined inside the\paperblock such asevenHeaderMarkupfor page numbers. This is explained in Titles and headers.
Many other text-based objects may be entered as markup blocks, even if that is not their primary use.
- Fingerings may easily be replaced with markup blocks, if
introduced with the
\fingercommand; see Fingering instructions. - Lyric syllables may be formatted through the
\markupcommand; see Common notation for vocal music. - Chord names are in fact defined as markup blocks, and therefore may be redefined in the same way for customizing chord modifiers or chord exceptions; see Displaying chords.
- Dynamics are usually entered in a simple way; however it is possible
to define New dynamic marks as markup objects. Some dynamics
such as crescendo are printed as spanners and may be redefined
through properties such as
crescendoText; see Dynamics. - Less common objects are also made of markup blocks, such as Balloon help indications.
In fact, it is possible to use \markup to customize the appearance of
virtually any graphical object (or ‘grob’), by overriding either its
text property if it has one, or its stencil property. Some of
the logic that makes this a possibility is explained in
Flexible architecture.
The following example illustrates the ubiquity of markup blocks, not only as some of the objects listed above, but also by replacing musical objects with text objects through various methods.
\header { title = \markup "Header" } dyn = #(make-dynamic-script #{ \markup \serif "DynamicText" #}) \markup \box "Top-level markup" \score { << \new ChordNames \with { majorSevenSymbol = \markup "majorSevenSymbol" } \chordmode { c1:maj7 } \new Staff { \tempo \markup "MetronomeMark" \textMark "TextMark" \once \override TupletNumber.text = \markup "TupletNumber" \tuplet 3/2 { \once \override NoteHead.stencil = #ly:text-interface::print \once \override NoteHead.text = \markup \lower #0.5 "NoteHead" c''8^\markup \italic "TextScript" a'\finger \markup \serif "Fingering" \once \override Rest.stencil = #(lambda (grob) (grob-interpret-markup grob #{ \markup "Rest" #})) r } } \new Lyrics \lyricmode { \markup \smallCaps "LyricText" 1 } \new Dynamics { s1\dyn } >> }
See also
Notation Reference: Formatting text, Text scripts, Text spanners, Text marks, Separate text, Fingering instructions, Common notation for vocal music, Displaying chords, New dynamic marks, Dynamics, Balloon help.
Essay on automated music engraving: Flexible architecture.
Snippets: Text.
| [ << Musical notation ] | [Top][Contents][Index] | [ Specialist notation >> ] |
| [ < Writing text ] | [ Up : Writing text ] | [ Text scripts > ] |
![[image of music]](../99/lily-ec6ac85c.png)