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