]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/editorial.itely
Doc: NR 1: Use @code{@var{...}} for variables.
[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.12.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., in 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 of the
181 chord by 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,lilyquote,ragged-right,texidoc,doctitle]
193 {controlling-the-placement-of-chord-fingerings.ly}
194
195 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
196 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
197
198 @lilypondfile[verbatim,lilyquote,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
217 @node Hidden notes
218 @unnumberedsubsubsec Hidden notes
219
220 @cindex hidden notes
221 @cindex invisible notes
222 @cindex transparent notes
223 @cindex notes, hidden
224 @cindex notes, invisible
225 @cindex notes, transparent
226
227 @funindex \hideNotes
228 @funindex hideNotes
229 @funindex \unHideNotes
230 @funindex unHideNotes
231
232 Hidden (or invisible or transparent) notes can be useful in
233 preparing theory or composition exercises.
234
235 @lilypond[verbatim,quote,relative=2]
236 c4 d
237 \hideNotes
238 e4 f
239 \unHideNotes
240 g a
241 \hideNotes
242 b
243 \unHideNotes
244 c
245 @end lilypond
246
247 Notation objects which are attached to invisible notes are still
248 visible.
249
250 @lilypond[verbatim,quote,relative=2]
251 c4( d)
252 \hideNotes
253 e4(\p f)--
254 @end lilypond
255
256
257 @predefined
258 @code{\hideNotes},
259 @code{\unHideNotes}.
260 @endpredefined
261
262
263 @seealso
264 Learning Manual:
265 @rlearning{Visibility and color of objects}.
266
267 Notation Reference:
268 @ref{Invisible rests},
269 @ref{Visibility of objects},
270 @ref{Hiding staves}.
271
272 Snippets:
273 @rlsr{Editorial annotations}.
274
275 Internals Reference:
276 @rinternals{Note_spacing_engraver},
277 @rinternals{NoteSpacing}.
278
279
280 @node Coloring objects
281 @unnumberedsubsubsec Coloring objects
282
283 @cindex colored objects
284 @cindex objects, colored
285 @cindex colors
286 @cindex coloring objects
287 @cindex colored notes
288 @cindex coloring notes
289 @cindex notes, colored
290 @cindex x11 color
291 @cindex x11-color
292 @cindex with-color
293
294 @funindex color
295 @funindex \with-color
296 @funindex with-color
297 @funindex x11-color
298
299 Individual objects may be assigned colors.  Valid color names
300 are listed in the @ref{List of colors}.
301
302 @lilypond[verbatim,quote,relative=2]
303 \override NoteHead #'color = #red
304 c4 c
305 \override NoteHead #'color = #(x11-color 'LimeGreen)
306 d
307 \override Stem #'color = #blue
308 e
309 @end lilypond
310
311
312 The full range of colors defined for X11 can be accessed by using
313 the Scheme function @code{x11-color}.  The function takes one
314 argument; this can be a symbol in the form @code{'@var{FooBar}} or
315 a string in the form @code{"@var{FooBar}"}.  The first form is
316 quicker to write and is more efficient.  However, using the second
317 form it is possible to access X11 colors by the multi-word form of
318 its name.
319
320 If @code{x11-color} cannot make sense of the parameter then the
321 color returned defaults to black.
322
323 @lilypond[verbatim,quote,relative=2]
324 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
325 \set Staff.instrumentName = \markup {
326   \with-color #(x11-color 'navy) "Clarinet"
327 }
328
329 gis8 a
330 \override Beam #'color = #(x11-color "medium turquoise")
331 gis a
332 \override Accidental #'color = #(x11-color 'DarkRed)
333 gis a
334 \override NoteHead #'color = #(x11-color "LimeGreen")
335 gis a
336 % this is deliberate nonsense; note that the stems remain black
337 \override Stem #'color = #(x11-color 'Boggle)
338 b2 cis
339 @end lilypond
340
341 @cindex rgb-color
342 @cindex color, rgb
343 @cindex rgb color
344
345 @funindex rgb-color
346
347 Exact RGB colors can be specified using the Scheme function
348 @code{rgb-color}.
349
350 @lilypond[verbatim,quote,relative=2]
351 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
352 \set Staff.instrumentName = \markup {
353   \with-color #(x11-color 'navy) "Clarinet"
354 }
355
356 \override Stem #'color = #(rgb-color 0 0 0)
357 gis8 a
358 \override Stem #'color = #(rgb-color 1 1 1)
359 gis8 a
360 \override Stem #'color = #(rgb-color 0 0 0.5)
361 gis4 a
362 @end lilypond
363
364
365 @seealso
366 Notation Reference:
367 @ref{List of colors}, @ref{The
368 tweak command}.
369
370 Snippets:
371 @rlsr{Editorial annotations}.
372
373
374 @cindex x11 color
375 @cindex colored notes in chords
376 @cindex notes, colored in chords
377 @cindex color in chords
378
379 @funindex x11-color
380
381 @knownissues
382 An X11 color is not necessarily exactly the same shade as a
383 similarly named normal color.
384
385 Not all X11 colors are distinguishable in a web browser, i.e.,
386 a web browser might not display a difference between @code{'LimeGreen}
387 and @code{'ForestGreen}.  For web use normal colors are recommended
388 (i.e., @code{#blue}, @code{#green}, @code{#red}).
389
390
391 Notes in a chord cannot be colored with @code{\override}; use
392 @code{\tweak} instead, see @ref{The tweak command}.
393
394
395 @node Parentheses
396 @unnumberedsubsubsec Parentheses
397
398 @cindex ghost notes
399 @cindex notes, ghost
400 @cindex notes, parenthesized
401 @cindex parentheses
402
403 @funindex \parenthesize
404 @funindex parenthesize
405
406 Objects may be parenthesized by prefixing @code{\parenthesize} to
407 the music event.  When prefixed to a chord, it parenthesizes every
408 note.  Individual notes inside a chord may also be parenthesized.
409
410 @lilypond[verbatim,quote,relative=2]
411 c2 \parenthesize d
412 c2 \parenthesize <c e g>
413 c2 <c \parenthesize e g>
414 @end lilypond
415
416 Non-note objects may be parenthesized as well.  For articulations,
417 a hyphen is needed before the @code{\parenthesize} command.
418
419 @lilypond[verbatim,quote,relative=2]
420 c2-\parenthesize -. d
421 c2 \parenthesize r
422 @end lilypond
423
424
425 @seealso
426 Snippets:
427 @rlsr{Editorial annotations}.
428
429 Internals Reference:
430 @rinternals{Parenthesis_engraver},
431 @rinternals{ParenthesesItem},
432 @rinternals{parentheses-interface}.
433
434
435 @knownissues
436
437 Parenthesizing a chord prints parentheses around each individual
438 note, instead of a single large parenthesis around the entire
439 chord.
440
441
442 @node Stems
443 @unnumberedsubsubsec Stems
444
445 @cindex stem
446 @cindex stem, invisible
447 @cindex invisible stem
448
449 @funindex \stemUp
450 @funindex stemUp
451 @funindex \stemDown
452 @funindex stemDown
453 @funindex \stemNeutral
454 @funindex stemNeutral
455 @cindex stem, direction
456 @cindex stem, up
457 @cindex stem, down
458 @cindex stem, neutral
459
460 Whenever a note is found, a @code{Stem} object is created
461 automatically.  For whole notes and rests, they are also created but
462 made invisible.
463
464 Stems may be manually placed to point up or down; see
465 @ref{Direction and placement}.
466
467
468 @predefined
469 @code{\stemUp},
470 @code{\stemDown},
471 @code{\stemNeutral}.
472 @endpredefined
473
474
475 @snippets
476
477 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
478 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
479
480
481 @seealso
482 Notation Reference:
483 @ref{Direction and placement}.
484
485 Snippets:
486 @rlsr{Editorial annotations}.
487
488 Internals Reference:
489 @rinternals{Stem_engraver},
490 @rinternals{Stem},
491 @rinternals{stem-interface}.
492
493
494 @node Outside the staff
495 @subsection Outside the staff
496
497 This section discusses how to add emphasis to elements in the staff
498 from outside of the staff.
499
500 @menu
501 * Balloon help::
502 * Grid lines::
503 * Analysis brackets::
504 @end menu
505
506 @node Balloon help
507 @unnumberedsubsubsec Balloon help
508
509 @cindex balloon
510 @cindex notation, explaining
511 @cindex balloon help
512 @cindex help, balloon
513
514 @funindex \balloonGrobText
515 @funindex \balloonText
516 @funindex Balloon_engraver
517 @funindex balloonGrobText
518 @funindex balloonText
519 @funindex \balloonLengthOn
520 @funindex balloonLengthOn
521 @funindex \balloonLengthOff
522 @funindex balloonLengthOff
523
524 Elements of notation can be marked and named with the help of a
525 square balloon.  The primary purpose of this feature is to explain
526 notation.
527
528 @lilypond[verbatim,quote,relative=2]
529 \new Voice \with { \consists "Balloon_engraver" }
530 {
531   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
532   a8
533   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
534   r
535   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
536 }
537 @end lilypond
538
539
540 There are two music functions, @code{balloonGrobText} and
541 @code{balloonText};  the former is used like
542 @w{@code{\once \override}} to attach text to any grob, and the
543 latter is used like @code{\tweak}, typically within chords, to
544 attach text to an individual note.
545
546 Balloon text normally influences note spacing, but this can be
547 altered:
548
549 @lilypond[verbatim,quote,relative=2]
550 \new Voice \with { \consists "Balloon_engraver" }
551 {
552   \balloonLengthOff
553   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
554   a8
555   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
556   r
557   \balloonLengthOn
558   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
559 }
560 @end lilypond
561
562
563 @predefined
564 @code{\balloonLengthOn},
565 @code{\balloonLengthOff}.
566 @endpredefined
567
568
569 @seealso
570 Snippets:
571 @rlsr{Editorial annotations}.
572
573 Internals Reference:
574 @rinternals{Balloon_engraver},
575 @rinternals{BalloonTextItem},
576 @rinternals{balloon-interface}.
577
578
579 @node Grid lines
580 @unnumberedsubsubsec Grid lines
581
582 @cindex grid lines
583 @cindex lines, grid
584 @cindex vertical lines between staves
585 @cindex lines, vertical between staves
586
587 @funindex Grid_point_engraver
588 @funindex Grid_line_span_engraver
589 @funindex gridInterval
590
591 Vertical lines can be drawn between staves synchronized with the
592 notes.
593
594 The @code{Grid_point_engraver} must be used to create the end
595 points of the lines, while the @code{Grid_line_span_engraver} must
596 be used to actually draw the lines.  By default this centers grid
597 lines horizontally below and to the left side of each note head.
598 Grid lines extend from the middle lines of each staff.  The
599 @code{gridInterval} must specify the duration between the grid
600 lines.
601
602 @lilypond[verbatim,quote]
603 \layout {
604   \context {
605     \Staff
606     \consists "Grid_point_engraver"
607     gridInterval = #(ly:make-moment 1 4)
608   }
609   \context {
610     \Score
611     \consists "Grid_line_span_engraver"
612   }
613 }
614
615 \score {
616   \new ChoirStaff <<
617     \new Staff \relative c'' {
618       \stemUp
619       c4. d8 e8 f g4
620     }
621     \new Staff \relative c {
622       \clef bass
623       \stemDown
624       c4 g' f e
625     }
626   >>
627 }
628 @end lilypond
629
630 @snippets
631
632 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
633 {grid-lines--changing-their-appearance.ly}
634
635
636 @seealso
637 Snippets:
638 @rlsr{Editorial annotations}.
639
640 Internals Reference:
641 @rinternals{Grid_line_span_engraver},
642 @rinternals{Grid_point_engraver},
643 @rinternals{GridLine},
644 @rinternals{GridPoint},
645 @rinternals{grid-line-interface},
646 @rinternals{grid-point-interface}.
647
648
649 @node Analysis brackets
650 @unnumberedsubsubsec Analysis brackets
651
652 @cindex brackets
653 @cindex bracket, phrasing
654 @cindex phrasing bracket
655 @cindex musicological analysis
656 @cindex analysis, musicological
657 @cindex note grouping bracket
658 @cindex horizontal bracket
659 @cindex bracket, horizontal
660
661 @funindex Horizontal_bracket_engraver
662 @funindex \startGroup
663 @funindex startGroup
664 @funindex \stopGroup
665 @funindex stopGroup
666
667 Brackets are used in musical analysis to indicate structure in musical
668 pieces.  Simple horizontal brackets are supported.
669
670 @lilypond[verbatim,quote]
671 \layout {
672   \context {
673     \Voice
674     \consists "Horizontal_bracket_engraver"
675   }
676 }
677 \relative c'' {
678   c2\startGroup
679   d\stopGroup
680 }
681 @end lilypond
682
683 Analysis brackets may be nested.
684
685 @lilypond[verbatim,quote]
686 \layout {
687   \context {
688     \Voice
689     \consists "Horizontal_bracket_engraver"
690   }
691 }
692 \relative c'' {
693   c4\startGroup\startGroup
694   d4\stopGroup
695   e4\startGroup
696   d4\stopGroup\stopGroup
697 }
698 @end lilypond
699
700
701 @seealso
702 Snippets:
703 @rlsr{Editorial annotations}.
704
705 Internals Reference:
706 @rinternals{Horizontal_bracket_engraver},
707 @rinternals{HorizontalBracket},
708 @rinternals{horizontal-bracket-interface},
709 @rinternals{Staff}.
710