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