]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Merge branch 'master' of ssh+git://hanwen@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[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 @refcommands
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 @commonprop
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 @seealso
197
198 Snippets: @lsrdir{Editorial,Editorial-annotations}.
199
200
201 @node Coloring objects
202 @subsubsection Coloring objects
203
204 @cindex colored objects
205 @cindex colors
206 @cindex coloring objects
207 @cindex colored notes
208 @cindex coloring notes
209 @cindex notes, colored
210
211 Individual objects may be assigned colors.  You may use the color
212 names listed in the @ref{List of colors}.
213
214 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
215 \override NoteHead #'color = #red
216 c4 c
217 \override NoteHead #'color = #(x11-color 'LimeGreen)
218 d
219 \override Stem #'color = #blue
220 e
221 @end lilypond
222
223 @cindex x11-color
224
225 The full range of colors defined for X11 can be accessed by using
226 the Scheme function x11-color.  The function takes one argument
227 that can be a symbol
228
229 @example
230 \override Beam #'color = #(x11-color 'MediumTurquoise)
231 @end example
232
233 or a string
234
235 @example
236 \override Beam #'color = #(x11-color "MediumTurquoise")
237 @end example
238
239 The first form is quicker to write and is more efficient.
240 However, using the second form it is possible to access X11 colors
241 by the multi-word form of its name
242
243 @example
244 \override Beam #'color = #(x11-color "medium turquoise")
245 @end example
246
247 If x11-color cannot make sense of the parameter then the color
248 returned defaults to black.  It should be obvious from the final
249 score that something is wrong.
250
251 This example illustrates the use of x11-color.  Notice that the
252 stem color remains black after being set to (x11-color 'Boggle),
253 which is deliberate nonsense.
254
255 @lilypond[quote,ragged-right,verbatim]
256 {
257   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
258   \set Staff.instrumentName = \markup {
259     \with-color #(x11-color 'navy) "Clarinet"
260   }
261   \time 2/4
262   gis''8 a''
263   \override Beam #'color = #(x11-color "medium turquoise")
264   gis'' a''
265   \override NoteHead #'color = #(x11-color "LimeGreen")
266   gis'' a''
267   \override Stem #'color = #(x11-color 'Boggle)
268   gis'' a''
269 }
270 @end lilypond
271
272 You can get exact RGB colors by specifying the rgb-color number.
273
274 @lilypond[quote,ragged-right,verbatim]
275 {
276   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
277   \set Staff.instrumentName = \markup {
278     \with-color #(x11-color 'navy) "Clarinet"
279   }
280   \time 4/4
281
282   %black
283   \override Stem #'color = #(rgb-color 0 0 0)
284   c4
285   % white
286   \override Stem #'color = #(rgb-color 1 1 1)
287   d
288   % dark blue
289   \override Stem #'color = #(rgb-color 0 0 0.5) 
290   e
291 }
292 @end lilypond
293
294 @seealso
295
296 Notation Reference: @ref{List of colors}, @ref{Objects connected to
297 the input}.
298
299 Snippets: @lsrdir{Editorial,Editorial-annotations}.
300
301 @refbugs
302 Not all x11 colors are distinguishable in a web browser i.e. a web
303 browser might not display a difference between 'LimeGreen and
304 'ForestGreen.  For web use normal colors are recommended. (#blue,
305 #green, #red)
306
307 An x11 color is not necessarily exactly the same shade as a
308 similarly named normal color.
309
310 Notes in a chord cannot be colored with @code{\override}; use
311 @code{\tweak} instead.  See @ref{Objects connected to the input},
312 for details.
313
314
315 @node Parentheses
316 @subsubsection Parentheses
317
318 @cindex ghost notes
319 @cindex notes, ghost
320 @cindex notes, parenthesized
321 @cindex parentheses
322
323 Objects may be parenthesized by prefixing @code{\parenthesize} to
324 the music event,
325
326 @lilypond[relative=2,fragment,verbatim,ragged-right]
327 <
328   c
329   \parenthesize d
330   g
331 >2-\parenthesize -.
332 d g 
333 <
334   c
335   \parenthesize fis
336 >
337 @end lilypond
338
339 This only functions inside chords, to parenthesize a single note it 
340 must be enclosed with @code{<>} as if it is a chord.
341
342 @example
343 < \parenthesize NOTE>
344 @end example
345
346 @lilypond[relative=2,fragment,verbatim,ragged-right]
347 c4
348 <\parenthesize d>
349 g
350 <\parenthesize d>
351 @end lilypond
352
353 @seealso
354
355 Snippets: @lsrdir{Editorial,Editorial-annotations}.
356
357
358 @node Stems
359 @subsubsection Stems
360
361 @cindex stem
362
363 Whenever a note is found, a @code{Stem} object is created
364 automatically.  For whole notes and rests, they are also created but
365 made invisible.
366
367 @refcommands
368
369 @funindex \stemUp
370 @code{\stemUp},
371 @funindex \stemDown
372 @code{\stemDown},
373 @funindex \stemNeutral
374 @code{\stemNeutral}.
375
376
377 @commonprop
378
379 @cindex stem, direction
380 @cindex stem, up
381 @cindex stem, down
382 @cindex stem, neutral
383
384 To change the direction of stems on the center line of the staff, use
385
386 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
387 a4 b c b
388 \override Stem #'neutral-direction = #up
389 a4 b c b
390 \override Stem #'neutral-direction = #down
391 a4 b c b
392 @end lilypond
393
394 @seealso
395
396 Snippets: @lsrdir{Editorial,Editorial-annotations}.
397
398
399 @node Outside the staff
400 @subsection Outside the staff
401
402
403 @menu
404 * Balloon help::                
405 * Grid lines::                  
406 * Analysis brackets::           
407 @end menu
408
409 @node Balloon help
410 @subsubsection Balloon help
411
412 Elements of notation can be marked and named with the help of a
413 square balloon.  The primary purpose of this feature is to explain
414 notation.
415
416 The following example demonstrates its use.
417
418 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
419 \new Voice \with { \consists "Balloon_engraver" }
420 {
421   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
422   <a-\balloonText #'(-2 . -2) \markup { "I'm a note head" }  >8
423 }
424 @end lilypond
425
426 There are two music functions, @code{balloonGrobText} and
427 @code{balloonText}; the former takes the name of the grob to adorn,
428 while the latter may be used as an articulation on a note.  The other
429 arguments are the offset and the text of the label.
430
431 @cindex balloon
432 @cindex notation, explaining
433
434 @seealso
435
436 Snippets: @lsrdir{Editorial,Editorial-annotations}.
437
438 Internals Reference: @internalsref{text-balloon-interface}.
439
440
441 @node Grid lines
442 @subsubsection Grid lines
443
444 Vertical lines can be drawn between staves synchronized with the
445 notes.
446
447 @lilypond[ragged-right,quote,verbatim]
448 \layout {
449   \context {
450     \Staff
451     \consists "Grid_point_engraver" %% sets of grid
452     gridInterval = #(ly:make-moment 1 4)
453   }
454 }
455
456 \new Score \with {
457   \consists "Grid_line_span_engraver"
458   %% centers grid lines  horizontally below note heads
459   \override NoteColumn #'X-offset = #-0.5
460 }
461
462 \new ChoirStaff <<
463   \new Staff {
464     \stemUp
465     \relative {
466       c'4. d8 e8 f g4
467     }
468   }
469   \new Staff {
470     %% centers grid lines  vertically
471     \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
472     \stemDown
473     \clef bass
474     \relative c {
475       c4  g'  f  e
476     }
477   }
478 >>
479 @end lilypond
480
481 @seealso
482
483 Snippets: @lsrdir{Editorial,Editorial-annotations}.
484
485
486
487
488 @node Analysis brackets
489 @subsubsection Analysis brackets
490
491 @cindex brackets
492 @cindex phrasing brackets
493 @cindex musicological analysis
494 @cindex note grouping bracket
495
496 Brackets are used in musical analysis to indicate structure in musical
497 pieces.  LilyPond supports a simple form of nested horizontal
498 brackets.  To use this, add the @code{Horizontal_bracket_engraver} to
499 the @code{Staff} context.  A bracket is started with
500 @code{\startGroup} and closed with @code{\stopGroup}.
501
502 @lilypond[quote,ragged-right,verbatim]
503 \score {
504   \relative c'' {
505     c4\startGroup\startGroup
506     c4\stopGroup
507     c4\startGroup
508     c4\stopGroup\stopGroup
509   }
510   \layout {
511     \context {
512       \Staff \consists "Horizontal_bracket_engraver"
513     }
514   }
515 }
516 @end lilypond
517
518 @seealso
519
520 Snippets: @lsrdir{Editorial,Editorial-annotations}.
521
522 Internals Reference: @internalsref{HorizontalBracket},
523 @internalsref{Horizontal_bracket_engraver}, @internalsref{Staff}.
524