]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/educational.itely
Move translated docs into Pitches and Rhythms
[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.  It is
38 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 has
47 to be printed in a large font size.  To print with a larger font, see
48 @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 corresponds
62 to the harmonic function of a note in the scale.  This notation was
63 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 the
76 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 @code{shapeNoteStyles}
84 property.  Its value is a vector of symbols.  The k-th element indicates
85 the style to use for the k-th step of the scale.  Arbitrary
86 combinations are possible, e.g.
87
88 @lilypond[verbatim,relative=1,fragment]
89   \set shapeNoteStyles  = ##(cross triangle fa #f mensural xcircle diamond)
90   c8 d4. e8 a2 g1
91 @end lilypond
92
93
94 @node Improvisation
95 @unnumberedsubsubsec Improvisation
96
97 Improvisation is sometimes denoted with slashed note heads.  Such note
98 heads can be created by adding a @internalsref{Pitch_squash_engraver}
99 to the @internalsref{Voice} context.  Then, the
100 following command
101
102 @example
103 \set squashedPosition = #0
104 \override NoteHead #'style = #'slash
105 @end example
106
107 @noindent
108 switches on the slashes.
109
110 There are shortcuts @code{\improvisationOn} (and an accompanying
111 @code{\improvisationOff}) for this command sequence.  They are used in
112 the following example
113
114 @lilypond[verbatim,ragged-right,quote]
115 \new Voice \with {
116   \consists Pitch_squash_engraver
117 } \transpose c c' {
118   e8 e g a a16(bes)(a8) g \improvisationOn
119   e8
120   ~e2~e8 f4 fis8
121   ~fis2 \improvisationOff a16(bes) a8 g e
122 }
123 @end lilypond
124
125
126 @node Special noteheads
127 @unnumberedsubsubsec Special noteheads
128
129 @cindex note heads, special
130
131 Different noteheads are used by various instruments for various
132 meanings -- crosses are used for @q{parlato} with vocalists, stopped
133 notes on guitar; diamonds are used for harmonics on string instruments,
134 etc.  There is a shorthand (@code{\harmonic}) for diamond shapes; the
135 other notehead styles are produced by tweaking the property
136
137 @lilypond[ragged-right,relative=1,fragment,verbatim,quote]
138 c4 d
139 \override NoteHead #'style = #'cross
140 e f
141 \revert NoteHead #'style
142 e d <c f\harmonic> <d a'\harmonic>
143 @end lilypond
144
145 @noindent
146 To see all notehead styles, please see
147 @ref{Note head styles}.
148
149
150 @seealso
151
152 Program reference: @internalsref{NoteHead}.
153
154
155
156 @node Inside the staff
157 @subsection Inside the staff
158
159
160 @menu
161 * Selecting notation font size::  
162 * Fingering instructions::      
163 * Hidden notes::                
164 * Coloring objects::            
165 * Parentheses::                 
166 * Ambitus::                     
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 value
190 of @code{font-size} is a number indicating the size relative to the
191 standard size for the current staff height.  Each step up is an
192 increase of approximately 12% of the font size.  Six steps is exactly a
193 factor two.  The Scheme function @code{magstep} converts a
194 @code{font-size} number to a scaling factor.  The @code{font-size}
195 property can also be set directly, so that only certain layout objects are
196 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.  For
209 a 20pt staff, a 10pt font is selected.
210
211 The @code{font-size} property can only be set on layout objects that
212 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 @example
235 @var{note}-@var{digit}
236 @end example
237 For finger changes, use markup texts
238
239 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
240 c4-1 c-2 c-3 c-4
241 c^\markup { \finger "2 - 3" }
242 @end lilypond
243
244 You can use the thumb-script to indicate that a note should be
245 played with the thumb (e.g., in cello music)
246 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
247 <a_\thumb a'-3>8 <b_\thumb b'-3>
248 @end lilypond
249
250 Fingerings for chords can also be added to individual notes
251 of the chord by adding them after the pitches
252 @lilypond[quote,verbatim,ragged-right,fragment,relative=2]
253 < c-1 e-2 g-3 b-5 >4
254 @end lilypond
255
256
257 @commonprop
258
259 You may exercise greater control over fingering chords by
260 setting @code{fingeringOrientations}
261
262 @lilypond[quote,verbatim,ragged-right,fragment,relative=1]
263 \set fingeringOrientations = #'(left down)
264 <c-1 es-2 g-4 bes-5 > 4
265 \set fingeringOrientations = #'(up right down)
266 <c-1 es-2 g-4 bes-5 > 4
267 @end lilypond
268
269 Using this feature, it is also possible to put fingering instructions
270 very close to note heads in monophonic music,
271
272 @lilypond[verbatim,ragged-right,quote,fragment]
273 \set fingeringOrientations = #'(right)
274 <es'-2>4
275 @end lilypond
276
277
278 @seealso
279
280 Program reference: @internalsref{Fingering}.
281
282 Examples: @lsr{expressive,fingering-chords.ly}
283
284
285
286 @node Hidden notes
287 @unnumberedsubsubsec Hidden notes
288
289 @cindex Hidden notes
290 @cindex Invisible notes
291 @cindex Transparent notes
292
293 @funindex \hideNotes
294 @funindex \unHideNotes
295 Hidden (or invisible or transparent) notes can be useful in preparing theory
296 or composition exercises.
297
298 @lilypond[quote,ragged-right,verbatim,relative=2,fragment]
299 c4 d4
300 \hideNotes
301 e4 f4
302 \unHideNotes
303 g4 a
304 @end lilypond
305
306
307 @node Coloring objects
308 @unnumberedsubsubsec Coloring objects
309
310 Individual objects may be assigned colors.  You may use the
311 color names listed in the @ref{List of colors}.
312
313 @lilypond[quote,ragged-right,verbatim,fragment,relative=1]
314 \override NoteHead #'color = #red
315 c4 c
316 \override NoteHead #'color = #(x11-color 'LimeGreen)
317 d
318 \override Stem #'color = #blue
319 e
320 @end lilypond
321
322 The full range of colors defined for X11 can be accessed by using the
323 Scheme function x11-color.  The function takes one argument that can be a
324 symbol
325
326 @example
327 \override Beam #'color = #(x11-color 'MediumTurquoise)
328 @end example
329
330 or a string
331
332 @example
333 \override Beam #'color = #(x11-color "MediumTurquoise")
334 @end example
335
336 The first form is quicker to write and is more efficient.  However, using
337 the second form it is possible to access X11 colors by the multi-word
338 form of its name
339
340 @example
341 \override Beam #'color = #(x11-color "medium turquoise")
342 @end example
343
344 If x11-color cannot make sense of the parameter then the color returned
345 defaults to black.  It should be obvious from the final score that
346 something is wrong.
347
348 This example illustrates the use of x11-color.  Notice that the stem
349 color remains black after being set to (x11-color 'Boggle), which is
350 deliberate nonsense.
351
352 @lilypond[quote,ragged-right,verbatim]
353 {
354   \override Staff.StaffSymbol #'color = #(x11-color 'SlateBlue2)
355   \set Staff.instrumentName = \markup {
356     \with-color #(x11-color 'navy) "Clarinet"
357   }
358   \time 2/4
359   gis''8 a''
360   \override Beam #'color = #(x11-color "medium turquoise")
361   gis'' a''
362   \override NoteHead #'color = #(x11-color "LimeGreen")
363   gis'' a''
364   \override Stem #'color = #(x11-color 'Boggle)
365   gis'' a''
366 }
367 @end lilypond
368
369
370 @seealso
371
372 Appendix: @ref{List of colors}.
373
374
375 @refbugs
376 Not all x11 colors are distinguishable in a web browser.  For web use
377 normal colors are recommended.
378
379 An x11 color is not necessarily exactly the same shade as a similarly
380 named normal color.
381
382 Notes in a chord cannot be colored with @code{\override}; use
383 @code{\tweak} instead.  See @ref{Objects connected to the input},
384 for details.
385
386
387 @node Parentheses
388 @unnumberedsubsubsec Parentheses
389
390 @cindex ghost notes
391 @cindex notes, ghost
392 @cindex notes, parenthesized
393
394 Objects may be parenthesized by prefixing @code{\parenthesize} to the music
395 event,
396
397 @lilypond[relative=2,fragment,verbatim,ragged-right]
398 <
399   c
400   \parenthesize d
401   g
402 >4-\parenthesize -.
403 @end lilypond
404
405 This only functions inside chords, even for single notes
406
407 @example
408 < \parenthesize NOTE>
409 @end example
410
411
412 @node Ambitus
413 @unnumberedsubsubsec Ambitus
414 @cindex ambitus
415
416 The term @emph{ambitus} denotes a range of pitches for a given voice
417 in a part of music.  It may also denote the pitch range that a musical
418 instrument is capable of playing.  Ambits are printed on vocal parts,
419 so performers can easily determine it meets their capabilities.
420
421 Ambits are denoted at the beginning of a piece near the initial clef.
422 The range is graphically specified by two note heads that represent the
423 minimum and maximum pitch.  To print such ambits, add the
424 @internalsref{Ambitus_engraver} to the @internalsref{Voice} context,
425 for example,
426
427 @example
428 \layout @{
429   \context @{
430     \Voice
431     \consists Ambitus_engraver
432   @}
433 @}
434 @end example
435
436 This results in the following output
437
438 @lilypond[quote,ragged-right]
439 \layout {
440   \context {
441     \Staff
442     \consists Ambitus_engraver
443   }
444 }
445
446 \relative \new Staff {
447   as'' c e2 cis,2
448 }
449 @end lilypond
450
451 If you have multiple voices in a single staff and you want a single
452 ambitus per staff rather than per each voice, add the
453 @internalsref{Ambitus_engraver} to the @internalsref{Staff} context
454 rather than to the @internalsref{Voice} context.  Here is an example,
455
456 @lilypond[verbatim,ragged-right,quote]
457 \new Staff \with {
458   \consists "Ambitus_engraver"
459 }
460 <<
461   \new Voice \with {
462     \remove "Ambitus_engraver"
463   } \relative c'' {
464     \override Ambitus #'X-offset = #-1.0
465     \voiceOne
466     c4 a d e f2
467   }
468   \new Voice \with {
469     \remove "Ambitus_engraver"
470   } \relative c' {
471     \voiceTwo
472     es4 f g as b2
473   }
474 >>
475 @end lilypond
476
477 @noindent
478 This example uses one advanced feature,
479
480 @example
481 \override Ambitus #'X-offset = #-1.0
482 @end example
483
484 @noindent
485 This code moves the ambitus to the left.  The same effect could have
486 been achieved with @code{extra-offset}, but then the formatting system
487 would not reserve space for the moved object.
488
489 @seealso
490
491 Program reference: @internalsref{Ambitus},
492 @internalsref{AmbitusLine}, @internalsref{AmbitusNoteHead},
493 @internalsref{AmbitusAccidental}.
494
495 Examples:
496 @lsr{vocal,ambitus@/.ly}.
497
498 @refbugs
499
500 There is no collision handling in the case of multiple per-voice
501 ambitus.
502
503
504 @node Stems
505 @unnumberedsubsubsec Stems
506
507 Whenever a note is found, a @internalsref{Stem} object is created
508 automatically.  For whole notes and rests, they are also created but
509 made invisible.
510
511 @refcommands
512
513 @funindex \stemUp
514 @code{\stemUp},
515 @funindex \stemDown
516 @code{\stemDown},
517 @funindex \stemNeutral
518 @code{\stemNeutral}.
519
520
521 @commonprop
522
523 To change the direction of stems in the middle of the staff, use
524
525 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
526 a4 b c b
527 \override Stem #'neutral-direction = #up
528 a4 b c b
529 \override Stem #'neutral-direction = #down
530 a4 b c b
531 @end lilypond
532
533
534 @node Outside the staff
535 @subsection Outside the staff
536
537
538 @menu
539 * Balloon help::                
540 * Grid lines::                  
541 * Blank music sheet::           
542 @end menu
543
544 @node Balloon help
545 @unnumberedsubsubsec Balloon help
546
547 Elements of notation can be marked and named with the help of a square
548 balloon.  The primary purpose of this feature is to explain notation.
549
550 The following example demonstrates its use.
551
552 @lilypond[quote,verbatim,fragment,ragged-right,relative=2]
553 \new Voice \with { \consists "Balloon_engraver" }
554 {
555   \balloonGrobText #'Stem #'(3 . 4) \markup { "I'm a Stem" }
556   <c-\balloonText #'(-2 . -2) \markup { Hello }  >8
557 }
558 @end lilypond
559
560 @noindent
561 There are two music functions, @code{balloonText} and
562 @code{balloonGrobText}. The latter takes the name of the grob to
563 adorn, while the former may be used as an articulation on a note. 
564 The other arguments  are the offset and the text of the label.
565
566 @cindex balloon
567 @cindex notation, explaining
568
569 @seealso
570
571 Program reference: @internalsref{text-balloon-interface}.
572
573
574 @node Grid lines
575 @unnumberedsubsubsec Grid lines
576
577 Vertical lines can be drawn between staves synchronized with
578 the notes.
579
580 @lilypond[ragged-right,quote,verbatim]
581 \layout {
582   \context {
583     \Staff
584     \consists "Grid_point_engraver" %% sets of grid
585     gridInterval = #(ly:make-moment 1 4)
586   }
587 }
588
589 \new Score \with {
590   \consists "Grid_line_span_engraver"
591   %% centers grid lines  horizontally below noteheads
592   \override NoteColumn #'X-offset = #-0.5
593 }
594
595 \new ChoirStaff <<
596   \new Staff {
597     \stemUp
598     \relative {
599       c'4. d8 e8 f g4
600     }
601   }
602   \new Staff {
603     %% centers grid lines  vertically
604     \override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
605     \stemDown
606     \clef bass
607     \relative c {
608       c4  g'  f  e
609     }
610   }
611 >>
612 @end lilypond
613
614 Examples: @lsrdir{education}
615
616
617 @node Blank music sheet
618 @unnumberedsubsubsec Blank music sheet
619
620 @cindex Sheet music, empty
621 @cindex Staves, blank sheet
622
623 A blank music sheet can be produced also by using invisible notes, and
624 removing @code{Bar_number_engraver}.
625
626
627 @lilypond[quote,verbatim]
628 \layout{ indent = #0 }
629 emptymusic = {
630   \repeat unfold 2 % Change this for more lines.
631   { s1\break }
632   \bar "|."
633 }
634 \new Score \with {
635   \override TimeSignature #'transparent = ##t
636 % un-comment this line if desired
637 %  \override Clef #'transparent = ##t
638   defaultBarType = #""
639   \remove Bar_number_engraver
640 } <<
641
642 % modify these to get the staves you want
643   \new Staff \emptymusic
644   \new TabStaff \emptymusic
645 >>
646 @end lilypond
647
648
649