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