]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Merge branch 'master' of git://git.sv.gnu.org/lilypond
[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.38"
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)
44 @cindex selecting font size (notation)
45
46 The font size of notation elements may be altered.  It does not
47 change the size of variable symbols, such as beams or slurs.
48
49 @warning{For @strong{text} font sizes, see
50 @ref{Common markup commands}.}
51
52 @lilypond[quote,fragment,relative=2,verbatim,ragged-right]
53 \huge
54 c4.-> d8---3
55 \large
56 c4.-> d8---3
57 \normalsize
58 c4.-> d8---3
59 \small
60 c4.-> d8---3
61 \tiny
62 c4.-> d8---3
63 \teeny
64 c4.-> d8---3
65 @end lilypond
66
67 @cindex font size (notation) scaling
68
69 Internally, this sets the @code{fontSize} property.  This in turn
70 causes the @code{font-size} property to be set in all layout
71 objects.  The value of @code{font-size} is a number indicating the
72 size relative to the standard size for the current staff height.
73 Each step up is an increase of approximately 12% of the font size.
74 Six steps is exactly a factor of two.  The Scheme function
75 @code{magstep} converts a @code{font-size} number to a scaling
76 factor.  The @code{font-size} property can also be set directly,
77 so that only certain layout objects are affected.
78
79 @lilypond[quote,fragment,relative=2,verbatim,ragged-right]
80 \set fontSize = #3
81 c4.-> d8---3
82 \override NoteHead #'font-size = #-4
83 c4.-> d8---3
84 \override Script #'font-size = #2
85 c4.-> d8---3
86 \override Stem #'font-size = #-5
87 c4.-> d8---3
88 @end lilypond
89
90 @cindex standard font size (notation)
91 @cindex font size (notation), standard
92
93 Font size changes are achieved by scaling the design size that is
94 closest to the desired size.  The standard font size (for
95 @code{font-size = #0}), depends on the standard staff height.
96 For a 20pt staff, a 10pt font is selected.
97
98 The @code{font-size} property can only be set on layout objects
99 that use fonts.  These are the ones supporting the
100 @code{font-interface} layout interface.
101
102 @predefined
103
104 @funindex \teeny
105 @code{\teeny},
106 @funindex \tiny
107 @code{\tiny},
108 @funindex \small
109 @code{\small},
110 @funindex \normalsize
111 @code{\normalsize},
112 @funindex \large
113 @code{\large},
114 @funindex \huge
115 @code{\huge}.
116
117 @seealso
118
119 Snippets:
120 @lsrdir{Editorial,Editorial-annotations}.
121
122 Internals Reference:
123 @internalsref{fontSize},
124 @internalsref{font-size},
125 @internalsref{font-interface}.
126
127
128 @node Fingering instructions
129 @unnumberedsubsubsec Fingering instructions
130
131 @cindex fingering
132 @cindex finger change
133
134 Fingering instructions can be entered using
135 @var{note}-@var{digit}:
136
137 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
138 c4-1 d-2 f-4 e-3
139 @end lilypond
140
141 Markup texts may be used for finger changes. 
142
143 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
144 c4-1 d-2 f-4 c^\markup { \finger "2 - 3" }
145 @end lilypond
146
147 @cindex thumb-script
148
149 You can use the thumb-script (e.g., in cello music) to indicate that a 
150 note should be played with the thumb. 
151
152 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
153 <a_\thumb a'-3>2 <b_\thumb b'-3>
154 @end lilypond
155
156 @cindex fingering chords
157 @cindex chords, fingering
158
159 Fingerings for chords can also be added to individual notes of the
160 chord by adding them after the pitches.
161
162 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
163 <c-1 e-2 g-3 b-5>2 <d-1 f-2 a-3 c-5>
164 @end lilypond
165
166 Fingering instructions may be manually placed above or below the
167 staff, see @ref{Controlling direction and placement}.
168
169 @snippets
170
171 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
172 {controlling-the-placement-of-chord-fingerings.ly}
173
174
175 @seealso
176
177 Notation Reference:
178 @ref{Controlling direction and placement}
179
180 Snippets:
181 @lsrdir{Editorial,Editorial-annotations}.
182
183 Internals Reference:
184 @internalsref{FingeringEvent},
185 @internalsref{fingering-event},
186 @internalsref{Fingering_engraver},
187 @internalsref{New_fingering_engraver},
188 @internalsref{Fingering}.
189
190
191 @node Hidden notes
192 @unnumberedsubsubsec Hidden notes
193
194 @cindex hidden notes
195 @cindex invisible notes
196 @cindex transparent notes
197 @funindex \hideNotes
198 @funindex \unHideNotes
199
200 Hidden (or invisible or transparent) notes can be useful in
201 preparing theory or composition exercises.
202
203 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
204 c4 d
205 \hideNotes
206 e4 f
207 \unHideNotes
208 g a
209 \hideNotes 
210 b
211 \unHideNotes
212 c
213 @end lilypond
214
215 Notation objects which are attached to invisible notes are still
216 visible.
217
218 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
219 c4( d)
220 \hideNotes
221 e4(\p f)->
222 @end lilypond
223
224
225 @predefined
226
227 @funindex \hideNotes
228 @funindex \unHideNotes
229 @code{\hideNotes}, @code{\unHideNotes}
230
231 @seealso
232
233 Snippets:
234 @lsrdir{Editorial,Editorial-annotations}.
235
236 Internals Reference:
237 @internalsref{Note_spacing_engraver},
238 @internalsref{NoteSpacing}.
239
240
241 @node Coloring objects
242 @unnumberedsubsubsec Coloring objects
243
244 @cindex colored objects
245 @cindex colors
246 @cindex coloring objects
247 @cindex colored notes
248 @cindex coloring notes
249 @cindex notes, colored
250
251 Individual objects may be assigned colors.  Valid color names
252 are listed in the @ref{List of colors}.
253
254 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
255 \override NoteHead #'color = #red
256 c4 c
257 \override NoteHead #'color = #(x11-color 'LimeGreen)
258 d
259 \override Stem #'color = #blue
260 e
261 @end lilypond
262
263 @cindex x11-color
264
265 The full range of colors defined for X11 can be accessed by using
266 the Scheme function @code{x11-color}.  The function takes one
267 argument; this can be a symbol in the form @var{'FooBar} or a
268 string in the form @var{"FooBar"}.  The first form is quicker to
269 write and is more efficient.  However, using the second form it is
270 possible to access X11 colors by the multi-word form of its name.
271
272 If @code{x11-color} cannot make sense of the parameter then the
273 color returned defaults to black. 
274
275 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
276 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
277 \set Staff.instrumentName = \markup {
278   \with-color #(x11-color 'navy) "Clarinet"
279 }
280
281 gis8 a
282 \override Beam #'color = #(x11-color "medium turquoise")
283 gis a
284 \override Accidental #'color = #(x11-color 'DarkRed)
285 gis a
286 \override NoteHead #'color = #(x11-color "LimeGreen")
287 gis a
288 % this is deliberate nonsense; note that the stems remain black
289 \override Stem #'color = #(x11-color 'Boggle)
290 b2 cis
291 @end lilypond
292
293 Exact RGB colors can be specified using the Scheme function
294 @code{rgb-color}.
295
296 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
297 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
298 \set Staff.instrumentName = \markup {
299   \with-color #(x11-color 'navy) "Clarinet"
300 }
301   
302 % black
303 \override Stem #'color = #(rgb-color 0 0 0)
304 gis8 a
305 % white
306 \override Stem #'color = #(rgb-color 1 1 1)
307 gis8 a
308 % dark blue
309 \override Stem #'color = #(rgb-color 0 0 0.5) 
310 gis4 a
311 @end lilypond
312
313 @seealso
314
315 Notation Reference:
316 @ref{List of colors}, @ref{Objects connected to
317 the input}.
318
319 Snippets:
320 @lsrdir{Editorial,Editorial-annotations}.
321
322 @knownissues
323 An X11 color is not necessarily exactly the same shade as a
324 similarly named normal color.  
325
326 Not all X11 colors are distinguishable in a web browser, i.e.,
327 a web browser might not display a difference between @code{'LimeGreen}
328 and @code{'ForestGreen}.  For web use normal colors are recommended
329 (i.e., @code{#blue}, @code{#green}, @code{#red}).
330
331
332 Notes in a chord cannot be colored with @code{\override}; use
333 @code{\tweak} instead, see @ref{Objects connected to the input}.
334
335
336 @node Parentheses
337 @unnumberedsubsubsec Parentheses
338
339 @cindex ghost notes
340 @cindex notes, ghost
341 @cindex notes, parenthesized
342 @cindex parentheses
343
344 Objects may be parenthesized by prefixing @code{\parenthesize} to
345 the music event.  When prefixed to a chord, it parenthesizes every
346 note.  Individual notes inside a chord may also be parenthesized.
347
348 @lilypond[quote,relative=2,fragment,verbatim,ragged-right]
349 c2 \parenthesize d
350 c2 \parenthesize <c e g>
351 c2 <c \parenthesize e g>
352 @end lilypond
353
354 Non-note objects may be parenthesized as well.
355
356 @lilypond[quote,relative=2,fragment,verbatim,ragged-right]
357 c2-\parenthesize -. d
358 c2 \parenthesize r
359 @end lilypond
360
361 @seealso
362
363 Snippets:
364 @lsrdir{Editorial,Editorial-annotations}.
365
366 Internals Reference:
367 @internalsref{Parenthesis_engraver},
368 @internalsref{ParenthesesItem},
369 @internalsref{parentheses-interface}.
370
371 @knownissues
372
373 Parenthesizing a chord prints parentheses around each individual
374 note, instead of a single large parenthesis around the entire
375 chord.
376
377
378 @node Stems
379 @unnumberedsubsubsec Stems
380
381 @cindex stem
382
383 Whenever a note is found, a @code{Stem} object is created
384 automatically.  For whole notes and rests, they are also created but
385 made invisible.
386
387 @predefined
388
389 @funindex \stemUp
390 @code{\stemUp},
391 @funindex \stemDown
392 @code{\stemDown},
393 @funindex \stemNeutral
394 @code{\stemNeutral}.
395
396
397 @snippets
398
399 @cindex stem, direction
400 @cindex stem, up
401 @cindex stem, down
402 @cindex stem, neutral
403
404 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
405 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
406
407 @seealso
408 Notation Reference:
409 @ref{Controlling direction and placement}.
410
411 Snippets:
412 @lsrdir{Editorial,Editorial-annotations}.
413
414 Internals Reference:
415 @internalsref{Stem_engraver},
416 @internalsref{Stem},
417 @internalsref{stem-interface}.
418
419
420 @node Outside the staff
421 @subsection Outside the staff
422
423 This section discusses how to add emphasis to elements in the staff 
424 from outside of the staff. 
425
426 @menu
427 * Balloon help::                
428 * Grid lines::                  
429 * Analysis brackets::           
430 @end menu
431
432 @node Balloon help
433 @unnumberedsubsubsec Balloon help
434
435 Elements of notation can be marked and named with the help of a
436 square balloon.  The primary purpose of this feature is to explain
437 notation.
438
439 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
440 \new Voice \with { \consists "Balloon_engraver" }
441 {
442   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
443   a8 
444   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
445   r
446   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2. 
447 }
448 @end lilypond
449
450 @cindex balloon
451 @cindex notation, explaining
452
453 There are two music functions, @code{balloonGrobText} and
454 @code{balloonText};  the former is used like @code{\once \override} to 
455 attach text to any grob, and the latter is used like @code{\tweak}, 
456 typically within chords, to attach text to an individual note.
457
458 @predefined
459
460 @funindex ballonLengthOn
461 @funindex ballonLengthOff
462 @code{\balloonLengthOn}, @code{\balloonLengthOff}
463
464 @seealso
465
466 Snippets:
467 @lsrdir{Editorial,Editorial-annotations}.
468
469 Internals Reference:
470 @internalsref{Balloon_engraver},
471 @internalsref{BalloonTextItem},
472 @internalsref{balloon-interface}.
473
474
475 @node Grid lines
476 @unnumberedsubsubsec Grid lines
477
478 Vertical lines can be drawn between staves synchronized with the
479 notes.
480
481 @lilypond[quote,verbatim,ragged-right]
482 \layout {
483   \context {
484     \Staff
485     % set up grids
486     \consists "Grid_point_engraver" 
487     % set the grid interval to one quarter note
488     gridInterval = #(ly:make-moment 1 4)
489   }
490   \context {
491     \Score
492     % by default this centers grid lines horizontally below
493     % and to the left side of the note head, the grid lines
494     % extending from the middle lines of each staff
495     \consists "Grid_line_span_engraver"
496   }
497 }
498
499 \score {
500   \new ChoirStaff <<
501     \new Staff \relative c'' {
502       \stemUp
503       c4. d8 e8 f g4
504     }
505     \new Staff \relative c {
506       \clef bass
507       \stemDown
508       c4 g' f e
509     }
510   >>
511 }
512 @end lilypond
513
514 @snippets
515
516 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
517 {grid-lines-changing-their-appearance.ly}
518
519
520 @seealso
521
522 Snippets:
523 @lsrdir{Editorial,Editorial-annotations}.
524
525 Internals Reference:
526 @internalsref{Grid_line_span_engraver},
527 @internalsref{Grid_point_engraver},
528 @internalsref{GridLine},
529 @internalsref{GridPoint},
530 @internalsref{grid-line-interface},
531 @internalsref{grid-point-interface}.
532
533
534 @node Analysis brackets
535 @unnumberedsubsubsec Analysis brackets
536
537 @cindex brackets
538 @cindex phrasing brackets
539 @cindex musicological analysis
540 @cindex note grouping bracket
541
542 Brackets are used in musical analysis to indicate structure in musical
543 pieces.  Simple horizontal brackets are supported.
544
545 @lilypond[quote,verbatim,ragged-right]
546 \layout {
547   \context {
548     \Voice
549     \consists "Horizontal_bracket_engraver"
550   }
551 }
552 \relative c'' {
553   c2\startGroup
554   d\stopGroup
555 }
556 @end lilypond
557
558 Analysis brackets may be nested.
559
560 @lilypond[quote,verbatim,ragged-right]
561 \layout {
562   \context {
563     \Voice
564     \consists "Horizontal_bracket_engraver"
565   }
566 }
567 \relative c'' {
568   c4\startGroup\startGroup
569   d4\stopGroup
570   e4\startGroup
571   d4\stopGroup\stopGroup
572 }
573 @end lilypond
574
575 @seealso
576
577 Snippets:
578 @lsrdir{Editorial,Editorial-annotations}.
579
580 Internals Reference:
581 @internalsref{Horizontal_bracket_engraver},
582 @internalsref{HorizontalBracket},
583 @internalsref{horizontal-bracket-interface},
584 @internalsref{Staff}.
585