]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Merge branch 'master' of ssh://kainhofer@git.sv.gnu.org/srv/git/lilypond into kainhofer
[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
248 \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
249 \set Staff.instrumentName = \markup {
250   \with-color #(x11-color 'navy) "Clarinet"
251 }
252
253 gis8 a
254 \override Beam #'color = #(x11-color "medium turquoise")
255 gis a
256 \override Accidental #'color = #(x11-color 'DarkRed)
257 gis a
258 \override NoteHead #'color = #(x11-color "LimeGreen")
259 gis a
260 % this is deliberate nonsense; note that the stems remain black
261 \override Stem #'color = #(x11-color 'Boggle)
262 b2 cis
263
264 @end lilypond
265
266 You can get exact RGB colors by specifying the rgb-color number.
267
268 @lilypond[quote,ragged-right,verbatim,fragment,relative=2]
269
270   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
271   \set Staff.instrumentName = \markup {
272     \with-color #(x11-color 'navy) "Clarinet"
273   }
274   
275   %black
276   \override Stem #'color = #(rgb-color 0 0 0)
277   gis8 a
278   % white
279   \override Stem #'color = #(rgb-color 1 1 1)
280   gis8 a
281   % dark blue
282   \override Stem #'color = #(rgb-color 0 0 0.5) 
283   gis4 a
284
285 @end lilypond
286
287 @seealso
288
289 Notation Reference: @ref{List of colors}, @ref{Objects connected to
290 the input}.
291
292 Snippets: @lsrdir{Editorial,Editorial-annotations}.
293
294 @knownissues
295 An x11 color is not necessarily exactly the same shade as a
296 similarly named normal color.  
297
298 Not all x11 colors are distinguishable in a web browser i.e. a web browser
299 might not display a difference between 'LimeGreen and 'ForestGreen.  For 
300 web use normal colors are recommended (i.e. #blue, #green, #red).
301
302
303 Notes in a chord cannot be colored with @code{\override}; use
304 @code{\tweak} instead, see @ref{Objects connected to the input}.
305
306
307 @node Parentheses
308 @subsubsection Parentheses
309
310 @cindex ghost notes
311 @cindex notes, ghost
312 @cindex notes, parenthesized
313 @cindex parentheses
314
315 Objects may be parenthesized by prefixing @code{\parenthesize} to
316 the music event.  This only functions inside chords; to
317 parenthesize a single note it must be enclosed with @code{<>} as
318 if it is a chord.
319
320 @lilypond[relative=2,fragment,verbatim,ragged-right]
321 c2 < \parenthesize d>
322 @end lilypond
323
324 Non-note objects may be parenthesized as well.
325
326 @lilypond[relative=2,fragment,verbatim,ragged-right]
327 < c d g >2-\parenthesize -. d
328 @end lilypond
329
330 @seealso
331
332 Snippets: @lsrdir{Editorial,Editorial-annotations}.
333
334
335 @node Stems
336 @subsubsection Stems
337
338 @cindex stem
339
340 Whenever a note is found, a @code{Stem} object is created
341 automatically.  For whole notes and rests, they are also created but
342 made invisible.
343
344 @predefined
345
346 @funindex \stemUp
347 @code{\stemUp},
348 @funindex \stemDown
349 @code{\stemDown},
350 @funindex \stemNeutral
351 @code{\stemNeutral}.
352
353
354 @snippets
355
356 @cindex stem, direction
357 @cindex stem, up
358 @cindex stem, down
359 @cindex stem, neutral
360
361 To change the direction of stems on the center line of the staff, use
362
363 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
364 a4 b c b
365 \override Stem #'neutral-direction = #up
366 a4 b c b
367 \override Stem #'neutral-direction = #down
368 a4 b c b
369 @end lilypond
370
371 @seealso
372
373 Snippets: @lsrdir{Editorial,Editorial-annotations}.
374
375
376 @node Outside the staff
377 @subsection Outside the staff
378
379 This section discusses how to add emphasis to elements in the staff 
380 from outside of the staff. 
381
382 @menu
383 * Balloon help::                
384 * Grid lines::                  
385 * Analysis brackets::           
386 @end menu
387
388 @node Balloon help
389 @subsubsection Balloon help
390
391 Elements of notation can be marked and named with the help of a
392 square balloon.  The primary purpose of this feature is to explain
393 notation.
394
395 The following example demonstrates its use.
396
397 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
398 \new Voice \with { \consists "Balloon_engraver" }
399      {
400       \time 2/4
401        \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
402        a8
403        <c, g'-\balloonText #'(-2 . -2) \markup { "I'm a note head" } 
404 c>4. 
405      }
406
407 @end lilypond
408
409 There are two music functions, @code{balloonGrobText} and
410 @code{balloonText};  The former is used like \once \override to 
411 attach text to any grob, and the latter is used like \tweak, 
412 typically within chords, to attach text to an individual note.
413
414 @cindex balloon
415 @cindex notation, explaining
416
417 @seealso
418
419 Snippets: @lsrdir{Editorial,Editorial-annotations}.
420
421 Internals Reference: @internalsref{text-balloon-interface}.
422
423
424 @node Grid lines
425 @subsubsection Grid lines
426
427 Vertical lines can be drawn between staves synchronized with the
428 notes.
429
430 @lilypond[ragged-right,quote,verbatim]
431 \layout {
432   \context {
433     \Staff
434     \consists "Grid_point_engraver" 
435     % sets up grids
436     gridInterval = #(ly:make-moment 1 4)
437     % this sets the grid interval to 1 quarternote (crotchet)
438   }
439 }
440
441 \new Score \with {
442   \consists "Grid_line_span_engraver"
443   %% by default this centers grid lines horizontally below and to the 
444   % left side of the notehead, the grid lines extend from 
445   % the middle lines of each staff
446 }
447
448 \new ChoirStaff <<
449   \new Staff {
450     \stemUp
451     \relative {
452       c'4. d8 e8 f g4
453     }
454   }
455   \new Staff {
456     \stemDown
457     \clef bass
458     \relative c {
459       c4  g'  f  e
460     }
461   }
462 >>
463 @end lilypond
464
465 To change the grid lines use \override.
466
467
468 @lilypond[ragged-right,quote,verbatim]
469 \layout {
470   \context {
471     \Staff
472     \consists "Grid_point_engraver" 
473     % sets up grids
474        gridInterval = #(ly:make-moment 1 4)
475        % this sets the grid interval to 1 quarternote (crotchet)
476   }
477 }
478
479 \new Score \with {
480   \consists "Grid_line_span_engraver"
481   \override NoteColumn #'X-offset = #-0.5
482   % this moves them to the right half a staff space
483 }
484
485 \new ChoirStaff <<
486   \new Staff {
487     \stemUp
488     \relative {
489       c'4. d8 e8 f g4
490     }
491   }
492   \new Staff {
493     \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
494     % this moves them up one staff space from the default position
495     \stemDown
496     \clef bass
497     \relative c {
498       c4  g'  f  e
499     }
500   }
501 >>
502 @end lilypond
503
504 @seealso
505
506 Snippets: @lsrdir{Editorial,Editorial-annotations}.
507
508
509
510
511 @node Analysis brackets
512 @subsubsection Analysis brackets
513
514 @cindex brackets
515 @cindex phrasing brackets
516 @cindex musicological analysis
517 @cindex note grouping bracket
518
519 Brackets are used in musical analysis to indicate structure in musical
520 pieces.  LilyPond supports a simple form of nested horizontal
521 brackets.  To use this, add the @code{Horizontal_bracket_engraver} to
522 the @code{Staff} context.  A bracket is started with
523 @code{\startGroup} and closed with @code{\stopGroup}.
524
525 @lilypond[quote,ragged-right,verbatim]
526 \score {
527   \relative c'' {
528     c4\startGroup\startGroup
529     c4\stopGroup
530     c4\startGroup
531     c4\stopGroup\stopGroup
532   }
533   \layout {
534     \context {
535       \Staff \consists "Horizontal_bracket_engraver"
536     }
537   }
538 }
539 @end lilypond
540
541 @seealso
542
543 Snippets: @lsrdir{Editorial,Editorial-annotations}.
544
545 Internals Reference: @internalsref{HorizontalBracket},
546 @internalsref{Horizontal_bracket_engraver}, @internalsref{Staff}.
547