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