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