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