]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Merge branch 'master' of ssh+git://git.sv.gnu.org/srv/git/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 @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 @knownissues
326
327 Rests cannot be parenthesized.
328
329
330 @node Stems
331 @subsubsection Stems
332
333 @cindex stem
334
335 Whenever a note is found, a @code{Stem} object is created
336 automatically.  For whole notes and rests, they are also created but
337 made invisible.
338
339 @predefined
340
341 @funindex \stemUp
342 @code{\stemUp},
343 @funindex \stemDown
344 @code{\stemDown},
345 @funindex \stemNeutral
346 @code{\stemNeutral}.
347
348
349 @snippets
350
351 @cindex stem, direction
352 @cindex stem, up
353 @cindex stem, down
354 @cindex stem, neutral
355
356 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
357 {default-direction-of-stems-on-the-center-line-of-the-staff.ly}
358
359 @seealso
360 Notation Reference: @ref{Controlling direction and placement}.
361
362 Snippets: @lsrdir{Editorial,Editorial-annotations}.
363
364
365 @node Outside the staff
366 @subsection Outside the staff
367
368 This section discusses how to add emphasis to elements in the staff 
369 from outside of the staff. 
370
371 @menu
372 * Balloon help::                
373 * Grid lines::                  
374 * Analysis brackets::           
375 @end menu
376
377 @node Balloon help
378 @subsubsection Balloon help
379
380 Elements of notation can be marked and named with the help of a
381 square balloon.  The primary purpose of this feature is to explain
382 notation.
383
384 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
385 \new Voice \with { \consists "Balloon_engraver" }
386 {
387   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
388   a8 
389   \balloonGrobText #'Rest #' (-4 . -4) \markup { "I'm a rest" }
390   r
391   <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } c>2. 
392 }
393 @end lilypond
394
395 There are two music functions, @code{balloonGrobText} and
396 @code{balloonText};  The former is used like @code{\once \override} to 
397 attach text to any grob, and the latter is used like @code{ \tweak}, 
398 typically within chords, to attach text to an individual note.
399
400 @cindex balloon
401 @cindex notation, explaining
402
403 @seealso
404
405 Snippets: @lsrdir{Editorial,Editorial-annotations}.
406
407 Internals Reference: @internalsref{text-balloon-interface}.
408
409
410 @node Grid lines
411 @subsubsection Grid lines
412
413 Vertical lines can be drawn between staves synchronized with the
414 notes.
415
416 @lilypond[quote,verbatim,ragged-right]
417 \layout {
418   \context {
419     \Staff
420     % sets up grids
421     \consists "Grid_point_engraver" 
422     % this sets the grid interval to 1 quarternote (crotchet)
423     gridInterval = #(ly:make-moment 1 4)
424       }
425 }
426
427 \new Score \with {
428   % by default this centers grid lines horizontally below and to the 
429   % left side of the notehead, the grid lines extend from 
430   % the middle lines of each staff
431   \consists "Grid_line_span_engraver"
432   }
433
434 \new ChoirStaff <<
435   \new Staff {
436     \relative c'' {
437       \stemUp
438       c4. d8 e8 f g4
439     }
440   }
441   \new Staff {
442     \clef bass
443     \relative c {
444       \stemDown
445       c4  g'  f  e
446     }
447   }
448 >>
449 @end lilypond
450
451 @snippets
452
453 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
454 {grid-lines-changing-their-appearance.ly}
455
456
457 @seealso
458
459 Snippets: @lsrdir{Editorial,Editorial-annotations}.
460
461
462
463
464 @node Analysis brackets
465 @subsubsection Analysis brackets
466
467 @cindex brackets
468 @cindex phrasing brackets
469 @cindex musicological analysis
470 @cindex note grouping bracket
471
472 Brackets are used in musical analysis to indicate structure in musical
473 pieces.  LilyPond supports a simple form of horizontal brackets.
474
475 @lilypond[quote,verbatim,ragged-right]
476 \layout {
477   \context {
478     \Staff \consists "Horizontal_bracket_engraver"
479   }
480 }
481 \relative c'' {
482   c2\startGroup
483   d\stopGroup
484 }
485 @end lilypond
486
487 Analysis brackets may be nested.
488
489 @lilypond[quote,verbatim,ragged-right]
490 \layout {
491   \context {
492     \Staff \consists "Horizontal_bracket_engraver"
493   }
494 }
495 \relative c'' {
496   c4\startGroup\startGroup
497   d4\stopGroup
498   e4\startGroup
499   d4\stopGroup\stopGroup
500 }
501 @end lilypond
502
503 @seealso
504
505 Snippets: @lsrdir{Editorial,Editorial-annotations}.
506
507 Internals Reference: @internalsref{HorizontalBracket},
508 @internalsref{Horizontal_bracket_engraver}, @internalsref{Staff}.
509