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