]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/editorial.itely
Docs: Get rid of lilyquote snippet option, replaced by ordinary quote
[lilypond.git] / Documentation / notation / editorial.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  For details, see the Contributors'
7     Guide, node Updating translation committishes..
8 @end ignore
9
10 @c \version "2.14.0"
11
12 @node Editorial annotations
13 @section Editorial annotations
14
15 @lilypondfile[quote]{editorial-headword.ly}
16
17 This section discusses the various ways to change the appearance of
18 notes and add analysis or educational emphasis.
19
20 @menu
21 * Inside the staff::
22 * Outside the staff::
23 @end menu
24
25
26 @node Inside the staff
27 @subsection Inside the staff
28
29 This section discusses how to add emphasis to elements that are
30 inside the staff.
31
32 @menu
33 * Selecting notation font size::
34 * Fingering instructions::
35 * Hidden notes::
36 * Coloring objects::
37 * Parentheses::
38 * Stems::
39 @end menu
40
41 @node Selecting notation font size
42 @unnumberedsubsubsec Selecting notation font size
43
44 @cindex font size (notation) scaling
45 @cindex font size (notation)
46 @cindex selecting font size (notation)
47 @cindex notation font size
48 @cindex note heads
49
50 @funindex fontSize
51 @funindex font-size
52 @funindex magstep
53 @funindex \huge
54 @funindex \large
55 @funindex \normalsize
56 @funindex \small
57 @funindex \tiny
58 @funindex \teeny
59 @funindex huge
60 @funindex large
61 @funindex normalsize
62 @funindex small
63 @funindex tiny
64 @funindex teeny
65
66 The font size of notation elements may be altered.  It does not
67 change the size of variable symbols, such as beams or slurs.
68
69 @warning{For font sizes of text, see
70 @ref{Selecting font and font size}.}
71
72 @lilypond[verbatim,quote,relative=2]
73 \huge
74 c4.-> d8---3
75 \large
76 c4.-> d8---3
77 \normalsize
78 c4.-> d8---3
79 \small
80 c4.-> d8---3
81 \tiny
82 c4.-> d8---3
83 \teeny
84 c4.-> d8---3
85 @end lilypond
86
87 Internally, this sets the @code{fontSize} property.  This in turn
88 causes the @code{font-size} property to be set in all layout
89 objects.  The value of @code{font-size} is a number indicating the
90 size relative to the standard size for the current staff height.
91 Each step up is an increase of approximately 12% of the font size.
92 Six steps is exactly a factor of two.  The Scheme function
93 @code{magstep} converts a @code{font-size} number to a scaling
94 factor.  The @code{font-size} property can also be set directly,
95 so that only certain layout objects are affected.
96
97 @lilypond[verbatim,quote,relative=2]
98 \set fontSize = #3
99 c4.-> d8---3
100 \override NoteHead #'font-size = #-4
101 c4.-> d8---3
102 \override Script #'font-size = #2
103 c4.-> d8---3
104 \override Stem #'font-size = #-5
105 c4.-> d8---3
106 @end lilypond
107
108 @cindex standard font size (notation)
109 @cindex font size (notation), standard
110
111 @funindex font-interface
112 @funindex font-size
113
114 Font size changes are achieved by scaling the design size that is
115 closest to the desired size.  The standard font size (for
116 @w{@code{font-size = #0}}) depends on the standard staff height.
117 For a 20pt staff, a 10pt font is selected.
118
119 The @code{font-size} property can only be set on layout objects
120 that use fonts.  These are the ones supporting the
121 @code{font-interface} layout interface.
122
123
124 @predefined
125 @code{\teeny},
126 @code{\tiny},
127 @code{\small},
128 @code{\normalsize},
129 @code{\large},
130 @code{\huge}.
131 @endpredefined
132
133
134 @seealso
135 Snippets:
136 @rlsr{Editorial annotations}.
137
138 Internals Reference:
139 @rinternals{font-interface}.
140
141
142 @node Fingering instructions
143 @unnumberedsubsubsec Fingering instructions
144
145 @cindex fingering
146 @cindex finger change
147
148 @funindex \finger
149 @funindex finger
150
151 Fingering instructions can be entered using
152 @samp{@var{note}-@var{digit}}:
153
154 @lilypond[verbatim,quote,relative=2]
155 c4-1 d-2 f-4 e-3
156 @end lilypond
157
158 Markup texts may be used for finger changes.
159
160 @lilypond[verbatim,quote,relative=2]
161 c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
162 @end lilypond
163
164 @cindex thumb-script
165
166 @funindex \thumb
167 @funindex thumb
168
169 A thumb-script can be added (e.g. cello music) to indicate
170 that a note should be played with the thumb.
171
172 @lilypond[verbatim,quote,relative=2]
173 <a_\thumb a'-3>2 <b_\thumb b'-3>
174 @end lilypond
175
176 @cindex fingering chords
177 @cindex fingering instructions for chords
178 @cindex chords, fingering
179
180 Fingerings for chords can also be added to individual notes by
181 adding them after the pitches.
182
183 @lilypond[verbatim,quote,relative=2]
184 <c-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
185 @end lilypond
186
187 Fingering instructions may be manually placed above or below the
188 staff, see @ref{Direction and placement}.
189
190 @snippets
191
192 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
193 {controlling-the-placement-of-chord-fingerings.ly}
194
195 @lilypondfile[verbatim,quote,texidoc,doctitle]
196 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
197
198 @lilypondfile[verbatim,quote,texidoc,doctitle]
199 {avoiding-collisions-with-chord-fingerings.ly}
200
201
202 @seealso
203 Notation Reference:
204 @ref{Direction and placement}.
205
206 Snippets:
207 @rlsr{Editorial annotations}.
208
209 Internals Reference:
210 @rinternals{FingeringEvent},
211 @rinternals{fingering-event},
212 @rinternals{Fingering_engraver},
213 @rinternals{New_fingering_engraver},
214 @rinternals{Fingering}.
215
216 @knownissues
217 By default, numbers greater than 9 are not supported using
218 @samp{@var{note}-@var{digit}}.
219
220
221 @node Hidden notes
222 @unnumberedsubsubsec Hidden notes
223
224 @cindex hidden notes
225 @cindex invisible notes
226 @cindex transparent notes
227 @cindex notes, hidden
228 @cindex notes, invisible
229 @cindex notes, transparent
230
231 @funindex \hideNotes
232 @funindex hideNotes
233 @funindex \unHideNotes
234 @funindex unHideNotes
235
236 Hidden (or invisible or transparent) notes can be useful in
237 preparing theory or composition exercises.
238
239 @lilypond[verbatim,quote,relative=2]
240 c4 d
241 \hideNotes
242 e4 f
243 \unHideNotes
244 g a
245 \hideNotes
246 b
247 \unHideNotes
248 c
249 @end lilypond
250
251 Notation objects which are attached to invisible notes are still
252 visible.
253
254 @lilypond[verbatim,quote,relative=2]
255 c4( d)
256 \hideNotes
257 e4(\p f)--
258 @end lilypond
259
260
261 @predefined
262 @code{\hideNotes},
263 @code{\unHideNotes}.
264 @endpredefined
265
266
267 @seealso
268 Learning Manual:
269 @rlearning{Visibility and color of objects}.
270
271 Notation Reference:
272 @ref{Invisible rests},
273 @ref{Visibility of objects},
274 @ref{Hiding staves}.
275
276 Snippets:
277 @rlsr{Editorial annotations}.
278
279 Internals Reference:
280 @rinternals{Note_spacing_engraver},
281 @rinternals{NoteSpacing}.
282
283
284 @node Coloring objects
285 @unnumberedsubsubsec Coloring objects
286
287 @cindex colored objects
288 @cindex objects, colored
289 @cindex colors
290 @cindex coloring objects
291 @cindex colored notes
292 @cindex coloring notes
293 @cindex notes, colored
294 @cindex x11 color
295 @cindex x11-color
296 @cindex with-color
297
298 @funindex color
299 @funindex \with-color
300 @funindex with-color
301 @funindex x11-color
302
303 Individual objects may be assigned colors.  Valid color names
304 are listed in the @ref{List of colors}.
305
306 @lilypond[verbatim,quote,relative=2]
307 \override NoteHead #'color = #red
308 c4 c
309 \override NoteHead #'color = #(x11-color 'LimeGreen)
310 d
311 \override Stem #'color = #blue
312 e
313 @end lilypond
314
315
316 The full range of colors defined for X11 can be accessed by using
317 the Scheme function @code{x11-color}.  The function takes one
318 argument; this can be a symbol in the form @code{'@var{FooBar}} or
319 a string in the form @code{"@var{FooBar}"}.  The first form is
320 quicker to write and is more efficient.  However, using the second
321 form it is possible to access X11 colors by the multi-word form of
322 its name.
323
324 If @code{x11-color} cannot make sense of the parameter then the
325 color returned defaults to black.
326
327 @lilypond[verbatim,quote,relative=2]
328 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
329 \set Staff.instrumentName = \markup {
330   \with-color #(x11-color 'navy) "Clarinet"
331 }
332
333 gis8 a
334 \override Beam #'color = #(x11-color "medium turquoise")
335 gis a
336 \override Accidental #'color = #(x11-color 'DarkRed)
337 gis a
338 \override NoteHead #'color = #(x11-color "LimeGreen")
339 gis a
340 % this is deliberate nonsense; note that the stems remain black
341 \override Stem #'color = #(x11-color 'Boggle)
342 b2 cis
343 @end lilypond
344
345 @cindex rgb-color
346 @cindex color, rgb
347 @cindex rgb color
348
349 @funindex rgb-color
350
351 Exact RGB colors can be specified using the Scheme function
352 @code{rgb-color}.
353
354 @lilypond[verbatim,quote,relative=2]
355 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
356 \set Staff.instrumentName = \markup {
357   \with-color #(x11-color 'navy) "Clarinet"
358 }
359
360 \override Stem #'color = #(rgb-color 0 0 0)
361 gis8 a
362 \override Stem #'color = #(rgb-color 1 1 1)
363 gis8 a
364 \override Stem #'color = #(rgb-color 0 0 0.5)
365 gis4 a
366 @end lilypond
367
368
369 @seealso
370 Notation Reference:
371 @ref{List of colors}, @ref{The
372 tweak command}.
373
374 Snippets:
375 @rlsr{Editorial annotations}.
376
377
378 @cindex x11 color
379 @cindex colored notes in chords
380 @cindex notes, colored in chords
381 @cindex color in chords
382
383 @funindex x11-color
384
385 @knownissues
386 An X11 color is not necessarily exactly the same shade as a
387 similarly named normal color.
388
389 Not all X11 colors are distinguishable in a web browser, i.e.,
390 a web browser might not display a difference between @code{LimeGreen}
391 and @code{ForestGreen}.  For web use normal colors are recommended
392 (i.e., @code{blue}, @code{green}, @code{red}).
393
394
395 Notes in a chord cannot be colored with @code{\override}; use
396 @code{\tweak} instead, see @ref{The tweak command}.
397
398
399 @node Parentheses
400 @unnumberedsubsubsec Parentheses
401
402 @cindex ghost notes
403 @cindex notes, ghost
404 @cindex notes, parenthesized
405 @cindex parentheses
406
407 @funindex \parenthesize
408 @funindex parenthesize
409
410 Objects may be parenthesized by prefixing @code{\parenthesize} to
411 the music event.  When prefixed to a chord, it parenthesizes every
412 note.  Individual notes inside a chord may also be parenthesized.
413
414 @lilypond[verbatim,quote,relative=2]
415 c2 \parenthesize d
416 c2 \parenthesize <c e g>
417 c2 <c \parenthesize e g>
418 @end lilypond
419
420 Non-note objects may be parenthesized as well.  For articulations,
421 a hyphen is needed before the @code{\parenthesize} command.
422
423 @lilypond[verbatim,quote,relative=2]
424 c2-\parenthesize -. d
425 c2 \parenthesize r
426 @end lilypond
427
428
429 @seealso
430 Snippets:
431 @rlsr{Editorial annotations}.
432
433 Internals Reference:
434 @rinternals{Parenthesis_engraver},
435 @rinternals{ParenthesesItem},
436 @rinternals{parentheses-interface}.
437
438
439 @knownissues
440
441 Parenthesizing a chord prints parentheses around each individual
442 note, instead of a single large parenthesis around the entire
443 chord.
444
445
446 @node Stems
447 @unnumberedsubsubsec Stems
448
449 @cindex stem
450 @cindex stem, invisible
451 @cindex invisible stem
452
453 @funindex \stemUp
454 @funindex stemUp
455 @funindex \stemDown
456 @funindex stemDown
457 @funindex \stemNeutral
458 @funindex stemNeutral
459 @cindex stem, direction
460 @cindex stem, up
461 @cindex stem, down
462 @cindex stem, neutral
463
464 Whenever a note is found, a @code{Stem} object is created
465 automatically.  For whole notes and rests, they are also created but
466 made invisible.
467
468 Stems may be manually placed to point up or down; see
469 @ref{Direction and placement}.
470
471
472 @predefined
473 @code{\stemUp},
474 @code{\stemDown},
475 @code{\stemNeutral}.
476 @endpredefined
477
478
479 @snippets
480
481 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
482 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
483
484
485 @seealso
486 Notation Reference:
487 @ref{Direction and placement}.
488
489 Snippets:
490 @rlsr{Editorial annotations}.
491
492 Internals Reference:
493 @rinternals{Stem_engraver},
494 @rinternals{Stem},
495 @rinternals{stem-interface}.
496
497
498 @node Outside the staff
499 @subsection Outside the staff
500
501 This section discusses how to add emphasis to elements in the staff
502 from outside of the staff.
503
504 @menu
505 * Balloon help::
506 * Grid lines::
507 * Analysis brackets::
508 @end menu
509
510 @node Balloon help
511 @unnumberedsubsubsec Balloon help
512
513 @cindex balloon
514 @cindex notation, explaining
515 @cindex balloon help
516 @cindex help, balloon
517
518 @funindex \balloonGrobText
519 @funindex \balloonText
520 @funindex Balloon_engraver
521 @funindex balloonGrobText
522 @funindex balloonText
523 @funindex \balloonLengthOn
524 @funindex balloonLengthOn
525 @funindex \balloonLengthOff
526 @funindex balloonLengthOff
527
528 Elements of notation can be marked and named with the help of a
529 square balloon.  The primary purpose of this feature is to explain
530 notation.
531
532 @lilypond[verbatim,quote,relative=2]
533 \new Voice \with { \consists "Balloon_engraver" }
534 {
535   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
536   a8
537   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
538   r
539   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
540 }
541 @end lilypond
542
543
544 There are two music functions, @code{balloonGrobText} and
545 @code{balloonText};  the former is used like
546 @w{@code{\once \override}} to attach text to any grob, and the
547 latter is used like @code{\tweak}, typically within chords, to
548 attach text to an individual note.
549
550 Balloon text normally influences note spacing, but this can be
551 altered:
552
553 @lilypond[verbatim,quote,relative=2]
554 \new Voice \with { \consists "Balloon_engraver" }
555 {
556   \balloonLengthOff
557   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
558   a8
559   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
560   r
561   \balloonLengthOn
562   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
563 }
564 @end lilypond
565
566
567 @predefined
568 @code{\balloonLengthOn},
569 @code{\balloonLengthOff}.
570 @endpredefined
571
572
573 @seealso
574 Snippets:
575 @rlsr{Editorial annotations}.
576
577 Internals Reference:
578 @rinternals{Balloon_engraver},
579 @rinternals{BalloonTextItem},
580 @rinternals{balloon-interface}.
581
582
583 @node Grid lines
584 @unnumberedsubsubsec Grid lines
585
586 @cindex grid lines
587 @cindex lines, grid
588 @cindex vertical lines between staves
589 @cindex lines, vertical between staves
590
591 @funindex Grid_point_engraver
592 @funindex Grid_line_span_engraver
593 @funindex gridInterval
594
595 Vertical lines can be drawn between staves synchronized with the
596 notes.
597
598 The @code{Grid_point_engraver} must be used to create the end
599 points of the lines, while the @code{Grid_line_span_engraver} must
600 be used to actually draw the lines.  By default this centers grid
601 lines horizontally below and to the left side of each note head.
602 Grid lines extend from the middle lines of each staff.  The
603 @code{gridInterval} must specify the duration between the grid
604 lines.
605
606 @lilypond[verbatim,quote]
607 \layout {
608   \context {
609     \Staff
610     \consists "Grid_point_engraver"
611     gridInterval = #(ly:make-moment 1 4)
612   }
613   \context {
614     \Score
615     \consists "Grid_line_span_engraver"
616   }
617 }
618
619 \score {
620   \new ChoirStaff <<
621     \new Staff \relative c'' {
622       \stemUp
623       c4. d8 e8 f g4
624     }
625     \new Staff \relative c {
626       \clef bass
627       \stemDown
628       c4 g' f e
629     }
630   >>
631 }
632 @end lilypond
633
634 @snippets
635
636 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
637 {grid-lines--changing-their-appearance.ly}
638
639
640 @seealso
641 Snippets:
642 @rlsr{Editorial annotations}.
643
644 Internals Reference:
645 @rinternals{Grid_line_span_engraver},
646 @rinternals{Grid_point_engraver},
647 @rinternals{GridLine},
648 @rinternals{GridPoint},
649 @rinternals{grid-line-interface},
650 @rinternals{grid-point-interface}.
651
652
653 @node Analysis brackets
654 @unnumberedsubsubsec Analysis brackets
655
656 @cindex brackets
657 @cindex bracket, phrasing
658 @cindex phrasing bracket
659 @cindex musicological analysis
660 @cindex analysis, musicological
661 @cindex note grouping bracket
662 @cindex horizontal bracket
663 @cindex bracket, horizontal
664
665 @funindex Horizontal_bracket_engraver
666 @funindex \startGroup
667 @funindex startGroup
668 @funindex \stopGroup
669 @funindex stopGroup
670
671 Brackets are used in musical analysis to indicate structure in musical
672 pieces.  Simple horizontal brackets are supported.
673
674 @lilypond[verbatim,quote]
675 \layout {
676   \context {
677     \Voice
678     \consists "Horizontal_bracket_engraver"
679   }
680 }
681 \relative c'' {
682   c2\startGroup
683   d\stopGroup
684 }
685 @end lilypond
686
687 Analysis brackets may be nested.
688
689 @lilypond[verbatim,quote]
690 \layout {
691   \context {
692     \Voice
693     \consists "Horizontal_bracket_engraver"
694   }
695 }
696 \relative c'' {
697   c4\startGroup\startGroup
698   d4\stopGroup
699   e4\startGroup
700   d4\stopGroup\stopGroup
701 }
702 @end lilypond
703
704
705 @seealso
706 Snippets:
707 @rlsr{Editorial annotations}.
708
709 Internals Reference:
710 @rinternals{Horizontal_bracket_engraver},
711 @rinternals{HorizontalBracket},
712 @rinternals{horizontal-bracket-interface},
713 @rinternals{Staff}.
714