]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/editorial.itely
Merge branch 'master' of git://git.sv.gnu.org/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 @unnumberedsubsubsec 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=1,verbatim]
45 c8
46 \set fontSize = #-4
47 c f
48 \set fontSize = #3
49 g
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=1,verbatim]
69 c8
70 \override NoteHead #'font-size = #-4
71 c f
72 \override NoteHead #'font-size = #3
73 g
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 @unnumberedsubsubsec Fingering instructions
108
109 @cindex fingering
110 @cindex finger change
111
112 Fingering instructions can be entered using
113
114 @example
115 @var{note}-@var{digit}
116 @end example
117
118 For finger changes, use markup texts
119
120 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
121 c4-1 c-2 c-3 c-4
122 c^\markup { \finger "2 - 3" }
123 @end lilypond
124
125 @cindex thumb-script
126
127
128 You can use the thumb-script to indicate that a note should be
129 played with the thumb (e.g., in cello music)
130
131 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
132 <a_\thumb a'-3>8 <b_\thumb b'-3>
133 @end lilypond
134
135 @cindex fingering chords
136 @cindex chords, fingering
137
138 Fingerings for chords can also be added to individual notes of the
139 chord by adding them after the pitches
140
141 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
142 < c-1 e-2 g-3 b-5 >4
143 @end lilypond
144
145
146 @commonprop
147
148 You may exercise greater control over fingering chords by setting
149 @code{fingeringOrientations}
150
151 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
152 \set fingeringOrientations = #'(left down)
153 <c-1 es-2 g-4 bes-5 > 4
154 \set fingeringOrientations = #'(up right down)
155 <c-1 es-2 g-4 bes-5 > 4
156 @end lilypond
157
158 Using this feature, it is also possible to put fingering
159 instructions very close to note heads in monophonic music,
160
161 @lilypond[verbatim,ragged-right,quote,fragment]
162 \set fingeringOrientations = #'(right)
163 <es'-2>4
164 @end lilypond
165
166
167 @seealso
168
169 Snippets: @lsrdir{Editorial,Editorial-annotations}.
170
171 Internals Reference: @internalsref{Fingering}.
172
173
174 @node Hidden notes
175 @unnumberedsubsubsec Hidden notes
176
177 @cindex Hidden notes
178 @cindex Invisible notes
179 @cindex Transparent notes
180
181 @funindex \hideNotes
182 @funindex \unHideNotes
183
184 Hidden (or invisible or transparent) notes can be useful in
185 preparing theory or composition exercises.
186
187 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
188 c4 d4
189 \hideNotes
190 e4 f4
191 \unHideNotes
192 g4 a
193 @end lilypond
194
195 @seealso
196
197 Snippets: @lsrdir{Editorial,Editorial-annotations}.
198
199
200 @node Coloring objects
201 @unnumberedsubsubsec Coloring objects
202
203 @cindex colored objects
204 @cindex colors
205 @cindex coloring objects
206 @cindex colored notes
207 @cindex coloring notes
208 @cindex notes, colored
209
210 Individual objects may be assigned colors.  You may use the color
211 names listed in the @ref{List of colors}.
212
213 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
214 \override NoteHead #'color = #red
215 c4 c
216 \override NoteHead #'color = #(x11-color 'LimeGreen)
217 d
218 \override Stem #'color = #blue
219 e
220 @end lilypond
221
222 @cindex x11-color
223
224 The full range of colors defined for X11 can be accessed by using
225 the Scheme function x11-color.  The function takes one argument
226 that can be a symbol
227
228 @example
229 \override Beam #'color = #(x11-color 'MediumTurquoise)
230 @end example
231
232 or a string
233
234 @example
235 \override Beam #'color = #(x11-color "MediumTurquoise")
236 @end example
237
238 The first form is quicker to write and is more efficient.
239 However, using the second form it is possible to access X11 colors
240 by the multi-word form of its name
241
242 @example
243 \override Beam #'color = #(x11-color "medium turquoise")
244 @end example
245
246 If x11-color cannot make sense of the parameter then the color
247 returned defaults to black.  It should be obvious from the final
248 score that something is wrong.
249
250 This example illustrates the use of x11-color.  Notice that the
251 stem color remains black after being set to (x11-color 'Boggle),
252 which is deliberate nonsense.
253
254 @lilypond[quote,ragged-right,verbatim]
255 {
256   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
257   \set Staff.instrumentName = \markup {
258     \with-color #(x11-color 'navy) "Clarinet"
259   }
260   \time 2/4
261   gis''8 a''
262   \override Beam #'color = #(x11-color "medium turquoise")
263   gis'' a''
264   \override NoteHead #'color = #(x11-color "LimeGreen")
265   gis'' a''
266   \override Stem #'color = #(x11-color 'Boggle)
267   gis'' a''
268 }
269 @end lilypond
270
271
272 TODO
273 you can get exact RGB colors by specifying
274
275 % black
276 \override Stem #'color = #(rgb-color 0 0 0)
277 % white
278 \override Stem #'color = #(rgb-color 1 1 1)
279 % dark blue
280 \override Stem #'color = #(rgb-color 0 0 0.5) 
281
282
283 @seealso
284
285 Notation Reference: @ref{List of colors}, @ref{Objects connected to
286 the input}.
287
288 Snippets: @lsrdir{Editorial,Editorial-annotations}.
289
290 @refbugs
291 Not all x11 colors are distinguishable in a web browser.  For web
292 use normal colors are recommended.
293
294 An x11 color is not necessarily exactly the same shade as a
295 similarly named normal color.
296
297 Notes in a chord cannot be colored with @code{\override}; use
298 @code{\tweak} instead.  See @ref{Objects connected to the input},
299 for details.
300
301
302 @node Parentheses
303 @unnumberedsubsubsec Parentheses
304
305 @cindex ghost notes
306 @cindex notes, ghost
307 @cindex notes, parenthesized
308 @cindex parentheses
309
310 Objects may be parenthesized by prefixing @code{\parenthesize} to
311 the music event,
312
313 @lilypond[relative=2,fragment,verbatim,ragged-right]
314 <
315   c
316   \parenthesize d
317   g
318 >4-\parenthesize -.
319 @end lilypond
320
321 This only functions inside chords, to parenthesize a single note it 
322 must be enclosed with @code{<>} as if it is a chord.
323
324 @example
325 < \parenthesize NOTE>
326 @end example
327
328 @seealso
329
330 Snippets: @lsrdir{Editorial,Editorial-annotations}.
331
332
333 @node Stems
334 @unnumberedsubsubsec Stems
335
336 @cindex stem
337
338 Whenever a note is found, a @code{Stem} object is created
339 automatically.  For whole notes and rests, they are also created but
340 made invisible.
341
342 @refcommands
343
344 @funindex \stemUp
345 @code{\stemUp},
346 @funindex \stemDown
347 @code{\stemDown},
348 @funindex \stemNeutral
349 @code{\stemNeutral}.
350
351
352 @commonprop
353
354 @cindex stem, direction
355 @cindex stem, up
356 @cindex stem, down
357 @cindex stem, neutral
358
359 To change the direction of stems on the center line of the staff, use
360
361 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
362 a4 b c b
363 \override Stem #'neutral-direction = #up
364 a4 b c b
365 \override Stem #'neutral-direction = #down
366 a4 b c b
367 @end lilypond
368
369 @seealso
370
371 Snippets: @lsrdir{Editorial,Editorial-annotations}.
372
373
374 @node Outside the staff
375 @subsection Outside the staff
376
377
378 @menu
379 * Balloon help::                
380 * Grid lines::                  
381 * Blank music sheet::           
382 * Analysis brackets::           
383 @end menu
384
385 @node Balloon help
386 @unnumberedsubsubsec Balloon help
387
388 Elements of notation can be marked and named with the help of a
389 square balloon.  The primary purpose of this feature is to explain
390 notation.
391
392 The following example demonstrates its use.
393
394 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
395 \new Voice \with { \consists "Balloon_engraver" }
396 {
397   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
398   <f-\balloonText #'(-2 . -2) \markup { "I'm a note head" }  >8
399 }
400 @end lilypond
401
402 @noindent
403 There are two music functions, @code{balloonGrobText} and
404 @code{balloonText}; the former takes the name of the grob to adorn,
405 while the latter may be used as an articulation on a note.  The other
406 arguments are the offset and the text of the label.
407
408 @cindex balloon
409 @cindex notation, explaining
410
411 @seealso
412
413 Snippets: @lsrdir{Editorial,Editorial-annotations}.
414
415 Internals Reference: @internalsref{text-balloon-interface}.
416
417
418 @node Grid lines
419 @unnumberedsubsubsec Grid lines
420
421 Vertical lines can be drawn between staves synchronized with the
422 notes.
423
424 @lilypond[ragged-right,quote,verbatim]
425 \layout {
426   \context {
427     \Staff
428     \consists "Grid_point_engraver" %% sets of grid
429     gridInterval = #(ly:make-moment 1 4)
430   }
431 }
432
433 \new Score \with {
434   \consists "Grid_line_span_engraver"
435   %% centers grid lines  horizontally below note heads
436   \override NoteColumn #'X-offset = #-0.5
437 }
438
439 \new ChoirStaff <<
440   \new Staff {
441     \stemUp
442     \relative {
443       c'4. d8 e8 f g4
444     }
445   }
446   \new Staff {
447     %% centers grid lines  vertically
448     \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
449     \stemDown
450     \clef bass
451     \relative c {
452       c4  g'  f  e
453     }
454   }
455 >>
456 @end lilypond
457
458 @seealso
459
460 Snippets: @lsrdir{Editorial,Editorial-annotations}.
461
462
463 @node Blank music sheet
464 @unnumberedsubsubsec Blank music sheet
465
466 @cindex sheet music, empty
467 @cindex staves, blank sheet
468 @cindex blank staff paper
469 @cindex staff paper, blank
470
471 A blank music sheet can be produced also by using invisible notes,
472 and removing @code{Bar_number_engraver}.
473
474
475 @lilypond[quote,verbatim]
476 \layout{ indent = #0 }
477 emptymusic = {
478   \repeat unfold 2 % Change this for more lines.
479   { s1\break }
480   \bar "|."
481 }
482 \new Score \with {
483   \override TimeSignature #'transparent = ##t
484 % un-comment this line if desired
485 %  \override Clef #'transparent = ##t
486   defaultBarType = #""
487   \remove Bar_number_engraver
488 } <<
489
490 % modify these to get the staves you want
491   \new Staff \emptymusic
492   \new TabStaff \emptymusic
493 >>
494 @end lilypond
495
496 @seealso
497
498 Snippets: @lsrdir{Editorial,Editorial-annotations}.
499
500
501 @node Analysis brackets
502 @unnumberedsubsubsec Analysis brackets
503
504 @cindex brackets
505 @cindex phrasing brackets
506 @cindex musicological analysis
507 @cindex note grouping bracket
508
509 Brackets are used in musical analysis to indicate structure in musical
510 pieces.  LilyPond supports a simple form of nested horizontal
511 brackets.  To use this, add the @code{Horizontal_bracket_engraver} to
512 the @code{Staff} context.  A bracket is started with
513 @code{\startGroup} and closed with @code{\stopGroup}.
514
515 @lilypond[quote,ragged-right,verbatim]
516 \score {
517   \relative c'' {
518     c4\startGroup\startGroup
519     c4\stopGroup
520     c4\startGroup
521     c4\stopGroup\stopGroup
522   }
523   \layout {
524     \context {
525       \Staff \consists "Horizontal_bracket_engraver"
526 }}}
527 @end lilypond
528
529 @seealso
530
531 Snippets: @lsrdir{Editorial,Editorial-annotations}.
532
533 Internals Reference: @internalsref{HorizontalBracket},
534 @internalsref{Horizontal_bracket_engraver}, @internalsref{Staff}.
535
536