]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Minor tweaks.
[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 @predefined
216
217 @code{\hideNotes}, @code{\unHideNotes}
218
219 @seealso
220
221 Snippets:
222 @lsrdir{Editorial,Editorial-annotations}.
223
224 Internals Reference:
225 @internalsref{Note_spacing_engraver},
226 @internalsref{NoteSpacing}.
227
228
229 @node Coloring objects
230 @unnumberedsubsubsec Coloring objects
231
232 @cindex colored objects
233 @cindex colors
234 @cindex coloring objects
235 @cindex colored notes
236 @cindex coloring notes
237 @cindex notes, colored
238
239 Individual objects may be assigned colors.  Valid color names
240 are listed in the @ref{List of colors}.
241
242 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
243 \override NoteHead #'color = #red
244 c4 c
245 \override NoteHead #'color = #(x11-color 'LimeGreen)
246 d
247 \override Stem #'color = #blue
248 e
249 @end lilypond
250
251 @cindex x11-color
252
253 The full range of colors defined for X11 can be accessed by using
254 the Scheme function @code{x11-color}.  The function takes one
255 argument; this can be a symbol in the form @var{'FooBar} or a
256 string in the form @var{"FooBar"}.  The first form is quicker to
257 write and is more efficient.  However, using the second form it is
258 possible to access X11 colors by the multi-word form of its name.
259
260 If @code{x11-color} cannot make sense of the parameter then the
261 color returned defaults to black. 
262
263 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
264 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
265 \set Staff.instrumentName = \markup {
266   \with-color #(x11-color 'navy) "Clarinet"
267 }
268
269 gis8 a
270 \override Beam #'color = #(x11-color "medium turquoise")
271 gis a
272 \override Accidental #'color = #(x11-color 'DarkRed)
273 gis a
274 \override NoteHead #'color = #(x11-color "LimeGreen")
275 gis a
276 % this is deliberate nonsense; note that the stems remain black
277 \override Stem #'color = #(x11-color 'Boggle)
278 b2 cis
279 @end lilypond
280
281 Exact RGB colors can be specified using the Scheme function
282 @code{rgb-color}.
283
284 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
285 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
286 \set Staff.instrumentName = \markup {
287   \with-color #(x11-color 'navy) "Clarinet"
288 }
289   
290 % black
291 \override Stem #'color = #(rgb-color 0 0 0)
292 gis8 a
293 % white
294 \override Stem #'color = #(rgb-color 1 1 1)
295 gis8 a
296 % dark blue
297 \override Stem #'color = #(rgb-color 0 0 0.5) 
298 gis4 a
299 @end lilypond
300
301 @seealso
302
303 Notation Reference:
304 @ref{List of colors}, @ref{Objects connected to
305 the input}.
306
307 Snippets:
308 @lsrdir{Editorial,Editorial-annotations}.
309
310 @knownissues
311 An X11 color is not necessarily exactly the same shade as a
312 similarly named normal color.  
313
314 Not all X11 colors are distinguishable in a web browser, i.e.,
315 a web browser might not display a difference between @code{'LimeGreen}
316 and @code{'ForestGreen}.  For web use normal colors are recommended
317 (i.e., @code{#blue}, @code{#green}, @code{#red}).
318
319
320 Notes in a chord cannot be colored with @code{\override}; use
321 @code{\tweak} instead, see @ref{Objects connected to the input}.
322
323
324 @node Parentheses
325 @unnumberedsubsubsec Parentheses
326
327 @cindex ghost notes
328 @cindex notes, ghost
329 @cindex notes, parenthesized
330 @cindex parentheses
331
332 Objects may be parenthesized by prefixing @code{\parenthesize} to
333 the music event.  When applied to a chord, it parenthesizes every
334 note.
335
336 @lilypond[quote,relative=2,fragment,verbatim,ragged-right]
337 c2 \parenthesize d
338 c2 \parenthesize <c e g>
339 @end lilypond
340
341 Non-note objects may be parenthesized as well.
342
343 @lilypond[quote,relative=2,fragment,verbatim,ragged-right]
344 c2-\parenthesize -. d
345 c2 \parenthesize r
346 @end lilypond
347
348 @seealso
349
350 Snippets:
351 @lsrdir{Editorial,Editorial-annotations}.
352
353 Internals Reference:
354 @internalsref{Parenthesis_engraver},
355 @internalsref{ParenthesesItem},
356 @internalsref{parentheses-interface}.
357
358
359 @node Stems
360 @unnumberedsubsubsec Stems
361
362 @cindex stem
363
364 Whenever a note is found, a @code{Stem} object is created
365 automatically.  For whole notes and rests, they are also created but
366 made invisible.
367
368 @predefined
369
370 @funindex \stemUp
371 @code{\stemUp},
372 @funindex \stemDown
373 @code{\stemDown},
374 @funindex \stemNeutral
375 @code{\stemNeutral}.
376
377
378 @snippets
379
380 @cindex stem, direction
381 @cindex stem, up
382 @cindex stem, down
383 @cindex stem, neutral
384
385 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
386 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
387
388 @seealso
389 Notation Reference:
390 @ref{Controlling direction and placement}.
391
392 Snippets:
393 @lsrdir{Editorial,Editorial-annotations}.
394
395 Internals Reference:
396 @internalsref{Stem_engraver},
397 @internalsref{Stem},
398 @internalsref{stem-interface}.
399
400
401 @node Outside the staff
402 @subsection Outside the staff
403
404 This section discusses how to add emphasis to elements in the staff 
405 from outside of the staff. 
406
407 @menu
408 * Balloon help::                
409 * Grid lines::                  
410 * Analysis brackets::           
411 @end menu
412
413 @node Balloon help
414 @unnumberedsubsubsec Balloon help
415
416 Elements of notation can be marked and named with the help of a
417 square balloon.  The primary purpose of this feature is to explain
418 notation.
419
420 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
421 \new Voice \with { \consists "Balloon_engraver" }
422 {
423   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
424   a8 
425   \balloonGrobText #'Rest #'(-4 . -4) \markup { "I'm a rest" }
426   r
427   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2. 
428 }
429 @end lilypond
430
431 There are two music functions, @code{balloonGrobText} and
432 @code{balloonText};  the former is used like @code{\once \override} to 
433 attach text to any grob, and the latter is used like @code{\tweak}, 
434 typically within chords, to attach text to an individual note.
435
436 @cindex balloon
437 @cindex notation, explaining
438
439 @seealso
440
441 Snippets:
442 @lsrdir{Editorial,Editorial-annotations}.
443
444 Internals Reference:
445 @internalsref{Balloon_engraver},
446 @internalsref{BalloonTextItem},
447 @internalsref{balloon-interface}.
448
449
450 @node Grid lines
451 @unnumberedsubsubsec Grid lines
452
453 Vertical lines can be drawn between staves synchronized with the
454 notes.
455
456 @lilypond[quote,verbatim,ragged-right]
457 \layout {
458   \context {
459     \Staff
460     % set up grids
461     \consists "Grid_point_engraver" 
462     % set the grid interval to one quarter note
463     gridInterval = #(ly:make-moment 1 4)
464   }
465   \context {
466     \Score
467     % by default this centers grid lines horizontally below
468     % and to the left side of the note head, the grid lines
469     % extending from the middle lines of each staff
470     \consists "Grid_line_span_engraver"
471   }
472 }
473
474 \score {
475   \new ChoirStaff <<
476     \new Staff \relative c'' {
477       \stemUp
478       c4. d8 e8 f g4
479     }
480     \new Staff \relative c {
481       \clef bass
482       \stemDown
483       c4 g' f e
484     }
485   >>
486 }
487 @end lilypond
488
489 @snippets
490
491 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
492 {grid-lines-changing-their-appearance.ly}
493
494
495 @seealso
496
497 Snippets:
498 @lsrdir{Editorial,Editorial-annotations}.
499
500 Internals Reference:
501 @internalsref{Grid_line_span_engraver},
502 @internalsref{Grid_point_engraver},
503 @internalsref{GridLine},
504 @internalsref{GridPoint},
505 @internalsref{grid-line-interface},
506 @internalsref{grid-point-interface}.
507
508
509 @node Analysis brackets
510 @unnumberedsubsubsec Analysis brackets
511
512 @cindex brackets
513 @cindex phrasing brackets
514 @cindex musicological analysis
515 @cindex note grouping bracket
516
517 Brackets are used in musical analysis to indicate structure in musical
518 pieces.  Simple horizontal brackets are supported.
519
520 @lilypond[quote,verbatim,ragged-right]
521 \layout {
522   \context {
523     \Staff
524     \consists "Horizontal_bracket_engraver"
525   }
526 }
527 \relative c'' {
528   c2\startGroup
529   d\stopGroup
530 }
531 @end lilypond
532
533 Analysis brackets may be nested.
534
535 @lilypond[quote,verbatim,ragged-right]
536 \layout {
537   \context {
538     \Staff
539     \consists "Horizontal_bracket_engraver"
540   }
541 }
542 \relative c'' {
543   c4\startGroup\startGroup
544   d4\stopGroup
545   e4\startGroup
546   d4\stopGroup\stopGroup
547 }
548 @end lilypond
549
550 @seealso
551
552 Snippets:
553 @lsrdir{Editorial,Editorial-annotations}.
554
555 Internals Reference:
556 @internalsref{Horizontal_bracket_engraver},
557 @internalsref{HorizontalBracket},
558 @internalsref{horizontal-bracket-interface},
559 @internalsref{Staff}.
560