]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/advanced-notation.itely
*** empty log message ***
[lilypond.git] / Documentation / user / advanced-notation.itely
1 @c -*- coding: latin-1; mode: texinfo; -*-
2 @c This file is part of lilypond.tely
3
4 @c A menu is needed before every deeper *section nesting of @node's; run 
5 @c     M-x texinfo-all-menus-update
6 @c to automatically fill in these menus before saving changes
7
8 @node Advanced notation
9 @chapter Advanced notation
10
11 This chapter deals with rarely-used and advanced notation.
12
13 @menu
14 * Accidentals::                 
15 * Expressive stuff::            
16 * Orchestral music::            
17 * Contemporary notation::       
18 * Educational use::             
19 @end menu
20
21
22 @node Accidentals
23 @section Accidentals
24
25 This section describes how to change the way that accidentals are
26 inserted automatically before notes.
27
28 @menu
29 * Automatic accidentals::       
30 @end menu
31
32 @node Automatic accidentals
33 @subsection Automatic accidentals
34 @cindex Automatic accidentals
35
36 Common rules for typesetting accidentals have been placed in a
37 function.  This function is called as follows
38
39 @cindex @code{set-accidental-style}
40 @example
41 #(set-accidental-style 'STYLE #('CONTEXT#))
42 @end example
43
44 The function can take two arguments: the name of the accidental style,
45 and an optional argument that denotes the context that should be
46 changed.  If no context name is supplied, @code{Staff} is the default,
47 but you may wish to apply the accidental style to a single @code{Voice}
48 instead.
49
50 The following accidental styles are supported
51 @table @code
52 @item default
53 This is the default typesetting behavior.  It corresponds
54 to 18th century common practice: Accidentals are
55 remembered to the end of the measure in which they occur and
56 only on their own octave.
57
58 @item voice
59 The normal behavior is to remember the accidentals on
60 Staff-level.  This variable, however, typesets accidentals
61 individually for each voice.  Apart from that, the rule is similar to
62 @code{default}.
63
64 As a result, accidentals from one voice do not get canceled in other
65 voices, which is often an unwanted result
66
67 @lilypond[quote,raggedright,relative=1,fragment,verbatim]
68 \context Staff <<
69   #(set-accidental-style 'voice)
70   <<
71     { es g } \\
72     { c, e }
73 >> >>
74 @end lilypond
75
76 The @code{voice} option should be used if the voices
77 are to be read solely by individual musicians.  If the staff is to be
78 used by one musician (e.g., a conductor) then
79 @code{modern} or @code{modern-cautionary}
80 should be used instead.
81
82 @item modern
83 @cindex @code{modern} style accidentals
84 This rule corresponds to the common practice in the 20th century.  This rule
85 prints the same accidentals as @code{default}, but temporary
86 accidentals also are canceled in other octaves.  Furthermore,
87 in the same octave, they also get canceled in the following
88 measure
89
90 @lilypond[quote,raggedright,fragment,verbatim]
91 #(set-accidental-style 'modern)
92 cis' c'' cis'2 | c'' c'
93 @end lilypond
94
95 @item @code{modern-cautionary}
96 @cindex @code{modern-cautionary}
97 This rule is similar to @code{modern}, but the ``extra'' accidentals
98 (the ones not typeset by @code{default}) are typeset as cautionary
99 accidentals.  They are printed in reduced size or with parentheses
100 @lilypond[quote,raggedright,fragment,verbatim]
101 #(set-accidental-style 'modern-cautionary)
102 cis' c'' cis'2 | c'' c'
103 @end lilypond
104
105 @cindex @code{modern-voice}
106 @item modern-voice
107 This rule is used for multivoice accidentals to be read both by musicians
108 playing one voice and musicians playing all voices.  Accidentals are
109 typeset for each voice, but they @emph{are} canceled across voices in
110 the same @internalsref{Staff}.
111
112 @cindex @code{modern-voice-cautionary}
113 @item modern-voice-cautionary
114 This rule is the same as @code{modern-voice}, but with the extra
115 accidentals (the ones not typeset by @code{voice}) typeset
116 as cautionaries.  Even though all accidentals typeset by
117 @code{default} @emph{are} typeset by this variable,
118 some of them are typeset as cautionaries.
119
120 @item piano
121 @cindex @code{piano} accidentals
122 This rule reflects 20th century practice for piano notation.  Very similar to
123 @code{modern} but accidentals also get canceled
124 across the staves in the same @internalsref{GrandStaff} or
125 @internalsref{PianoStaff}.
126
127 @item piano-cautionary
128 @cindex @code{#(set-accidental-style 'piano-cautionary)}
129 Same as @code{#(set-accidental-style 'piano)} but with the extra
130 accidentals typeset as cautionaries.
131
132 @item no-reset
133 @cindex @code{no-reset} accidental style
134 This is the same as @code{default} but with accidentals lasting
135 ``forever'' and not only until the next measure
136 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
137 #(set-accidental-style 'no-reset)
138 c1 cis cis c
139 @end lilypond
140
141 @item forget
142 This is sort of the opposite of @code{no-reset}: Accidentals
143 are not remembered at all---and hence all accidentals are
144 typeset relative to the key signature, regardless of what was
145 before in the music
146
147 @lilypond[quote,raggedright,fragment,verbatim,relative=1]
148 #(set-accidental-style 'forget)
149 \key d\major c4 c cis cis d d dis dis
150 @end lilypond
151 @end table
152
153
154 @seealso
155
156 Program reference: @internalsref{Accidental_engraver},
157 @internalsref{Accidental}, and @internalsref{AccidentalPlacement}.
158
159
160 @refbugs
161
162 Simultaneous notes are considered to be entered in sequential
163 mode.  This means that in a chord the accidentals are typeset as if the
164 notes in the chord happened once at a time - in the order in which
165 they appear in the input file.
166
167 This is a problem when accidentals in a chord depend on each other,
168 which does not happen for the default accidental style.  The problem
169 can be solved by manually inserting @code{!} and @code{?} for the
170 problematic notes.
171
172
173 @node Expressive stuff
174 @section Expressive stuff
175
176 Expressive marks help musicians to bring more to the music than simple
177 notes and rhythms.
178
179 @menu
180 * Metronome marks::             
181 * Text scripts::                
182 * Text spanners::               
183 * Analysis brackets::           
184 * Articulations::               
185 @end menu
186
187
188 @node Metronome marks
189 @subsection Metronome marks
190
191 @cindex Tempo
192 @cindex beats per minute
193 @cindex metronome marking
194
195 Metronome settings can be entered as follows
196 @example
197 \tempo @var{duration} = @var{per-minute}
198 @end example
199
200 In the MIDI output, they are interpreted as a tempo change.  In the
201 layout output, a metronome marking is printed
202 @cindex @code{\tempo}
203 @lilypond[quote,raggedright,verbatim,fragment]
204 \tempo 8.=120 c''1
205 @end lilypond
206
207 @seealso
208
209 Program reference: @internalsref{MetronomeChangeEvent}.
210
211 @refbugs
212
213 Collisions are not checked.  If you have notes above the top line of
214 the staff (or notes with articulations, slurs, text, etc), then the
215 metronome marking may be printed on top of musical symbols.  If this
216 occurs, increase the padding of the metronome mark to place it 
217 further away from the staff.
218
219 @example
220 \override Score.MetronomeMark #'padding = #2.5
221 @end example
222
223
224 @node Text scripts
225 @subsection Text scripts
226 @cindex Text scripts
227
228 @cindex text items, non-empty
229 @cindex non-empty texts
230
231 It is possible to place arbitrary strings of text or markup text (see
232 @ref{Text markup}) above or below notes by using a string
233 @code{c^"text"}.  By default, these indications do not influence the
234 note spacing, but by using the command @code{\fatText}, the widths
235 will be taken into account
236
237 @lilypond[quote,fragment,raggedright,verbatim,relative=1]
238 c4^"longtext" \fatText c4_"longlongtext" c4
239 @end lilypond
240
241 More complex formatting may also be added to a note by using the
242 markup command,
243 @lilypond[fragment,raggedright,verbatim,quote]
244 c'4^\markup { bla \bold bla }
245 @end lilypond
246
247 The @code{\markup} is described in more detail in
248 @ref{Text markup}.
249
250
251 @refcommands
252
253 @cindex @code{\fatText}
254 @code{\fatText},
255 @cindex @code{\emptyText}
256 @code{\emptyText}.
257
258 @seealso
259
260 In this manual: @ref{Text markup}.
261
262 Program reference: @internalsref{TextScriptEvent}, @internalsref{TextScript}.
263
264
265 @node Text spanners
266 @subsection Text spanners
267 @cindex Text spanners
268
269 Some performance indications, e.g., @i{rallentando} or @i{accelerando},
270 are written as text and are extended over many measures with dotted
271 lines.  Such texts are created using text spanners; attach
272 @code{\startTextSpan} and @code{\stopTextSpan} to the first and last
273 notes of the spanner.
274
275 The string to be printed, as well as the style, is set through object
276 properties
277
278 @lilypond[quote,raggedright,fragment,relative=1,verbatim]
279 c1
280 \override TextSpanner #'direction = #-1
281 \override TextSpanner #'edge-text = #'("rall " . "")
282 c2\startTextSpan b c\stopTextSpan a
283 @end lilypond
284
285
286 @seealso
287
288 Internals @internalsref{TextSpanEvent},
289 @internalsref{TextSpanner}.
290
291 Examples: @inputfileref{input/@/regression,text@/-spanner@/.ly}.
292
293
294 @node Analysis brackets
295 @subsection Analysis brackets
296 @cindex brackets
297 @cindex phrasing brackets
298 @cindex musicological analysis
299 @cindex note grouping bracket
300
301 Brackets are used in musical analysis to indicate structure in musical
302 pieces.  LilyPond supports a simple form of nested horizontal
303 brackets.  To use this, add the @internalsref{Horizontal_bracket_engraver}
304 to @internalsref{Staff} context.  A bracket is started with
305 @code{\startGroup} and closed with @code{\stopGroup}
306
307 @lilypond[quote,raggedright,verbatim]
308 \score {
309   \relative c'' {
310     c4\startGroup\startGroup
311     c4\stopGroup
312     c4\startGroup
313     c4\stopGroup\stopGroup
314   }
315   \layout {
316     \context {
317       \Staff \consists "Horizontal_bracket_engraver"
318 }}}
319 @end lilypond
320
321 @seealso
322
323 Program reference: @internalsref{HorizontalBracket},
324 @internalsref{NoteGroupingEvent}.
325
326 Examples: @inputfileref{input/@/regression,note@/-group@/-bracket@/.ly}.
327
328
329 @node Articulations
330 @subsection Articulations
331 @cindex Articulations
332
333 @cindex articulations
334 @cindex scripts
335 @cindex ornaments
336
337 A variety of symbols can appear above and below notes to indicate
338 different characteristics of the performance.  They are added to a note
339 by adding a dash and the character signifying the
340 articulation.  They are demonstrated here
341
342 @lilypondfile[quote,raggedright]{script-abbreviations.ly}
343
344 The meanings of these shorthands can be changed.  See
345 @file{ly/@/script@/-init@/.ly} for examples.
346
347
348 The script is automatically placed, but the direction can be forced as
349 well.  Like other pieces of LilyPond code, @code{_} will place them
350 below the staff, and @code{^} will place them above.
351
352
353 @lilypond[quote,raggedright,fragment,verbatim]
354 c''4^^ c''4_^
355 @end lilypond
356
357 Other symbols can be added using the syntax
358 @var{note}@code{\}@var{name}.  Again, they
359 can be forced up or down using @code{^} and @code{_},
360 e.g.,
361
362 @lilypond[quote,raggedright,verbatim,fragment,relative=2]
363 c\fermata c^\fermata c_\fermata
364 @end lilypond
365
366
367
368 @cindex accent
369 @cindex marcato
370 @cindex staccatissimo
371 @cindex espressivo
372 @cindex fermata
373 @cindex stopped
374 @cindex staccato
375 @cindex portato
376 @cindex tenuto
377 @cindex upbow
378 @cindex downbow
379 @cindex foot marks
380 @cindex organ pedal marks
381 @cindex turn
382 @cindex open
383 @cindex flageolet
384 @cindex reverseturn
385 @cindex trill
386 @cindex prall
387 @cindex mordent
388 @cindex prallprall
389 @cindex prallmordent
390 @cindex prall, up
391 @cindex prall, down
392 @cindex mordent
393 @cindex thumb marking
394 @cindex segno
395 @cindex coda
396 @cindex varcoda
397
398 Here is a chart showing all scripts available,
399
400 @lilypondfile[raggedright,quote]{script-chart.ly}
401
402
403 The vertical ordering of scripts is controlled with the
404 @code{script-priority} property.  The lower this number, the closer it
405 will be put to the note.  In this example, the
406 @internalsref{TextScript} (the sharp symbol) first has the lowest
407 priority, so it is put lowest in the first example.  In the second, the
408 prall trill (the @internalsref{Script}) has the lowest, so it is on the
409 inside.  When two objects have the same priority, the order in which
410 they are entered decides which one comes first.
411
412
413 @lilypond[verbatim,relative=3,raggedright,fragment,quote]
414 \once \override TextScript #'script-priority = #-100
415 a4^\prall^\markup { \sharp }
416
417 \once \override Script #'script-priority = #-100
418 a4^\prall^\markup { \sharp }
419 @end lilypond
420
421
422
423
424 @seealso
425
426 Program reference: @internalsref{ScriptEvent}, and @internalsref{Script}.
427
428 @refbugs
429
430 These signs appear in the printed output but have no effect on the
431 MIDI rendering of the music.
432
433
434
435
436
437
438
439
440 @node Orchestral music
441 @section Orchestral music
442
443 @cindex Writing parts
444
445 Orchestral music involves some special notation, both in the full
446 score and the individual parts.  This section explains how to tackle
447 some common problems in orchestral music.
448
449
450
451 @menu
452 * Rehearsal marks::             
453 * Bar numbers::                 
454 * Instrument names::            
455 * Instrument transpositions::   
456 * Multi measure rests::         
457 * Automatic part combining::    
458 * Hiding staves::               
459 * Different editions from one source::  
460 * Quoting other voices::        
461 * Formatting cue notes::        
462 @end menu
463
464
465
466
467 @node Rehearsal marks
468 @subsection Rehearsal marks
469 @cindex Rehearsal marks
470 @cindex mark
471 @cindex @code{\mark}
472
473 To print a rehearsal mark, use the @code{\mark} command
474
475 @lilypond[quote,raggedright,fragment,verbatim,relative=2]
476 c1 \mark \default
477 c1 \mark \default
478 c1 \mark #8
479 c1 \mark \default
480 c1 \mark \default
481 @end lilypond
482
483 @noindent
484 (The letter@tie{}`I' is skipped in accordance with engraving traditions.)
485 @c umm, is the manual the right place for feature requests?  :)  -gp
486 @c FIXME - should make that tunable.
487
488 The mark is incremented automatically if you use @code{\mark
489 \default}, but you can also use an integer argument to set the mark
490 manually.  The value to use is stored in the property
491 @code{rehearsalMark}.
492
493 The style is defined by the property @code{markFormatter}.  It is a
494 function taking the current mark (an integer) and the current context
495 as argument.  It should return a markup object.  In the following
496 example, @code{markFormatter} is set to a canned procedure.  After a
497 few measures, it is set to function that produces a boxed number.
498
499 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
500 \set Score.markFormatter = #format-mark-numbers
501 c1 \mark \default
502 c1 \mark \default
503 \set Score.markFormatter = #format-mark-box-numbers
504 c1 \mark \default
505 c1 \mark \default
506 c1
507 @end lilypond
508
509 The file @file{scm/@/translation@/-functions@/.scm} contains the definitions
510 of @code{format-mark-numbers} (the default format), @code{format-mark-box-numbers},
511 @code{format-mark-letters} and @code{format-mark-box-letters}.
512 These can be used as inspiration for other formatting functions.
513
514
515 @cindex coda on bar line
516 @cindex segno on bar line
517 @cindex fermata on bar line
518 @cindex bar lines, symbols on
519
520 The @code{\mark} command can also be used to put signs like coda,
521 segno, and fermata on a bar line.  Use @code{\markup} to
522 access the appropriate symbol
523
524 @lilypond[fragment,quote,raggedright,verbatim,relative=2]
525 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
526 c1
527 @end lilypond
528
529 If the mark occurs at a line break, the mark will be printed at the
530 beginning of the next line.
531 @c  IMO this is a bug; hopefully it'll be fixed soon, so I can
532 @c  delete this sentence.   -gp
533 If there is no next line, then the mark will not be printed at all.
534 To print the mark at the end of the current line, use
535
536 @example
537 \override Score.RehearsalMark
538   #'break-visibility = #begin-of-line-invisible
539 @end example
540
541 @cindex fermatas
542 @cindex coda
543 @cindex segno
544 @cindex bar lines, putting symbols on
545
546 @seealso
547
548 Program reference: @internalsref{MarkEvent}, @internalsref{RehearsalMark}.
549
550 Init files: @file{scm/@/translation@/-functions@/.scm} contains the
551 definition of @code{format-mark-numbers} and
552 @code{format-mark-letters}.  They can be used as inspiration for other
553 formatting functions.
554
555 Examples: @inputfileref{input/@/regression,rehearsal@/-mark@/-letter@/.ly},
556
557 @inputfileref{input/@/regression,rehearsal@/-mark@/-number@/.ly}.
558
559
560 @node Bar numbers
561 @subsection Bar numbers
562
563
564 @cindex Bar numbers
565 @cindex measure numbers
566 @cindex @code{currentBarNumber}
567
568 Bar numbers are printed by default at the start of the line.  The
569 number itself is stored in the @code{currentBarNumber} property, which
570 is normally updated automatically for every measure.
571
572 Bar numbers can be typeset at regular intervals instead of at the
573 beginning of each line.  This is illustrated in the following example,
574 whose source is available as
575 @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}
576
577 @lilypondfile[raggedright,quote]{bar-number-regular-interval.ly}
578
579 Bar numbers can be typeset manually by tweaking the
580 @code{markFormatter} property
581
582 @lilypond[verbatim,raggedright,quote]
583 \relative c' {
584   \set Score.markFormatter
585     = #(lambda (mark context)
586       (make-bold-markup
587         (make-box-markup
588           (number->string (ly:context-property context
589                                                'currentBarNumber)))))
590
591   c1 \bar "||" \mark \default c1 c1 \mark \default c1 \bar "|."
592 }
593 @end lilypond
594
595 Bar numbers can be manually changed by setting the
596 @code{Staff.currentBarNumber} property
597
598 @lilypond[verbatim,raggedright,quote]
599 \relative c' {
600   \repeat unfold 4 {c4 c c c} \break
601   \set Score.currentBarNumber = #50
602   \repeat unfold 4 {c4 c c c}
603 }
604 @end lilypond
605
606 @seealso
607
608 Program reference: @internalsref{BarNumber}.
609
610 Examples:
611 @inputfileref{input/@/test,bar@/-number@/-every@/-five@/-reset@/.ly},
612 and @inputfileref{input/@/test,bar@/-number@/-regular@/-interval@/.ly}.
613
614 @refbugs
615
616 Bar numbers can collide with the @internalsref{StaffGroup} bracket, if
617 there is one at the top.  To solve this, the
618 @code{padding} property of @internalsref{BarNumber} can be
619 used to position the number correctly.
620
621 @node Instrument names
622 @subsection Instrument names
623
624 In an orchestral score, instrument names are printed at the left side
625 of the staves.
626
627 This can be achieved by setting @internalsref{Staff}.@code{instrument}
628 and @internalsref{Staff}.@code{instr}.  This will print a string before
629 the start of the staff.  For the first staff, @code{instrument} is
630 used, for the following ones, @code{instr} is used.
631
632 @lilypond[quote,verbatim,raggedright,relative=1,fragment]
633 \set Staff.instrument = "Ploink "
634 \set Staff.instr = "Plk "
635 c1
636 \break
637 c''
638 @end lilypond
639
640 You can also use markup texts to construct more complicated instrument
641 names, for example
642
643 @lilypond[quote,fragment,verbatim,raggedright]
644 \set Staff.instrument = \markup {
645   \column { "Clarinetti"
646             \line { "in B" \smaller \flat } } }
647 c''1
648 @end lilypond
649
650 For longer instrument names, it may be useful to increase the
651 @code{indent} setting in the @code{\layout} block.
652
653 @seealso
654
655 Program reference: @internalsref{InstrumentName}.
656
657 @refbugs
658
659 When you put a name on a grand staff or piano staff, the width of the
660 brace is not taken into account.  You must add extra spaces to the end of
661 the name to avoid a collision.
662
663 @node Instrument transpositions
664 @subsection Instrument transpositions
665
666 The key of a transposing instrument can also be specified.  This
667 applies to many wind instruments, for example, clarinets (B-flat, A, and
668 E-flat), horn (F) and trumpet (B-flat, C, D, and E-flat).
669
670 The transposition is entered after the keyword @code{\transposition}
671
672 @example
673 \transposition bes   %% B-flat clarinet
674 @end example
675
676 @noindent
677 This command sets the property @code{instrumentTransposition}.  The value of
678 this property is used for MIDI output and quotations.  It does not
679 affect how notes are printed in the current staff.  To change the printed
680 output, see @ref{Transpose}.
681
682 The pitch to use for @code{\transposition} should correspond to the
683 transposition of the notes.  For example, when entering a score in
684 concert pitch, typically all voices are entered in C, so
685 they should be entered as
686
687 @example
688 clarinet = @{
689   \transposition c'
690   ...
691 @}
692 saxophone = @{
693   \transposition c'
694   ...
695 @}
696 @end example
697
698 The command @code{\transposition} should be used when the music is
699 entered from a (transposed) orchestral part.  For example, in
700 classical horn parts, the tuning of the instrument is often changed
701 during a piece.  When copying the notes from the part, use
702 @code{\transposition}, e.g.,
703
704 @example
705 \transposition d'
706 c'4^"in D"
707 ...
708 \transposition g'
709 c'4^"in G"
710 ...
711 @end example
712
713
714
715 @cindex transposition, MIDI
716 @cindex transposition, instrument
717
718
719 @node Multi measure rests
720 @subsection Multi measure rests
721 @cindex multi measure rests
722 @cindex Rests, multi measure
723
724 @cindex @code{R}
725
726 Multi-measure rests are entered using `@code{R}'.  It is specifically
727 meant for full bar rests and for entering parts: the rest can expand
728 to fill a score with rests, or it can be printed as a single
729 multi-measure rest.  This expansion is controlled by the property
730 @code{Score.skipBars}.  If this is set to true, empty measures will not
731 be expanded, and the appropriate number is added automatically
732
733 @lilypond[quote,raggedright,fragment,verbatim]
734 \time 4/4 r1 | R1 | R1*2
735 \set Score.skipBars = ##t R1*17 R1*4
736 @end lilypond
737
738 The @code{1} in @code{R1} is similar to the duration notation used for
739 notes.  Hence, for time signatures other than 4/4, you must enter other
740 durations.  This can be done with augmentation dots or fractions
741
742 @lilypond[quote,raggedright,fragment,verbatim]
743 \set Score.skipBars = ##t
744 \time 3/4
745 R2. | R2.*2
746 \time 13/8
747 R1*13/8
748 R1*13/8*12 |
749 \time 10/8 R4*5*4 |
750 @end lilypond
751
752 An @code{R} spanning a single measure is printed as either a whole rest
753 or a breve, centered in the measure regardless of the time signature.
754
755 If there are only a few measures of rest, LilyPond prints ``church rests''
756 (a series of rectangles) in the staff.  To replace that with a simple
757 rest, use @code{MultiMeasureRest.expand-limit}.
758
759 @lilypond[quote,raggedright,fragment,verbatim]
760 \set Score.skipBars = ##t
761 R1*2 | R1*5 | R1*9
762 \override MultiMeasureRest #'expand-limit = 1
763 R1*2 | R1*5 | R1*9
764 @end lilypond
765
766
767 @cindex text on multi-measure rest
768 @cindex script on multi-measure rest
769 @cindex fermata on multi-measure rest
770
771 Texts can be added to multi-measure rests by using the
772 @var{note}-@code{markup} syntax (see @ref{Text markup}).
773 A variable (@code{\fermataMarkup}) is provided for
774 adding fermatas
775
776 @lilypond[quote,raggedright,verbatim,fragment]
777 \set Score.skipBars = ##t
778 \time 3/4
779 R2.*10^\markup { \italic "ad lib." }
780 R2.^\fermataMarkup
781 @end lilypond
782
783 If you want to have text on the left end of a multi-measure rest,
784 attach the text to a zero-length skip note, i.e.,
785
786 @example
787 s1*0^"Allegro"
788 R1*4
789 @end example
790
791
792 @cindex whole rests for a full measure
793
794 @seealso
795
796 Program reference: @internalsref{MultiMeasureRestEvent},
797 @internalsref{MultiMeasureTextEvent},
798 @internalsref{MultiMeasureRestMusicGroup}, and
799 @internalsref{MultiMeasureRest}.
800
801 The layout object @internalsref{MultiMeasureRestNumber} is for the
802 default number, and @internalsref{MultiMeasureRestText} for user
803 specified texts.
804
805 @refbugs
806
807 It is not possible to use fingerings (e.g., @code{R1-4}) to put numbers
808 over multi-measure rests.  And the pitch of multi-measure rests (or
809 staff-centered rests) can not be influenced.
810
811 @cindex condensing rests
812
813 There is no way to automatically condense multiple rests into a single
814 multi-measure rest.  Multi-measure rests do not take part in rest
815 collisions.
816
817 Be careful when entering multi-measure rests followed by whole
818 notes.  The following will enter two notes lasting four measures each
819 @example
820 R1*4 cis cis
821 @end example
822 When @code{skipBars} is set, the result will look OK, but the bar
823 numbering will be off.
824
825 @node Automatic part combining
826 @subsection Automatic part combining
827 @cindex automatic part combining
828 @cindex part combiner
829
830
831 Automatic part combining is used to merge two parts of music onto a
832 staff.  It is aimed at typesetting orchestral scores.  When the two
833 parts are identical for a period of time, only one is shown.  In
834 places where the two parts differ, they are typeset as separate
835 voices, and stem directions are set automatically.  Also, solo and
836 @emph{a due} parts are identified and can be marked.
837
838 The syntax for part combining is
839
840 @example
841 \partcombine @var{musicexpr1} @var{musicexpr2}
842 @end example
843
844
845
846 The following example demonstrates the basic functionality of the part
847 combiner: putting parts on one staff, and setting stem directions and
848 polyphony
849
850 @lilypond[quote,verbatim,raggedright,fragment]
851 \new Staff \partcombine
852   \relative g' { g g a( b) c c r r }
853   \relative g' { g g r4 r e e g g }
854 @end lilypond
855
856 The first @code{g} appears only once, although it was
857 specified twice (once in each part).  Stem, slur, and tie directions are
858 set automatically, depending whether there is a solo or unisono.  The
859 first part (with context called @code{one}) always gets up stems, and
860 `Solo', while the second (called @code{two}) always gets down stems and
861 `Solo II'.
862
863 If you just want the merging parts, and not the textual markings, you
864 may set the property @code{printPartCombineTexts} to false
865
866 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
867 \new Staff <<
868   \set Staff.printPartCombineTexts = ##f
869   \partcombine
870     \relative g' { g a( b) r }
871     \relative g' { g r4 r f }
872 >>
873 @end lilypond
874
875 To change the text that is printed for solos or merging, you may
876 set the @code{soloText}, @code{soloIIText}, and @code{aDueText}
877 properties.
878
879 @lilypond[quote,verbatim,raggedright,fragment,relative=2]
880 \new Staff <<
881   \set Score.soloText = #"ichi"
882   \set Score.soloIIText = #"ni"
883   \set Score.aDueText = #"tachi"
884   \partcombine
885     \relative g' { g4 g a( b) r }
886     \relative g' { g4 g r r f }
887 >>
888 @end lilypond
889
890 Both arguments to @code{\partcombine} will be interpreted as
891 @internalsref{Voice} contexts.  If using relative octaves,
892 @code{\relative} should be specified for both music expressions, i.e.,
893
894 @example
895 \partcombine
896   \relative @dots{} @var{musicexpr1}
897   \relative @dots{} @var{musicexpr2}
898 @end example
899
900 @noindent
901 A @code{\relative} section that is outside of @code{\partcombine} has
902 no effect on the pitches of @var{musicexpr1} and @var{musicexpr2}.
903
904 @seealso
905
906 Program reference: @internalsref{PartCombineMusic},
907 @internalsref{SoloOneEvent}, and
908 @internalsref{SoloTwoEvent}, and
909 @internalsref{UnisonoEvent}.
910
911 @refbugs
912
913 When @code{printPartCombineTexts} is set, when the two voices play the
914 same notes on and off, the part combiner may typeset @code{a2} more
915 than once in a measure.
916
917 @code{\partcombine} cannot be inside @code{\times}.
918
919 @code{\partcombine} cannot be inside @code{\relative}.
920
921 Internally, the @code{\partcombine} interprets both arguments as
922 @code{Voice}s named @code{one} and @code{two}, and then decides when
923 the parts can be combined.  Consequently, if the arguments switch to
924 differently named @internalsref{Voice} contexts, the events in those
925 will be ignored.
926
927 @node Hiding staves
928 @subsection Hiding staves
929
930 @cindex Frenched scores
931 @cindex Hiding staves
932
933 In orchestral scores, staff lines that only have rests are usually
934 removed.  This saves some space.  This style is called `French Score'.
935 For @internalsref{Lyrics},
936 @internalsref{ChordNames} and @internalsref{FiguredBass}, this is
937 switched on by default.  When the lines of these contexts turn out
938 empty after the line-breaking process, they are removed.
939
940 For normal staves, a specialized @internalsref{Staff} context is
941 available, which does the same: staves containing nothing (or only
942 multi-measure rests) are removed.  The context definition is stored in
943 @code{\RemoveEmptyStaffContext} variable.  Observe how the second staff
944 in this example disappears in the second line
945
946 @lilypond[quote,raggedright,verbatim]
947 \layout {
948   \context { \RemoveEmptyStaffContext }
949 }
950
951 {
952   \relative c' <<
953     \new Staff { e4 f g a \break c1 }
954     \new Staff { c4 d e f \break R1 }
955   >>
956 }
957 @end lilypond
958
959 The first system shows all staves in full.  If empty staves should be
960 removed from the first system too, set @code{remove-first} to false in
961 @internalsref{RemoveEmptyVerticalGroup}.
962
963 Another application is making ossia sections, i.e., alternative
964 melodies on a separate piece of staff, with help of a Frenched
965 staff.  See @inputfileref{input/@/test,ossia@/.ly} for an example.
966
967
968 @node Different editions from one source
969 @subsection Different editions from one source
970
971 @cindex tag
972 The @code{\tag} command marks music expressions with a name.  These
973 tagged expressions can be filtered out later.  With this mechanism it
974 is possible to make different versions of the same music source.
975
976 In the following example, we see two versions of a piece of music, one
977 for the full score, and one with cue notes for the instrumental part
978
979 @example
980 c1
981 <<
982   \tag #'part <<
983     R1 \\
984     @{
985       \set fontSize = #-1
986       c4_"cue" f2 g4 @}
987   >>
988   \tag #'score R1
989 >>
990 c1
991 @end example
992
993 The same can be applied to articulations, texts, etc.: they are
994 made by prepending
995 @example
996 -\tag #@var{your-tag}
997 @end example
998 to an articulation, for example,
999 @example
1000 c1-\tag #'part ^4
1001 @end example
1002
1003 This defines a note with a conditional fingering indication.
1004
1005 @cindex keepWithTag
1006 @cindex removeWithTag
1007 By applying the @code{\keepWithTag} and @code{\removeWithTag}
1008 commands, tagged expressions can be filtered.  For example,
1009 @example
1010 <<
1011   @var{the music}
1012   \keepWithTag #'score @var{the music}
1013   \keepWithTag #'part @var{the music}
1014 >>
1015 @end example
1016 would yield
1017
1018 @lilypondfile[raggedright,quote]{tag-filter.ly}
1019
1020
1021 The argument of the @code{\tag} command should be a symbol, or a list
1022 of symbols, for example,
1023 @example
1024 \tag #'(original-part transposed-part) @dots{}
1025 @end example
1026
1027
1028
1029 @seealso
1030
1031 Examples: @inputfileref{input/@/regression,tag@/-filter@/.ly}.
1032
1033 @refbugs
1034
1035 Multiple rests are not merged if you create the score with both tagged
1036 sections.
1037  
1038
1039 @node Quoting other voices
1040 @subsection Quoting other voices
1041
1042 With quotations, fragments of other parts can be inserted into a part
1043 directly.  Before a part can be quoted, it must be marked especially as
1044 quotable.  This is done with the @code{\addquote} command.
1045
1046 @example
1047 \addquote @var{name} @var{music}
1048 @end example
1049
1050
1051 @noindent
1052 Here, @var{name} is an identifying string.  The @var{music} is any kind
1053 of music.  Here is an example of @code{\addquote}
1054
1055 @example
1056 \addquote clarinet \relative c' @{
1057   f4 fis g gis
1058 @}
1059 @end example
1060
1061 This command must be entered at toplevel, i.e., outside any music
1062 blocks.
1063
1064 After calling @code{\addquote}, the quotation may then be done with
1065 @code{\quoteDuring} or @code{\cueDuring},
1066
1067 @example
1068 \quoteDuring #@var{name} @var{music}
1069 @end example
1070
1071 During a part, a piece of music can be quoted with the @code{\quoteDuring}
1072 command.
1073
1074 @example
1075 \quoteDuring #"clarinet" @{ s2. @}
1076 @end example
1077
1078 This would cite three quarter notes (the duration of @code{s2.})  of
1079 the previously added @code{clarinet} voice.
1080
1081
1082 More precisely, it takes the current time-step of the part being
1083 printed, and extracts the notes at the corresponding point of the
1084 @code{\addquote}d voice.  Therefore, the argument to @code{\addquote}
1085 should be the entire part of the voice to be quoted, including any
1086 rests at the beginning.
1087
1088 Quotations take into account the transposition of both source and target
1089 instruments, if they are specified using the @code{\transposition} command.
1090
1091 @lilypond[quote,raggedright,verbatim]
1092 \addquote clarinet \relative c' {
1093   \transposition bes
1094   f4 fis g gis
1095 }
1096
1097 {
1098   e'8 f'8 \quoteDuring #"clarinet" { s2 }
1099 }
1100 @end lilypond
1101
1102 The type of events that are present in cue notes can be trimmed with
1103 the @code{quotedEventTypes} property.  The default value is
1104 @code{(note-event rest-event)}, which means that only notes and
1105 rests of the cued voice end up in the @code{\quoteDuring}.
1106 Setting
1107
1108 @example
1109 \set Staff.quotedEventTypes =
1110        #'(note-event articulation-event dynamic-event)
1111 @end example
1112
1113 @noindent
1114 will quote notes (but no rests), together with scripts and dynamics.
1115
1116 @refbugs
1117
1118 Only the contents of the first @internalsref{Voice} occurring in an
1119 @code{\addquote} command will be considered for quotation, so
1120 @var{music} can not contain @code{\new} and @code{\context Voice}
1121 statements that would switch to a different Voice.
1122
1123 Quoting grace notes is broken and can even cause LilyPond to crash.
1124
1125 @seealso
1126
1127 In this manual: @ref{Instrument transpositions}.
1128
1129 Examples: @inputfileref{input/@/regression,quote@/.ly}
1130 @inputfileref{input/@/regression,quote@/-transposition@/.ly}
1131
1132 Program reference: @internalsref{QuoteMusic}.
1133
1134 @node Formatting cue notes
1135 @subsection Formatting cue notes
1136
1137 The previous section deals with inserting notes from another voice.
1138 There is a more advanced music function called @code{\cueDuring},
1139 which makes formatting cue notes easier.
1140
1141 The syntax is
1142
1143 @example
1144   \cueDuring #@var{name} #@var{updown} @var{music}
1145 @end example
1146
1147 This will insert notes from the part @var{name} into a
1148 @internalsref{Voice} called @code{cue}.  This happens simultaneously
1149 with @var{music}, which usually is a rest.  When the cue notes start,
1150 the staff in effect becomes polyphonic for a moment.  The argument
1151 @var{updown} determines whether the cue notes should be notated as a
1152 first or second voice.
1153
1154
1155 @lilypond[verbatim,raggedright]
1156 smaller = {
1157   \set fontSize = #-2
1158   \override Stem #'length = #5.5
1159   \override Beam #'thickness = #0.384
1160   \override Beam #'space-function =
1161     #(lambda (beam mult) (* 0.8 (Beam::space_function beam mult)))
1162 }
1163
1164 \addquote clarinet \relative {
1165   R1*20
1166   r2 r8 c f f
1167
1168
1169 \new Staff \relative  <<
1170
1171   % setup a context for  cue  notes.
1172   \context Voice = cue { \smaller \skip 1*21 }
1173   
1174   \set Score.skipBars = ##t
1175   
1176   \new Voice {
1177     R1*20
1178     \cueDuring #"clarinet" #1 {
1179       R1
1180     }
1181     g4 g2. 
1182   }
1183 >>
1184 @end lilypond 
1185
1186
1187 Here are a couple of hints for successful cue notes
1188
1189 @itemize @bullet
1190 @item
1191 Cue notes have smaller font sizes.
1192 @item
1193  the cued part is marked with the instrument playing the cue.
1194 @item
1195  when the original part takes over again, this should be marked with
1196  the name of the original instrument.
1197
1198  @c really?  Are you sure about that last point?  I'll check after 3.0 -gp
1199
1200 @c Yes, this is good practice.  Otherwise, the start of the original
1201 @c part can only be seen from the font size.  This is not good enough
1202 @c for sight-reading.  It is possilbe to use other
1203 @c markers (eg. a big close-bracket over the staff) to indicate the cue notes are
1204 @c finished.
1205 @c -hwn
1206
1207
1208  any other changes introduced by the cued part should also be
1209 undone.  For example, if the cued instrument plays in a different clef,
1210 the original clef should be stated once again.
1211
1212 @end itemize
1213
1214
1215
1216
1217
1218 @node Contemporary notation
1219 @section Contemporary notation
1220
1221 In the 20th century, composers have greatly expanded the musical
1222 vocabulary.  With this expansion, many innovations in musical notation
1223 have been tried.  The book ``Music Notation in the 20th century'' by
1224 Kurt Stone gives a comprehensive overview (see @ref{Literature
1225 list}).  In general, the use of new, innovative notation makes a piece
1226 harder to understand and perform and its use should therefore be
1227 avoided.  For this reason, support for contemporary notation in
1228 LilyPond is limited.
1229
1230
1231 @menu
1232 * Polymetric notation::         
1233 * Clusters::                    
1234 * Special fermatas::            
1235 * Feathered beams::             
1236 * Improvisation::               
1237 @end menu
1238
1239 @node Polymetric notation
1240 @subsection Polymetric notation
1241
1242 Double time signatures are not supported explicitly, but they can be
1243 faked.  In the next example, the markup for the time signature is
1244 created with a markup text.  This markup text is inserted in the
1245 @internalsref{TimeSignature} grob.
1246
1247 @lilypond[verbatim,raggedright]
1248 % create 2/4 + 5/8
1249 tsMarkup =\markup {
1250   \number {
1251     \column { "2" "4" }
1252     \musicglyph #"scripts.stopped"
1253     \bracket \column { "5" "8" }
1254   }
1255 }
1256
1257 {
1258   \override Staff.TimeSignature #'print-function = #Text_interface::print
1259   \override Staff.TimeSignature #'text = #tsMarkup
1260   \time 3/2
1261   c'2 \bar ":" c'4 c'4.
1262 }
1263 @end lilypond
1264
1265 Each staff can also have its own time signature.  This is done by
1266 moving the @internalsref{Timing_engraver} to the @internalsref{Staff}
1267 context.
1268
1269 @example
1270 \layout @{
1271   \context @{ \Score \remove "Timing_engraver" @}
1272   \context @{ \Staff \consists "Timing_engraver" @}
1273 @}
1274 @end example
1275
1276
1277 Now, each staff has its own time signature.
1278 @example
1279 <<
1280   \new Staff @{
1281     \time 3/4
1282     c4 c c | c c c |
1283   @}
1284   \new Staff @{
1285     \time 2/4
1286     c4 c | c c | c c
1287   @}
1288   \new Staff @{
1289     \time 3/8
1290     c4. c8 c c c4. c8 c c
1291   @}
1292 >>
1293 @end example
1294
1295 @lilypond[quote,raggedright]
1296 \layout{
1297   \context{ \Score \remove "Timing_engraver" }
1298   \context{ \Staff \consists "Timing_engraver" }
1299 }
1300
1301 \relative c' <<
1302   \new Staff {
1303     \time 3/4
1304     c4 c c | c c c |
1305   }
1306   \new Staff {
1307     \time 2/4
1308     c4 c | c c | c c
1309   }
1310   \new Staff {
1311     \time 3/8
1312     c4. c8 c c c4. c8 c c
1313   }
1314 >>
1315 @end lilypond
1316
1317
1318 A different form of polymetric notation is where note lengths have
1319 different values across staves.
1320
1321 This notation can be created by setting a common time signature for
1322 each staff but replacing it manually using
1323 @code{timeSignatureFraction} to the desired fraction.  Then the printed
1324 durations in each staff are scaled to the common time signature.
1325 The latter is done with @code{\compressmusic}, which is similar to
1326 @code{\times}, but does not create a tuplet bracket.
1327
1328
1329 In this example, music with the time signatures of 3/4, 9/8, and 10/8 are
1330 used in parallel.  In the second staff, shown durations are multiplied by
1331 2/3, so that 2/3 * 9/8 = 3/4, and in the third staff, shown durations are
1332 multiplied by 3/5, so that 3/5 * 10/8 = 3/4.
1333
1334 @lilypond[quote,raggedright,verbatim,fragment]
1335 \relative c' { <<
1336   \new Staff {
1337     \time 3/4
1338     c4 c c | c c c |
1339   }
1340   \new Staff {
1341     \time 3/4
1342     \set Staff.timeSignatureFraction = #'(9 . 8)
1343     \compressmusic #'(2 . 3)
1344       \repeat unfold 6 { c8[ c c] }
1345   }
1346   \new Staff {
1347     \time 3/4
1348     \set Staff.timeSignatureFraction = #'(10 . 8)
1349     \compressmusic #'(3 . 5) {
1350       \repeat unfold 2 { c8[ c c] }
1351       \repeat unfold 2 { c8[ c] }
1352       | c4. c4. \times 2/3 { c8 c c } c4
1353     }
1354   }
1355 >> }
1356 @end lilypond
1357
1358
1359
1360
1361 @refbugs
1362
1363 When using different time signatures in parallel, the spacing is
1364 aligned vertically, but bar lines distort the regular spacing.
1365
1366
1367
1368 @node Clusters
1369 @subsection Clusters
1370
1371 @cindex cluster
1372
1373 A cluster indicates a continuous range of pitches to be played.  They
1374 can be denoted as the envelope of a set of notes.  They are entered by
1375 applying the function @code{makeClusters} to a sequence of
1376 chords, e.g.,
1377 @lilypond[quote,raggedright,relative=2,fragment,verbatim]
1378 \makeClusters { <c e > <b f'> }
1379 @end lilypond
1380
1381 The following example (from
1382 @inputfileref{input/@/regression,cluster@/.ly}) shows what the result
1383 looks like
1384
1385 @lilypondfile[raggedright,quote]{cluster.ly}
1386
1387 Ordinary notes and clusters can be put together in the same staff,
1388 even simultaneously.  In such a case no attempt is made to
1389 automatically avoid collisions between ordinary notes and clusters.
1390
1391 @seealso
1392
1393 Program reference: @internalsref{ClusterSpanner},
1394 @internalsref{ClusterSpannerBeacon},
1395 @internalsref{Cluster_spanner_engraver}, and
1396 @internalsref{ClusterNoteEvent}.
1397
1398 Examples: @inputfileref{input/@/regression,cluster@/.ly}.
1399
1400 @refbugs
1401
1402 Music expressions like @code{<< @{ g8 e8 @} a4 >>} are not printed
1403 accurately.  Use @code{<g a>8 <e a>8} instead.
1404
1405
1406
1407 @node Special fermatas
1408 @subsection Special fermatas
1409
1410 @cindex fermatas, special
1411
1412 In contemporary music notation, special fermata symbols denote breaks
1413 of differing lengths.  The following fermatas are supported
1414
1415 @lilypond[quote,raggedright]
1416 <<
1417   \oldaddlyrics {
1418     b'2
1419     ^\shortfermata
1420     _\shortfermata
1421     r
1422
1423     b'
1424     ^\fermata
1425     _\fermata
1426     r
1427
1428     b'
1429     ^\longfermata
1430     _\longfermata
1431     r
1432
1433     b'
1434     ^\verylongfermata
1435     _\verylongfermata
1436     r
1437   }
1438   \context Lyrics \lyricmode {
1439     \override LyricText #'font-family = #'typewriter
1440     "shortfermata" "fermata" "longfermata" "verylongfermata"
1441   }
1442 >>
1443 @end lilypond
1444
1445 See @ref{Articulations} for general instructions how to apply scripts
1446 such as fermatas to notes.
1447
1448 @node Feathered beams
1449 @subsection Feathered beams
1450
1451 Feathered beams are not supported natively, but they can be faked by
1452 forcing two beams to overlap.  Here is an example,
1453
1454 @c don't change relative setting witout changing positions!
1455 @lilypond[raggedright,relative=1,fragment,verbatim]
1456 \new Staff <<
1457   \new Voice
1458   {
1459     \stemUp
1460     \once \override Voice.Beam #'positions = #'(0 . 0.5)
1461     c8[ c c c c ]
1462   }
1463   \new Voice {
1464     \stemUp
1465     \once \override Voice.Beam #'positions = #'(0 . -0.5)
1466     c[ c c c c]
1467   }
1468 >>
1469 @end lilypond
1470
1471
1472 @node Improvisation
1473 @subsection Improvisation
1474
1475 Improvisation is sometimes denoted with slashed note heads.  Such note
1476 heads can be created by adding a @internalsref{Pitch_squash_engraver}
1477 to the @internalsref{Staff} or @internalsref{Voice} context.  Then, the
1478 following command
1479
1480 @example
1481 \set squashedPosition = #0
1482 \override NoteHead #'style = #'slash
1483 @end example
1484
1485 @noindent
1486 switches on the slashes.
1487
1488 There are shortcuts @code{\improvisationOn} (and an accompanying
1489 @code{\improvisationOff}) for this command sequence.  They are used in
1490 the following example
1491
1492 @lilypond[verbatim,raggedright,quote]
1493 \new Staff \with {
1494   \consists Pitch_squash_engraver
1495 } \transpose c c' {
1496   e8 e g a a16(bes)(a8) g \improvisationOn
1497   e8
1498   ~e2~e8 f4 fis8
1499   ~fis2 \improvisationOff a16(bes) a8 g e
1500 }
1501 @end lilypond
1502
1503
1504 @node Educational use
1505 @section Educational use
1506
1507 With the amount of control that LilyPond offers, one can make great
1508 teaching tools in addition to great musical scores.
1509
1510 @menu
1511 * Balloon help::                
1512 * Blank music sheet::           
1513 * Hidden notes::                
1514 * Shaped note heads ::          
1515 * Easy Notation note heads::    
1516 @end menu
1517
1518 @node Balloon help
1519 @subsection Balloon help
1520
1521 Elements of notation can be marked and named with the help of a square
1522 balloon.  The primary purpose of this feature is to explain notation.
1523
1524 The following example demonstrates its use.
1525
1526 @lilypond[quote,verbatim,fragment,raggedright,relative=2]
1527 \context Voice {
1528   \applyoutput
1529     #(add-balloon-text 'NoteHead "heads, or tails?"
1530     '(1 . -3))
1531   c8
1532 }
1533 @end lilypond
1534
1535 @noindent
1536 The function @code{add-balloon-text} takes the name of a grob, the
1537 label to print, and the position where to put the label relative to
1538 the object.  In the above example, the text ``heads or tails?'' ends
1539 3 spaces below and 1 space to the right of the marked head.
1540
1541 @cindex balloon
1542 @cindex notation, explaining
1543
1544 @seealso
1545
1546 Program reference: @internalsref{text-balloon-interface}.
1547
1548 Examples: @inputfileref{input/@/regression,balloon@/.ly}.
1549
1550
1551
1552
1553 @node Blank music sheet
1554 @subsection Blank music sheet
1555
1556 A blank music sheet can be produced also by using invisible notes, and
1557 removing @code{Bar_number_engraver}.
1558
1559
1560 @lilypond[quote,verbatim]
1561 emptymusic = {
1562   \repeat unfold 2 % Change this for more lines.
1563   { s1\break }
1564   \bar "|."
1565 }
1566 \new Score \with {
1567   \override TimeSignature #'transparent = ##t
1568   defaultBarType = #""
1569   \remove Bar_number_engraver
1570 } <<
1571   \context Staff \emptymusic
1572   \context TabStaff \emptymusic
1573 >>
1574 @end lilypond
1575
1576
1577 @node Hidden notes
1578 @subsection Hidden notes
1579
1580 @cindex Hidden notes
1581 @cindex Invisible notes
1582 @cindex Transparent notes
1583
1584 Hidden (or invisible or transparent) notes can be useful in preparing theory
1585 or composition exercises.
1586
1587 @lilypond[quote,raggedright,verbatim,relative=2,fragment]
1588 c4 d4
1589 \hideNotes
1590 e4 f4
1591 \unHideNotes
1592 g4 a
1593 @end lilypond
1594
1595 Hidden notes are also great for performing weird tricks.  For example,
1596 slurs cannot be attached to rests or spacer rests, but you may wish
1597 to include that in your score -- string instruments use this notation
1598 when doing pizzicato to indicate that the note should ring for as long
1599 as possible.
1600
1601 @lilypond[quote,raggedright,verbatim,relative=0,fragment]
1602 \clef bass
1603 << {
1604   c4^"pizz"( \hideNotes c)
1605   \unHideNotes c( \hideNotes c)
1606 } {
1607   s4 r s r
1608 } >>
1609 @end lilypond
1610
1611
1612 @node Shaped note heads 
1613 @subsection Shaped note heads 
1614
1615 In shaped note head notation, the shape of the note head corresponds
1616 to the harmonic function of a note in the scale.  This notation was
1617 popular in the 19th century American song books.
1618
1619 Shaped note heads can be produced by setting @code{\aikenHeads} or
1620 @code{\sacredHarpHeads}, depending on the style desired.
1621
1622 @lilypond[verbatim,relative=1,fragment]
1623   \aikenHeads
1624   c8 d4 e8 a2 g1
1625   \sacredHarpHeads
1626   c8 d4. e8 a2 g1
1627 @end lilypond
1628
1629 Shapes are determined on the step in the scale, where the base of the
1630 scale is determined by  the @code{\key} command
1631
1632 @findex \key
1633 @findex shapeNoteStyles
1634 @findex \aikenHeads
1635 @findex \sacredHarpHeads
1636
1637 Shaped note heads are implemented through the @code{shapeNoteStyles}
1638 property.  Its value is a vector of symbols.  The k-th element indicates
1639 the style to use for the k-th step of the scale.  Arbitrary
1640 combinations are possible, eg.,
1641
1642
1643 @lilypond[verbatim,relative=1,fragment]
1644   \set shapeNoteStyles  = ##(cross triangle fa #f mensural xcircle diamond)
1645   c8 d4. e8 a2 g1
1646 @end lilypond
1647
1648
1649 @node Easy Notation note heads
1650 @subsection Easy Notation note heads
1651
1652 @cindex easy notation
1653 @cindex Hal Leonard
1654
1655 The `easy play' note head includes a note name inside the head.  It is
1656 used in music for beginners
1657
1658 @lilypond[quote,raggedright,verbatim,fragment,staffsize=26]
1659   \setEasyHeads
1660   c'2 e'4 f' | g'1
1661 @end lilypond
1662
1663 The command @code{\setEasyHeads} overrides settings for the
1664 @internalsref{NoteHead} object.  To make the letters readable, it has
1665 to be printed in a large font size.  To print with a larger font, see
1666 @ref{Setting global staff size}.
1667
1668 @refcommands
1669
1670 @cindex @code{\setEasyHeads}
1671 @code{\setEasyHeads}
1672
1673
1674