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