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