]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
c8d021a84a545a7d2d0689ba838de5f982c9f80e
[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 Snippets:
139 @rlsr{Editorial annotations}.
140
141 Internals Reference:
142 @rinternals{font-interface}.
143
144
145 @node Fingering instructions
146 @unnumberedsubsubsec Fingering instructions
147
148 @cindex fingering
149 @cindex finger change
150 @funindex \finger
151 @funindex finger
152
153 Fingering instructions can be entered using
154 @var{note}-@var{digit}:
155
156 @lilypond[verbatim,quote,relative=2]
157 c4-1 d-2 f-4 e-3
158 @end lilypond
159
160 Markup texts may be used for finger changes.
161
162 @lilypond[verbatim,quote,relative=2]
163 c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
164 @end lilypond
165
166 @cindex thumb-script
167 @funindex \thumb
168 @funindex thumb
169
170 A thumb-script can be added (e.g., in cello music) to indicate
171 that a note should be played with the thumb.
172
173 @lilypond[verbatim,quote,relative=2]
174 <a_\thumb a'-3>2 <b_\thumb b'-3>
175 @end lilypond
176
177 @cindex fingering chords
178 @cindex fingering instructions for chords
179 @cindex chords, fingering
180
181 Fingerings for chords can also be added to individual notes of the
182 chord by adding them after the pitches.
183
184 @lilypond[verbatim,quote,relative=2]
185 <c-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
186 @end lilypond
187
188 Fingering instructions may be manually placed above or below the
189 staff, see @ref{Direction and placement}.
190
191 @snippets
192
193 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
194 {controlling-the-placement-of-chord-fingerings.ly}
195
196 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
197 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
198
199 @lilypondfile[verbatim,lilyquote,texidoc,doctitle]
200 {avoiding-collisions-of-chord-fingering-with-beams.ly}
201
202
203 @seealso
204 Notation Reference:
205 @ref{Direction and placement}
206
207 Snippets:
208 @rlsr{Editorial annotations}.
209
210 Internals Reference:
211 @rinternals{FingeringEvent},
212 @rinternals{fingering-event},
213 @rinternals{Fingering_engraver},
214 @rinternals{New_fingering_engraver},
215 @rinternals{Fingering}.
216
217
218 @node Hidden notes
219 @unnumberedsubsubsec Hidden notes
220
221 @cindex hidden notes
222 @cindex invisible notes
223 @cindex transparent notes
224 @cindex notes, hidden
225 @cindex notes, invisible
226 @cindex notes, transparent
227 @funindex \hideNotes
228 @funindex hideNotes
229 @funindex \unHideNotes
230 @funindex unHideNotes
231
232 Hidden (or invisible or transparent) notes can be useful in
233 preparing theory or composition exercises.
234
235 @lilypond[verbatim,quote,relative=2]
236 c4 d
237 \hideNotes
238 e4 f
239 \unHideNotes
240 g a
241 \hideNotes
242 b
243 \unHideNotes
244 c
245 @end lilypond
246
247 Notation objects which are attached to invisible notes are still
248 visible.
249
250 @lilypond[verbatim,quote,relative=2]
251 c4( d)
252 \hideNotes
253 e4(\p f)--
254 @end lilypond
255
256
257 @predefined
258 @code{\hideNotes},
259 @code{\unHideNotes}.
260 @endpredefined
261
262
263 @seealso
264 Snippets:
265 @rlsr{Editorial annotations}.
266
267 Internals Reference:
268 @rinternals{Note_spacing_engraver},
269 @rinternals{NoteSpacing}.
270
271
272 @node Coloring objects
273 @unnumberedsubsubsec Coloring objects
274
275 @cindex colored objects
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 @funindex color
285 @funindex \with-color
286 @funindex with-color
287 @funindex x11-color
288
289 Individual objects may be assigned colors.  Valid color names
290 are listed in the @ref{List of colors}.
291
292 @lilypond[verbatim,quote,relative=2]
293 \override NoteHead #'color = #red
294 c4 c
295 \override NoteHead #'color = #(x11-color 'LimeGreen)
296 d
297 \override Stem #'color = #blue
298 e
299 @end lilypond
300
301
302 The full range of colors defined for X11 can be accessed by using
303 the Scheme function @code{x11-color}.  The function takes one
304 argument; this can be a symbol in the form @var{'FooBar} or a
305 string in the form @var{"FooBar"}.  The first form is quicker to
306 write and is more efficient.  However, using the second form it is
307 possible to access X11 colors by the multi-word form of its name.
308
309 If @code{x11-color} cannot make sense of the parameter then the
310 color returned defaults to black.
311
312 @lilypond[verbatim,quote,relative=2]
313 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
314 \set Staff.instrumentName = \markup {
315   \with-color #(x11-color 'navy) "Clarinet"
316 }
317
318 gis8 a
319 \override Beam #'color = #(x11-color "medium turquoise")
320 gis a
321 \override Accidental #'color = #(x11-color 'DarkRed)
322 gis a
323 \override NoteHead #'color = #(x11-color "LimeGreen")
324 gis a
325 % this is deliberate nonsense; note that the stems remain black
326 \override Stem #'color = #(x11-color 'Boggle)
327 b2 cis
328 @end lilypond
329
330 @cindex rgb-color
331 @cindex color, rgb
332 @cindex rgb color
333 @funindex rgb-color
334
335 Exact RGB colors can be specified using the Scheme function
336 @code{rgb-color}.
337
338 @lilypond[verbatim,quote,relative=2]
339 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
340 \set Staff.instrumentName = \markup {
341   \with-color #(x11-color 'navy) "Clarinet"
342 }
343
344 \override Stem #'color = #(rgb-color 0 0 0)
345 gis8 a
346 \override Stem #'color = #(rgb-color 1 1 1)
347 gis8 a
348 \override Stem #'color = #(rgb-color 0 0 0.5)
349 gis4 a
350 @end lilypond
351
352
353 @seealso
354 Notation Reference:
355 @ref{List of colors}, @ref{The
356 tweak command}.
357
358 Snippets:
359 @rlsr{Editorial annotations}.
360
361
362 @cindex x11 color
363 @cindex colored notes in chords
364 @cindex notes, colored in chords
365 @cindex color in chords
366 @funindex x11-color
367
368 @knownissues
369 An X11 color is not necessarily exactly the same shade as a
370 similarly named normal color.
371
372 Not all X11 colors are distinguishable in a web browser, i.e.,
373 a web browser might not display a difference between @code{'LimeGreen}
374 and @code{'ForestGreen}.  For web use normal colors are recommended
375 (i.e., @code{#blue}, @code{#green}, @code{#red}).
376
377
378 Notes in a chord cannot be colored with @code{\override}; use
379 @code{\tweak} instead, see @ref{The tweak command}.
380
381
382 @node Parentheses
383 @unnumberedsubsubsec Parentheses
384
385 @cindex ghost notes
386 @cindex notes, ghost
387 @cindex notes, parenthesized
388 @cindex parentheses
389 @funindex \parenthesize
390 @funindex parenthesize
391
392 Objects may be parenthesized by prefixing @code{\parenthesize} to
393 the music event.  When prefixed to a chord, it parenthesizes every
394 note.  Individual notes inside a chord may also be parenthesized.
395
396 @lilypond[verbatim,quote,relative=2]
397 c2 \parenthesize d
398 c2 \parenthesize <c e g>
399 c2 <c \parenthesize e g>
400 @end lilypond
401
402 Non-note objects may be parenthesized as well.
403
404 @lilypond[verbatim,quote,relative=2]
405 c2-\parenthesize -. d
406 c2 \parenthesize r
407 @end lilypond
408
409
410 @seealso
411 Snippets:
412 @rlsr{Editorial annotations}.
413
414 Internals Reference:
415 @rinternals{Parenthesis_engraver},
416 @rinternals{ParenthesesItem},
417 @rinternals{parentheses-interface}.
418
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
460 @seealso
461 Notation Reference:
462 @ref{Direction and placement}.
463
464 Snippets:
465 @rlsr{Editorial annotations}.
466
467 Internals Reference:
468 @rinternals{Stem_engraver},
469 @rinternals{Stem},
470 @rinternals{stem-interface}.
471
472
473 @node Outside the staff
474 @subsection Outside the staff
475
476 This section discusses how to add emphasis to elements in the staff
477 from outside of the staff.
478
479 @menu
480 * Balloon help::
481 * Grid lines::
482 * Analysis brackets::
483 @end menu
484
485 @node Balloon help
486 @unnumberedsubsubsec Balloon help
487
488 @cindex balloon
489 @cindex notation, explaining
490 @cindex balloon help
491 @cindex help, balloon
492 @funindex \balloonGrobText
493 @funindex \balloonText
494 @funindex Balloon_engraver
495 @funindex balloonGrobText
496 @funindex balloonText
497
498 Elements of notation can be marked and named with the help of a
499 square balloon.  The primary purpose of this feature is to explain
500 notation.
501
502 @lilypond[verbatim,quote,relative=2]
503 \new Voice \with { \consists "Balloon_engraver" }
504 {
505   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
506   a8
507   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
508   r
509   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
510 }
511 @end lilypond
512
513
514 There are two music functions, @code{balloonGrobText} and
515 @code{balloonText};  the former is used like
516 @w{@code{\once \override}} to attach text to any grob, and the
517 latter is used like @code{\tweak}, typically within chords, to
518 attach text to an individual note.
519
520 Balloon text normally influences note spacing, but this can be
521 altered:
522
523 @lilypond[verbatim,quote,relative=2]
524 \new Voice \with { \consists "Balloon_engraver" }
525 {
526   \balloonLengthOff
527   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
528   a8
529   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
530   r
531   \balloonLengthOn
532   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
533 }
534 @end lilypond
535
536
537 @predefined
538 @funindex balloonLengthOn
539 @funindex \balloonLengthOn
540 @code{\balloonLengthOn},
541 @funindex \balloonLengthOff
542 @funindex balloonLengthOff
543 @code{\balloonLengthOff}.
544 @endpredefined
545
546
547 @seealso
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 Snippets:
615 @rlsr{Editorial annotations}.
616
617 Internals Reference:
618 @rinternals{Grid_line_span_engraver},
619 @rinternals{Grid_point_engraver},
620 @rinternals{GridLine},
621 @rinternals{GridPoint},
622 @rinternals{grid-line-interface},
623 @rinternals{grid-point-interface}.
624
625
626 @node Analysis brackets
627 @unnumberedsubsubsec Analysis brackets
628
629 @cindex brackets
630 @cindex bracket, phrasing
631 @cindex phrasing bracket
632 @cindex musicological analysis
633 @cindex note grouping bracket
634 @cindex horizontal bracket
635 @cindex bracket, horizontal
636 @funindex Horizontal_bracket_engraver
637 @funindex \startGroup
638 @funindex startGroup
639 @funindex \stopGroup
640 @funindex stopGroup
641
642 Brackets are used in musical analysis to indicate structure in musical
643 pieces.  Simple horizontal brackets are supported.
644
645 @lilypond[verbatim,quote]
646 \layout {
647   \context {
648     \Voice
649     \consists "Horizontal_bracket_engraver"
650   }
651 }
652 \relative c'' {
653   c2\startGroup
654   d\stopGroup
655 }
656 @end lilypond
657
658 Analysis brackets may be nested.
659
660 @lilypond[verbatim,quote]
661 \layout {
662   \context {
663     \Voice
664     \consists "Horizontal_bracket_engraver"
665   }
666 }
667 \relative c'' {
668   c4\startGroup\startGroup
669   d4\stopGroup
670   e4\startGroup
671   d4\stopGroup\stopGroup
672 }
673 @end lilypond
674
675
676 @seealso
677 Snippets:
678 @rlsr{Editorial annotations}.
679
680 Internals Reference:
681 @rinternals{Horizontal_bracket_engraver},
682 @rinternals{HorizontalBracket},
683 @rinternals{horizontal-bracket-interface},
684 @rinternals{Staff}.
685