]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/notation/editorial.itely
Doc: mention how \hideNotes hides beams (part of 2169)
[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.  For details, see the Contributors'
7     Guide, node Updating translation committishes..
8 @end ignore
9
10 @c \version "2.14.0"
11
12 @node Editorial annotations
13 @section Editorial annotations
14
15 @lilypondfile[quote]{editorial-headword.ly}
16
17 This section discusses the various ways to change the appearance of
18 notes and add analysis or educational emphasis.
19
20 @menu
21 * Inside the staff::
22 * Outside the staff::
23 @end menu
24
25
26 @node Inside the staff
27 @subsection Inside the staff
28
29 This section discusses how to add emphasis to elements that are
30 inside the staff.
31
32 @menu
33 * Selecting notation font size::
34 * Fingering instructions::
35 * Hidden notes::
36 * Coloring objects::
37 * Parentheses::
38 * Stems::
39 @end menu
40
41 @node Selecting notation font size
42 @unnumberedsubsubsec Selecting notation font size
43
44 @cindex font size (notation) scaling
45 @cindex font size (notation)
46 @cindex selecting font size (notation)
47 @cindex notation font size
48 @cindex note heads
49
50 @funindex fontSize
51 @funindex font-size
52 @funindex magstep
53 @funindex \huge
54 @funindex \large
55 @funindex \normalsize
56 @funindex \small
57 @funindex \tiny
58 @funindex \teeny
59 @funindex huge
60 @funindex large
61 @funindex normalsize
62 @funindex small
63 @funindex tiny
64 @funindex teeny
65
66 The font size of notation elements may be altered.  It does not
67 change the size of variable symbols, such as beams or slurs.
68
69 @warning{For font sizes of text, see
70 @ref{Selecting font and font size}.}
71
72 @lilypond[verbatim,quote,relative=2]
73 \huge
74 c4.-> d8---3
75 \large
76 c4.-> d8---3
77 \normalsize
78 c4.-> d8---3
79 \small
80 c4.-> d8---3
81 \tiny
82 c4.-> d8---3
83 \teeny
84 c4.-> d8---3
85 @end lilypond
86
87 Internally, this sets the @code{fontSize} property.  This in turn
88 causes the @code{font-size} property to be set in all layout
89 objects.  The value of @code{font-size} is a number indicating the
90 size relative to the standard size for the current staff height.
91 Each step up is an increase of approximately 12% of the font size.
92 Six steps is exactly a factor of two.  The Scheme function
93 @code{magstep} converts a @code{font-size} number to a scaling
94 factor.  The @code{font-size} property can also be set directly,
95 so that only certain layout objects are affected.
96
97 @lilypond[verbatim,quote,relative=2]
98 \set fontSize = #3
99 c4.-> d8---3
100 \override NoteHead #'font-size = #-4
101 c4.-> d8---3
102 \override Script #'font-size = #2
103 c4.-> d8---3
104 \override Stem #'font-size = #-5
105 c4.-> d8---3
106 @end lilypond
107
108 @cindex standard font size (notation)
109 @cindex font size (notation), standard
110
111 @funindex font-interface
112 @funindex font-size
113
114 Font size changes are achieved by scaling the design size that is
115 closest to the desired size.  The standard font size (for
116 @w{@code{font-size = #0}}) depends on the standard staff height.
117 For a 20pt staff, a 10pt font is selected.
118
119 The @code{font-size} property can only be set on layout objects
120 that use fonts.  These are the ones supporting the
121 @code{font-interface} layout interface.
122
123
124 @predefined
125 @code{\teeny},
126 @code{\tiny},
127 @code{\small},
128 @code{\normalsize},
129 @code{\large},
130 @code{\huge}.
131 @endpredefined
132
133
134 @seealso
135 Snippets:
136 @rlsr{Editorial annotations}.
137
138 Internals Reference:
139 @rinternals{font-interface}.
140
141
142 @node Fingering instructions
143 @unnumberedsubsubsec Fingering instructions
144
145 @cindex fingering
146 @cindex finger change
147
148 @funindex \finger
149 @funindex finger
150
151 Fingering instructions can be entered using
152 @samp{@var{note}-@var{digit}}:
153
154 @lilypond[verbatim,quote,relative=2]
155 c4-1 d-2 f-4 e-3
156 @end lilypond
157
158 Markup texts may be used for finger changes.
159
160 @lilypond[verbatim,quote,relative=2]
161 c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
162 @end lilypond
163
164 @cindex thumb-script
165
166 @funindex \thumb
167 @funindex thumb
168
169 A thumb-script can be added (e.g. 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 by
181 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,quote,ragged-right,texidoc,doctitle]
193 {controlling-the-placement-of-chord-fingerings.ly}
194
195 @lilypondfile[verbatim,quote,texidoc,doctitle]
196 {allowing-fingerings-to-be-printed-inside-the-staff.ly}
197
198 @lilypondfile[verbatim,quote,texidoc,doctitle]
199 {avoiding-collisions-with-chord-fingerings.ly}
200
201
202 @seealso
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 @knownissues
217 By default, numbers greater than 9 are not supported using
218 @samp{@var{note}-@var{digit}}.
219
220
221 @node Hidden notes
222 @unnumberedsubsubsec Hidden notes
223
224 @cindex hidden notes
225 @cindex invisible notes
226 @cindex transparent notes
227 @cindex notes, hidden
228 @cindex notes, invisible
229 @cindex notes, transparent
230
231 @funindex \hideNotes
232 @funindex hideNotes
233 @funindex \unHideNotes
234 @funindex unHideNotes
235
236 Hidden (or invisible or transparent) notes can be useful in
237 preparing theory or composition exercises.
238
239 @lilypond[verbatim,quote,relative=2]
240 c4 d
241 \hideNotes
242 e4 f
243 \unHideNotes
244 g a
245 \hideNotes
246 b
247 \unHideNotes
248 c
249 @end lilypond
250
251 Note heads, stems, and flags, and rests are invisible.  Beams
252 are invisible if they start on a hidden note.  Objects that are
253 attached to invisible notes are still visible.
254
255 @lilypond[verbatim,quote,relative=2]
256 e8(\p f g a)--
257 \hideNotes
258 e8(\p f g a)--
259 @end lilypond
260
261
262 @predefined
263 @code{\hideNotes},
264 @code{\unHideNotes}.
265 @endpredefined
266
267
268 @seealso
269 Learning Manual:
270 @rlearning{Visibility and color of objects}.
271
272 Notation Reference:
273 @ref{Invisible rests},
274 @ref{Visibility of objects},
275 @ref{Hiding staves}.
276
277 Snippets:
278 @rlsr{Editorial annotations}.
279
280 Internals Reference:
281 @rinternals{Note_spacing_engraver},
282 @rinternals{NoteSpacing}.
283
284
285 @node Coloring objects
286 @unnumberedsubsubsec Coloring objects
287
288 @cindex colored objects
289 @cindex objects, colored
290 @cindex colors
291 @cindex coloring objects
292 @cindex colored notes
293 @cindex coloring notes
294 @cindex notes, colored
295 @cindex x11 color
296 @cindex x11-color
297 @cindex with-color
298
299 @funindex color
300 @funindex \with-color
301 @funindex with-color
302 @funindex x11-color
303
304 Individual objects may be assigned colors.  Valid color names
305 are listed in the @ref{List of colors}.
306
307 @lilypond[verbatim,quote,relative=2]
308 \override NoteHead #'color = #red
309 c4 c
310 \override NoteHead #'color = #(x11-color 'LimeGreen)
311 d
312 \override Stem #'color = #blue
313 e
314 @end lilypond
315
316
317 The full range of colors defined for X11 can be accessed by using
318 the Scheme function @code{x11-color}.  The function takes one
319 argument; this can be a symbol in the form @code{'@var{FooBar}} or
320 a string in the form @code{"@var{FooBar}"}.  The first form is
321 quicker to write and is more efficient.  However, using the second
322 form it is possible to access X11 colors by the multi-word form of
323 its name.
324
325 If @code{x11-color} cannot make sense of the parameter then the
326 color returned defaults to black.
327
328 @lilypond[verbatim,quote,relative=2]
329 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
330 \set Staff.instrumentName = \markup {
331   \with-color #(x11-color 'navy) "Clarinet"
332 }
333
334 gis8 a
335 \override Beam #'color = #(x11-color "medium turquoise")
336 gis a
337 \override Accidental #'color = #(x11-color 'DarkRed)
338 gis a
339 \override NoteHead #'color = #(x11-color "LimeGreen")
340 gis a
341 % this is deliberate nonsense; note that the stems remain black
342 \override Stem #'color = #(x11-color 'Boggle)
343 b2 cis
344 @end lilypond
345
346 @cindex rgb-color
347 @cindex color, rgb
348 @cindex rgb color
349
350 @funindex rgb-color
351
352 Exact RGB colors can be specified using the Scheme function
353 @code{rgb-color}.
354
355 @lilypond[verbatim,quote,relative=2]
356 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
357 \set Staff.instrumentName = \markup {
358   \with-color #(x11-color 'navy) "Clarinet"
359 }
360
361 \override Stem #'color = #(rgb-color 0 0 0)
362 gis8 a
363 \override Stem #'color = #(rgb-color 1 1 1)
364 gis8 a
365 \override Stem #'color = #(rgb-color 0 0 0.5)
366 gis4 a
367 @end lilypond
368
369
370 @seealso
371 Notation Reference:
372 @ref{List of colors}, @ref{The
373 tweak command}.
374
375 Snippets:
376 @rlsr{Editorial annotations}.
377
378
379 @cindex x11 color
380 @cindex colored notes in chords
381 @cindex notes, colored in chords
382 @cindex color in chords
383
384 @funindex x11-color
385
386 @knownissues
387 An X11 color is not necessarily exactly the same shade as a
388 similarly named normal color.
389
390 Not all X11 colors are distinguishable in a web browser, i.e.,
391 a web browser might not display a difference between @code{LimeGreen}
392 and @code{ForestGreen}.  For web use normal colors are recommended
393 (i.e., @code{blue}, @code{green}, @code{red}).
394
395
396 Notes in a chord cannot be colored with @code{\override}; use
397 @code{\tweak} instead, see @ref{The tweak command}.
398
399
400 @node Parentheses
401 @unnumberedsubsubsec Parentheses
402
403 @cindex ghost notes
404 @cindex notes, ghost
405 @cindex notes, parenthesized
406 @cindex parentheses
407
408 @funindex \parenthesize
409 @funindex parenthesize
410
411 Objects may be parenthesized by prefixing @code{\parenthesize} to
412 the music event.  When prefixed to a chord, it parenthesizes every
413 note.  Individual notes inside a chord may also be parenthesized.
414
415 @lilypond[verbatim,quote,relative=2]
416 c2 \parenthesize d
417 c2 \parenthesize <c e g>
418 c2 <c \parenthesize e g>
419 @end lilypond
420
421 Non-note objects may be parenthesized as well.  For articulations,
422 a hyphen is needed before the @code{\parenthesize} command.
423
424 @lilypond[verbatim,quote,relative=2]
425 c2-\parenthesize -. d
426 c2 \parenthesize r
427 @end lilypond
428
429
430 @seealso
431 Snippets:
432 @rlsr{Editorial annotations}.
433
434 Internals Reference:
435 @rinternals{Parenthesis_engraver},
436 @rinternals{ParenthesesItem},
437 @rinternals{parentheses-interface}.
438
439
440 @knownissues
441
442 Parenthesizing a chord prints parentheses around each individual
443 note, instead of a single large parenthesis around the entire
444 chord.
445
446
447 @node Stems
448 @unnumberedsubsubsec Stems
449
450 @cindex stem
451 @cindex stem, invisible
452 @cindex invisible stem
453
454 @funindex \stemUp
455 @funindex stemUp
456 @funindex \stemDown
457 @funindex stemDown
458 @funindex \stemNeutral
459 @funindex stemNeutral
460 @cindex stem, direction
461 @cindex stem, up
462 @cindex stem, down
463 @cindex stem, neutral
464
465 Whenever a note is found, a @code{Stem} object is created
466 automatically.  For whole notes and rests, they are also created but
467 made invisible.
468
469 Stems may be manually placed to point up or down; see
470 @ref{Direction and placement}.
471
472
473 @predefined
474 @code{\stemUp},
475 @code{\stemDown},
476 @code{\stemNeutral}.
477 @endpredefined
478
479
480 @snippets
481
482 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
483 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
484
485
486 @seealso
487 Notation Reference:
488 @ref{Direction and placement}.
489
490 Snippets:
491 @rlsr{Editorial annotations}.
492
493 Internals Reference:
494 @rinternals{Stem_engraver},
495 @rinternals{Stem},
496 @rinternals{stem-interface}.
497
498
499 @node Outside the staff
500 @subsection Outside the staff
501
502 This section discusses how to add emphasis to elements in the staff
503 from outside of the staff.
504
505 @menu
506 * Balloon help::
507 * Grid lines::
508 * Analysis brackets::
509 @end menu
510
511 @node Balloon help
512 @unnumberedsubsubsec Balloon help
513
514 @cindex balloon
515 @cindex notation, explaining
516 @cindex balloon help
517 @cindex help, balloon
518
519 @funindex \balloonGrobText
520 @funindex \balloonText
521 @funindex Balloon_engraver
522 @funindex balloonGrobText
523 @funindex balloonText
524 @funindex \balloonLengthOn
525 @funindex balloonLengthOn
526 @funindex \balloonLengthOff
527 @funindex balloonLengthOff
528
529 Elements of notation can be marked and named with the help of a
530 square balloon.  The primary purpose of this feature is to explain
531 notation.
532
533 @lilypond[verbatim,quote,relative=2]
534 \new Voice \with { \consists "Balloon_engraver" }
535 {
536   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
537   a8
538   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
539   r
540   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
541 }
542 @end lilypond
543
544
545 There are two music functions, @code{balloonGrobText} and
546 @code{balloonText};  the former is used like
547 @w{@code{\once \override}} to attach text to any grob, and the
548 latter is used like @code{\tweak}, typically within chords, to
549 attach text to an individual note.
550
551 Balloon text normally influences note spacing, but this can be
552 altered:
553
554 @lilypond[verbatim,quote,relative=2]
555 \new Voice \with { \consists "Balloon_engraver" }
556 {
557   \balloonLengthOff
558   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
559   a8
560   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
561   r
562   \balloonLengthOn
563   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2.
564 }
565 @end lilypond
566
567
568 @predefined
569 @code{\balloonLengthOn},
570 @code{\balloonLengthOff}.
571 @endpredefined
572
573
574 @seealso
575 Snippets:
576 @rlsr{Editorial annotations}.
577
578 Internals Reference:
579 @rinternals{Balloon_engraver},
580 @rinternals{BalloonTextItem},
581 @rinternals{balloon-interface}.
582
583
584 @node Grid lines
585 @unnumberedsubsubsec Grid lines
586
587 @cindex grid lines
588 @cindex lines, grid
589 @cindex vertical lines between staves
590 @cindex lines, vertical between staves
591
592 @funindex Grid_point_engraver
593 @funindex Grid_line_span_engraver
594 @funindex gridInterval
595
596 Vertical lines can be drawn between staves synchronized with the
597 notes.
598
599 The @code{Grid_point_engraver} must be used to create the end
600 points of the lines, while the @code{Grid_line_span_engraver} must
601 be used to actually draw the lines.  By default this centers grid
602 lines horizontally below and to the left side of each note head.
603 Grid lines extend from the middle lines of each staff.  The
604 @code{gridInterval} must specify the duration between the grid
605 lines.
606
607 @lilypond[verbatim,quote]
608 \layout {
609   \context {
610     \Staff
611     \consists "Grid_point_engraver"
612     gridInterval = #(ly:make-moment 1 4)
613   }
614   \context {
615     \Score
616     \consists "Grid_line_span_engraver"
617   }
618 }
619
620 \score {
621   \new ChoirStaff <<
622     \new Staff \relative c'' {
623       \stemUp
624       c4. d8 e8 f g4
625     }
626     \new Staff \relative c {
627       \clef bass
628       \stemDown
629       c4 g' f e
630     }
631   >>
632 }
633 @end lilypond
634
635 @snippets
636
637 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
638 {grid-lines--changing-their-appearance.ly}
639
640
641 @seealso
642 Snippets:
643 @rlsr{Editorial annotations}.
644
645 Internals Reference:
646 @rinternals{Grid_line_span_engraver},
647 @rinternals{Grid_point_engraver},
648 @rinternals{GridLine},
649 @rinternals{GridPoint},
650 @rinternals{grid-line-interface},
651 @rinternals{grid-point-interface}.
652
653
654 @node Analysis brackets
655 @unnumberedsubsubsec Analysis brackets
656
657 @cindex brackets
658 @cindex bracket, phrasing
659 @cindex phrasing bracket
660 @cindex musicological analysis
661 @cindex analysis, musicological
662 @cindex note grouping bracket
663 @cindex horizontal bracket
664 @cindex bracket, horizontal
665
666 @funindex Horizontal_bracket_engraver
667 @funindex \startGroup
668 @funindex startGroup
669 @funindex \stopGroup
670 @funindex stopGroup
671
672 Brackets are used in musical analysis to indicate structure in musical
673 pieces.  Simple horizontal brackets are supported.
674
675 @lilypond[verbatim,quote]
676 \layout {
677   \context {
678     \Voice
679     \consists "Horizontal_bracket_engraver"
680   }
681 }
682 \relative c'' {
683   c2\startGroup
684   d\stopGroup
685 }
686 @end lilypond
687
688 Analysis brackets may be nested.
689
690 @lilypond[verbatim,quote]
691 \layout {
692   \context {
693     \Voice
694     \consists "Horizontal_bracket_engraver"
695   }
696 }
697 \relative c'' {
698   c4\startGroup\startGroup
699   d4\stopGroup
700   e4\startGroup
701   d4\stopGroup\stopGroup
702 }
703 @end lilypond
704
705
706 @seealso
707 Snippets:
708 @rlsr{Editorial annotations}.
709
710 Internals Reference:
711 @rinternals{Horizontal_bracket_engraver},
712 @rinternals{HorizontalBracket},
713 @rinternals{horizontal-bracket-interface},
714 @rinternals{Staff}.
715