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