]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/educational.itely
Move Ambitus from educational into pitches.
[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 Educational use
10 @section Educational use
11
12 @menu
13 * Note heads::                  
14 * Inside the staff::            
15 * Outside the staff::           
16 @end menu
17
18
19 @node Note heads
20 @subsection Note heads
21
22 @menu
23 * Easy notation note heads::    
24 * Shape note heads::            
25 * Improvisation::               
26 * Special noteheads::           
27 @end menu
28
29 @node Easy notation note heads
30 @unnumberedsubsubsec Easy notation note heads
31
32 @cindex note heads, practice
33 @cindex note heads, easy notation
34 @cindex easy notation
35 @cindex Hal Leonard
36
37 The @q{easy play} note head includes a note name inside the head.
38 It is used in music for beginners
39
40 @lilypond[quote,ragged-right,verbatim,fragment,staffsize=26]
41   \setEasyHeads
42   c'2 e'4 f' | g'1
43 @end lilypond
44
45 The command @code{\setEasyHeads} overrides settings for the
46 @internalsref{NoteHead} object.  To make the letters readable, it
47 has to be printed in a large font size.  To print with a larger
48 font, see @ref{Setting the staff size}.
49
50 @refcommands
51
52 @funindex \setEasyHeads
53 @code{\setEasyHeads}
54
55
56 @node Shape note heads
57 @unnumberedsubsubsec Shape note heads
58
59 @cindex note heads, shape
60
61 In shape note head notation, the shape of the note head
62 corresponds to the harmonic function of a note in the scale.  This
63 notation was popular in the 19th century American song books.
64
65 Shape note heads can be produced by setting @code{\aikenHeads} or
66 @code{\sacredHarpHeads}, depending on the style desired.
67
68 @lilypond[verbatim,relative=1,fragment]
69   \aikenHeads
70   c8 d4 e8 a2 g1
71   \sacredHarpHeads
72   c8 d4. e8 a2 g1
73 @end lilypond
74
75 Shapes are determined on the step in the scale, where the base of
76 the scale is determined by  the @code{\key} command
77
78 @funindex \key
79 @funindex shapeNoteStyles
80 @funindex \aikenHeads
81 @funindex \sacredHarpHeads
82
83 Shape note heads are implemented through the
84 @code{shapeNoteStyles} property.  Its value is a vector of
85 symbols.  The k-th element indicates the style to use for the k-th
86 step of the scale.  Arbitrary combinations are possible, e.g.
87
88 @lilypond[verbatim,relative=1,fragment]
89 \set shapeNoteStyles =
90   ##(cross triangle fa #f mensural xcircle diamond)
91 c8 d4. e8 a2 g1
92 @end lilypond
93
94
95 @node Improvisation
96 @unnumberedsubsubsec Improvisation
97
98 Improvisation is sometimes denoted with slashed note heads.  Such
99 note heads can be created by adding a
100 @internalsref{Pitch_squash_engraver} to the @internalsref{Voice}
101 context.  Then, the following command
102
103 @example
104 \set squashedPosition = #0
105 \override NoteHead #'style = #'slash
106 @end example
107
108 @noindent
109 switches on the slashes.
110
111 There are shortcuts @code{\improvisationOn} (and an accompanying
112 @code{\improvisationOff}) for this command sequence.  They are
113 used in the following example
114
115 @lilypond[verbatim,ragged-right,quote]
116 \new Voice \with {
117   \consists Pitch_squash_engraver
118 } \transpose c c' {
119   e8 e g a a16(bes)(a8) g \improvisationOn
120   e8
121   ~e2~e8 f4 fis8
122   ~fis2 \improvisationOff a16(bes) a8 g e
123 }
124 @end lilypond
125
126
127 @node Special noteheads
128 @unnumberedsubsubsec Special noteheads
129
130 @cindex note heads, special
131
132 Different noteheads are used by various instruments for various
133 meanings -- crosses are used for @q{parlato} with vocalists,
134 stopped notes on guitar; diamonds are used for harmonics on string
135 instruments, etc.  There is a shorthand (@code{\harmonic}) for
136 diamond shapes; the other notehead styles are produced by tweaking
137 the property
138
139 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
140 c4 d
141 \override NoteHead #'style = #'cross
142 e f
143 \revert NoteHead #'style
144 e d <c f\harmonic> <d a'\harmonic>
145 @end lilypond
146
147 @noindent
148 To see all notehead styles, please see @ref{Note head styles}.
149
150
151 @seealso
152
153 Internals Reference: @internalsref{NoteHead}.
154
155
156
157 @node Inside the staff
158 @subsection Inside the staff
159
160
161 @menu
162 * Selecting notation font size::  
163 * Fingering instructions::      
164 * Hidden notes::                
165 * Coloring objects::            
166 * Parentheses::                 
167 * Stems::                       
168 @end menu
169
170 @node Selecting notation font size
171 @unnumberedsubsubsec Selecting notation font size
172
173 The easiest method of setting the font size of any context is by
174 setting the @code{fontSize} property.
175
176 @lilypond[quote,fragment,relative=1,verbatim]
177 c8
178 \set fontSize = #-4
179 c f
180 \set fontSize = #3
181 g
182 @end lilypond
183
184 @noindent
185 It does not change the size of variable symbols, such as beams or
186 slurs.
187
188 Internally, the @code{fontSize} context property will cause the
189 @code{font-size} property to be set in all layout objects.  The
190 value of @code{font-size} is a number indicating the size relative
191 to the standard size for the current staff height.  Each step up
192 is an increase of approximately 12% of the font size.  Six steps
193 is exactly a factor two.  The Scheme function @code{magstep}
194 converts a @code{font-size} number to a scaling factor.  The
195 @code{font-size} property can also be set directly, so that only
196 certain layout objects are affected.
197
198 @lilypond[quote,fragment,relative=1,verbatim]
199 c8
200 \override NoteHead #'font-size = #-4
201 c f
202 \override NoteHead #'font-size = #3
203 g
204 @end lilypond
205
206 Font size changes are achieved by scaling the design size that is
207 closest to the desired size.  The standard font size (for
208 @code{font-size} equals 0), depends on the standard staff height.
209 For a 20pt staff, a 10pt font is selected.
210
211 The @code{font-size} property can only be set on layout objects
212 that use fonts.  These are the ones supporting the
213 @internalsref{font-interface} layout interface.
214
215 @refcommands
216
217 The following commands set @code{fontSize} for the current voice:
218
219 @funindex \tiny
220 @code{\tiny},
221 @funindex \small
222 @code{\small},
223 @funindex \normalsize
224 @code{\normalsize}.
225
226
227 @node Fingering instructions
228 @unnumberedsubsubsec Fingering instructions
229
230 @cindex fingering
231 @cindex finger change
232
233 Fingering instructions can be entered using
234
235 @example
236 @var{note}-@var{digit}
237 @end example
238
239 For finger changes, use markup texts
240
241 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
242 c4-1 c-2 c-3 c-4
243 c^\markup { \finger "2 - 3" }
244 @end lilypond
245
246 You can use the thumb-script to indicate that a note should be
247 played with the thumb (e.g., in cello music)
248
249 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
250 <a_\thumb a'-3>8 <b_\thumb b'-3>
251 @end lilypond
252
253 Fingerings for chords can also be added to individual notes of the
254 chord by adding them after the pitches
255
256 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
257 < c-1 e-2 g-3 b-5 >4
258 @end lilypond
259
260
261 @commonprop
262
263 You may exercise greater control over fingering chords by setting
264 @code{fingeringOrientations}
265
266 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
267 \set fingeringOrientations = #'(left down)
268 <c-1 es-2 g-4 bes-5 > 4
269 \set fingeringOrientations = #'(up right down)
270 <c-1 es-2 g-4 bes-5 > 4
271 @end lilypond
272
273 Using this feature, it is also possible to put fingering
274 instructions very close to note heads in monophonic music,
275
276 @lilypond[verbatim,ragged-right,quote,fragment]
277 \set fingeringOrientations = #'(right)
278 <es'-2>4
279 @end lilypond
280
281
282 @seealso
283
284 Internals Reference: @internalsref{Fingering}.
285
286 Examples: @lsr{expressive,fingering-chords.ly}
287
288
289
290 @node Hidden notes
291 @unnumberedsubsubsec Hidden notes
292
293 @cindex Hidden notes
294 @cindex Invisible notes
295 @cindex Transparent notes
296
297 @funindex \hideNotes
298 @funindex \unHideNotes
299
300 Hidden (or invisible or transparent) notes can be useful in
301 preparing theory or composition exercises.
302
303 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
304 c4 d4
305 \hideNotes
306 e4 f4
307 \unHideNotes
308 g4 a
309 @end lilypond
310
311
312 @node Coloring objects
313 @unnumberedsubsubsec Coloring objects
314
315 Individual objects may be assigned colors.  You may use the color
316 names listed in the @ref{List of colors}.
317
318 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
319 \override NoteHead #'color = #red
320 c4 c
321 \override NoteHead #'color = #(x11-color 'LimeGreen)
322 d
323 \override Stem #'color = #blue
324 e
325 @end lilypond
326
327 The full range of colors defined for X11 can be accessed by using
328 the Scheme function x11-color.  The function takes one argument
329 that can be a symbol
330
331 @example
332 \override Beam #'color = #(x11-color 'MediumTurquoise)
333 @end example
334
335 or a string
336
337 @example
338 \override Beam #'color = #(x11-color "MediumTurquoise")
339 @end example
340
341 The first form is quicker to write and is more efficient.
342 However, using the second form it is possible to access X11 colors
343 by the multi-word form of its name
344
345 @example
346 \override Beam #'color = #(x11-color "medium turquoise")
347 @end example
348
349 If x11-color cannot make sense of the parameter then the color
350 returned defaults to black.  It should be obvious from the final
351 score that something is wrong.
352
353 This example illustrates the use of x11-color.  Notice that the
354 stem color remains black after being set to (x11-color 'Boggle),
355 which is deliberate nonsense.
356
357 @lilypond[quote,ragged-right,verbatim]
358 {
359   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
360   \set Staff.instrumentName = \markup {
361     \with-color #(x11-color 'navy) "Clarinet"
362   }
363   \time 2/4
364   gis''8 a''
365   \override Beam #'color = #(x11-color "medium turquoise")
366   gis'' a''
367   \override NoteHead #'color = #(x11-color "LimeGreen")
368   gis'' a''
369   \override Stem #'color = #(x11-color 'Boggle)
370   gis'' a''
371 }
372 @end lilypond
373
374
375 TODO
376 you can get exact RGB colors by specifying
377
378 % black
379 \override Stem #'color = #(rgb-color 0 0 0)
380 % white
381 \override Stem #'color = #(rgb-color 1 1 1)
382 % dark blue
383 \override Stem #'color = #(rgb-color 0 0 0.5) 
384
385
386 @seealso
387
388 Appendix: @ref{List of colors}.
389
390
391 @refbugs
392 Not all x11 colors are distinguishable in a web browser.  For web
393 use normal colors are recommended.
394
395 An x11 color is not necessarily exactly the same shade as a
396 similarly named normal color.
397
398 Notes in a chord cannot be colored with @code{\override}; use
399 @code{\tweak} instead.  See @ref{Objects connected to the input},
400 for details.
401
402
403 @node Parentheses
404 @unnumberedsubsubsec Parentheses
405
406 @cindex ghost notes
407 @cindex notes, ghost
408 @cindex notes, parenthesized
409
410 Objects may be parenthesized by prefixing @code{\parenthesize} to
411 the music event,
412
413 @lilypond[relative=2,fragment,verbatim,ragged-right]
414 <
415   c
416   \parenthesize d
417   g
418 >4-\parenthesize -.
419 @end lilypond
420
421 This only functions inside chords, even for single notes
422
423 @example
424 < \parenthesize NOTE>
425 @end example
426
427
428 @node Stems
429 @unnumberedsubsubsec Stems
430
431 Whenever a note is found, a @internalsref{Stem} object is created
432 automatically.  For whole notes and rests, they are also created
433 but made invisible.
434
435 @refcommands
436
437 @funindex \stemUp
438 @code{\stemUp},
439 @funindex \stemDown
440 @code{\stemDown},
441 @funindex \stemNeutral
442 @code{\stemNeutral}.
443
444
445 @commonprop
446
447 To change the direction of stems in the middle of the staff, use
448
449 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
450 a4 b c b
451 \override Stem #'neutral-direction = #up
452 a4 b c b
453 \override Stem #'neutral-direction = #down
454 a4 b c b
455 @end lilypond
456
457
458 @node Outside the staff
459 @subsection Outside the staff
460
461
462 @menu
463 * Balloon help::                
464 * Grid lines::                  
465 * Blank music sheet::           
466 @end menu
467
468 @node Balloon help
469 @unnumberedsubsubsec Balloon help
470
471 Elements of notation can be marked and named with the help of a
472 square balloon.  The primary purpose of this feature is to explain
473 notation.
474
475 The following example demonstrates its use.
476
477 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
478 \new Voice \with { \consists "Balloon_engraver" }
479 {
480   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
481   <c-\balloonText #'(-2 . -2) \markup { Hello }  >8
482 }
483 @end lilypond
484
485 @noindent
486 There are two music functions, @code{balloonText} and
487 @code{balloonGrobText}.  The latter takes the name of the grob to
488 adorn, while the former may be used as an articulation on a note.
489 The other arguments  are the offset and the text of the label.
490
491 @cindex balloon
492 @cindex notation, explaining
493
494 @seealso
495
496 Internals Reference: @internalsref{text-balloon-interface}.
497
498
499 @node Grid lines
500 @unnumberedsubsubsec Grid lines
501
502 Vertical lines can be drawn between staves synchronized with the
503 notes.
504
505 @lilypond[ragged-right,quote,verbatim]
506 \layout {
507   \context {
508     \Staff
509     \consists "Grid_point_engraver" %% sets of grid
510     gridInterval = #(ly:make-moment 1 4)
511   }
512 }
513
514 \new Score \with {
515   \consists "Grid_line_span_engraver"
516   %% centers grid lines  horizontally below noteheads
517   \override NoteColumn #'X-offset = #-0.5
518 }
519
520 \new ChoirStaff <<
521   \new Staff {
522     \stemUp
523     \relative {
524       c'4. d8 e8 f g4
525     }
526   }
527   \new Staff {
528     %% centers grid lines  vertically
529     \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
530     \stemDown
531     \clef bass
532     \relative c {
533       c4  g'  f  e
534     }
535   }
536 >>
537 @end lilypond
538
539 Examples: @lsrdir{education}
540
541
542 @node Blank music sheet
543 @unnumberedsubsubsec Blank music sheet
544
545 @cindex Sheet music, empty
546 @cindex Staves, blank sheet
547
548 A blank music sheet can be produced also by using invisible notes,
549 and removing @code{Bar_number_engraver}.
550
551
552 @lilypond[quote,verbatim]
553 \layout{ indent = #0 }
554 emptymusic = {
555   \repeat unfold 2 % Change this for more lines.
556   { s1\break }
557   \bar "|."
558 }
559 \new Score \with {
560   \override TimeSignature #'transparent = ##t
561 % un-comment this line if desired
562 %  \override Clef #'transparent = ##t
563   defaultBarType = #""
564   \remove Bar_number_engraver
565 } <<
566
567 % modify these to get the staves you want
568   \new Staff \emptymusic
569   \new TabStaff \emptymusic
570 >>
571 @end lilypond
572
573
574