]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
eec43dd741bcd24dada7446df197e6d452cecd9b
[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. For articulations, 
407 a hyphen is needed before the @code{\parenthesize} command.
408
409 @lilypond[verbatim,quote,relative=2]
410 c2-\parenthesize -. d
411 c2 \parenthesize r
412 @end lilypond
413
414
415 @seealso
416 Snippets:
417 @rlsr{Editorial annotations}.
418
419 Internals Reference:
420 @rinternals{Parenthesis_engraver},
421 @rinternals{ParenthesesItem},
422 @rinternals{parentheses-interface}.
423
424
425 @knownissues
426
427 Parenthesizing a chord prints parentheses around each individual
428 note, instead of a single large parenthesis around the entire
429 chord.
430
431
432 @node Stems
433 @unnumberedsubsubsec Stems
434
435 @cindex stem
436 @cindex stem, invisible
437 @cindex invisible stem
438
439 @funindex \stemUp
440 @funindex stemUp
441 @funindex \stemDown
442 @funindex stemDown
443 @funindex \stemNeutral
444 @funindex stemNeutral
445 @cindex stem, direction
446 @cindex stem, up
447 @cindex stem, down
448 @cindex stem, neutral
449
450 Whenever a note is found, a @code{Stem} object is created
451 automatically.  For whole notes and rests, they are also created but
452 made invisible.
453
454 Stems may be manually placed to point up or down; see
455 @ref{Direction and placement}.
456
457
458 @predefined
459 @code{\stemUp},
460 @code{\stemDown},
461 @code{\stemNeutral}.
462 @endpredefined
463
464
465 @snippets
466
467 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
468 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
469
470
471 @seealso
472 Notation Reference:
473 @ref{Direction and placement}.
474
475 Snippets:
476 @rlsr{Editorial annotations}.
477
478 Internals Reference:
479 @rinternals{Stem_engraver},
480 @rinternals{Stem},
481 @rinternals{stem-interface}.
482
483
484 @node Outside the staff
485 @subsection Outside the staff
486
487 This section discusses how to add emphasis to elements in the staff
488 from outside of the staff.
489
490 @menu
491 * Balloon help::
492 * Grid lines::
493 * Analysis brackets::
494 @end menu
495
496 @node Balloon help
497 @unnumberedsubsubsec Balloon help
498
499 @cindex balloon
500 @cindex notation, explaining
501 @cindex balloon help
502 @cindex help, balloon
503
504 @funindex \balloonGrobText
505 @funindex \balloonText
506 @funindex Balloon_engraver
507 @funindex balloonGrobText
508 @funindex balloonText
509 @funindex \balloonLengthOn
510 @funindex balloonLengthOn
511 @funindex \balloonLengthOff
512 @funindex balloonLengthOff
513
514 Elements of notation can be marked and named with the help of a
515 square balloon.  The primary purpose of this feature is to explain
516 notation.
517
518 @lilypond[verbatim,quote,relative=2]
519 \new Voice \with { \consists "Balloon_engraver" }
520 {
521   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
522   a8
523   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
524   r
525   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
526 }
527 @end lilypond
528
529
530 There are two music functions, @code{balloonGrobText} and
531 @code{balloonText};  the former is used like
532 @w{@code{\once \override}} to attach text to any grob, and the
533 latter is used like @code{\tweak}, typically within chords, to
534 attach text to an individual note.
535
536 Balloon text normally influences note spacing, but this can be
537 altered:
538
539 @lilypond[verbatim,quote,relative=2]
540 \new Voice \with { \consists "Balloon_engraver" }
541 {
542   \balloonLengthOff
543   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
544   a8
545   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
546   r
547   \balloonLengthOn
548   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
549 }
550 @end lilypond
551
552
553 @predefined
554 @code{\balloonLengthOn},
555 @code{\balloonLengthOff}.
556 @endpredefined
557
558
559 @seealso
560 Snippets:
561 @rlsr{Editorial annotations}.
562
563 Internals Reference:
564 @rinternals{Balloon_engraver},
565 @rinternals{BalloonTextItem},
566 @rinternals{balloon-interface}.
567
568
569 @node Grid lines
570 @unnumberedsubsubsec Grid lines
571
572 @cindex grid lines
573 @cindex lines, grid
574 @cindex vertical lines between staves
575 @cindex lines, vertical between staves
576
577 @funindex Grid_point_engraver
578 @funindex Grid_line_span_engraver
579 @funindex gridInterval
580
581 Vertical lines can be drawn between staves synchronized with the
582 notes.
583
584 The @code{Grid_point_engraver} must be used to create the end
585 points of the lines, while the @code{Grid_line_span_engraver} must
586 be used to actually draw the lines.  By default this centers grid
587 lines horizontally below and to the left side of each note head.
588 Grid lines extend from the middle lines of each staff.  The
589 @code{gridInterval} must specify the duration between the grid
590 lines.
591
592 @lilypond[verbatim,quote]
593 \layout {
594   \context {
595     \Staff
596     \consists "Grid_point_engraver"
597     gridInterval = #(ly:make-moment 1 4)
598   }
599   \context {
600     \Score
601     \consists "Grid_line_span_engraver"
602   }
603 }
604
605 \score {
606   \new ChoirStaff <<
607     \new Staff \relative c'' {
608       \stemUp
609       c4. d8 e8 f g4
610     }
611     \new Staff \relative c {
612       \clef bass
613       \stemDown
614       c4 g' f e
615     }
616   >>
617 }
618 @end lilypond
619
620 @snippets
621
622 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
623 {grid-lines--changing-their-appearance.ly}
624
625
626 @seealso
627 Snippets:
628 @rlsr{Editorial annotations}.
629
630 Internals Reference:
631 @rinternals{Grid_line_span_engraver},
632 @rinternals{Grid_point_engraver},
633 @rinternals{GridLine},
634 @rinternals{GridPoint},
635 @rinternals{grid-line-interface},
636 @rinternals{grid-point-interface}.
637
638
639 @node Analysis brackets
640 @unnumberedsubsubsec Analysis brackets
641
642 @cindex brackets
643 @cindex bracket, phrasing
644 @cindex phrasing bracket
645 @cindex musicological analysis
646 @cindex analysis, musicological
647 @cindex note grouping bracket
648 @cindex horizontal bracket
649 @cindex bracket, horizontal
650
651 @funindex Horizontal_bracket_engraver
652 @funindex \startGroup
653 @funindex startGroup
654 @funindex \stopGroup
655 @funindex stopGroup
656
657 Brackets are used in musical analysis to indicate structure in musical
658 pieces.  Simple horizontal brackets are supported.
659
660 @lilypond[verbatim,quote]
661 \layout {
662   \context {
663     \Voice
664     \consists "Horizontal_bracket_engraver"
665   }
666 }
667 \relative c'' {
668   c2\startGroup
669   d\stopGroup
670 }
671 @end lilypond
672
673 Analysis brackets may be nested.
674
675 @lilypond[verbatim,quote]
676 \layout {
677   \context {
678     \Voice
679     \consists "Horizontal_bracket_engraver"
680   }
681 }
682 \relative c'' {
683   c4\startGroup\startGroup
684   d4\stopGroup
685   e4\startGroup
686   d4\stopGroup\stopGroup
687 }
688 @end lilypond
689
690
691 @seealso
692 Snippets:
693 @rlsr{Editorial annotations}.
694
695 Internals Reference:
696 @rinternals{Horizontal_bracket_engraver},
697 @rinternals{HorizontalBracket},
698 @rinternals{horizontal-bracket-interface},
699 @rinternals{Staff}.
700