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