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