Previous: Ottava brackets, Up: Preparing parts
The \tag
command marks music expressions with a name. These
tagged expressions can be filtered out later. With this mechanism it
is possible to make different versions of the same music source.
In the following example, we see two versions of a piece of music, one for the full score, and one with cue notes for the instrumental part
c1 << \tag #'part << R1 \\ { \set fontSize = #-1 c4_"cue" f2 g4 } >> \tag #'score R1 >> c1
The same can be applied to articulations, texts, etc.: they are made by prepending
-\tag #your-tag
to an articulation, for example,
c1-\tag #'part ^4
This defines a note with a conditional fingering indication.
By applying the \keepWithTag
and \removeWithTag
commands, tagged expressions can be filtered. For example,
<< the music \keepWithTag #'score the music \keepWithTag #'part the music >>
would yield
The argument of the \tag
command should be a symbol, or a list
of symbols, for example,
\tag #'(original-part transposed-part) ...
Examples: input/regression/tag-filter.ly.
Multiple rests are not merged if you create the score with both tagged sections.
This page is for LilyPond-2.6.3 (stable-branch).