]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/fundamental.itely
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / user / fundamental.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond-learning.tely
3
4 @node Fundamental concepts
5 @chapter Fundamental concepts
6
7 @menu
8 * How LilyPond files work::     
9 * Voices contain music::        
10 * TODO new sec fundamental::    
11 * Extending the templates::     
12 * Scores and parts::            
13 @end menu
14
15
16 @node How LilyPond files work
17 @section How LilyPond files work
18
19 The LilyPond input format is quite free-form, giving experienced
20 users a lot of flexibility to structure their files however they
21 wish.  However, this flexibility can make things confusing for new
22 users.  This section will explain some of this structure, but may
23 gloss over some details in favor of simplicity.  For a complete
24 description of the input format, see @ruser{File structure}.
25
26 @menu
27 * Introduction to the LilyPond file structure::  
28 * Score is a (single) compound musical expression::  
29 * Expressions can be nested after the beginning::  
30 @end menu
31
32 @node Introduction to the LilyPond file structure
33 @subsection Introduction to the LilyPond file structure
34
35 A basic example of a lilypond input file is
36
37 @example
38 \version "2.11.23"
39 \score @{
40   @var{...compound music expression...}  % all the music goes here!
41   \header @{ @}
42   \layout @{ @}
43   \midi @{ @}
44 @}
45 @end example
46
47 @noindent
48 There are many variations of this basic pattern, but this
49 example serves as a useful starting place.
50
51 At this point, you may be confused, since you have never seen a
52 @code{\score@{@}} before.  This is because LilyPond automatically
53 adds the extra commands when you give it simple input.  LilyPond
54 treats input like this:
55
56 @example
57 \relative c'' @{
58   c4 a d c
59 @}
60 @end example
61
62 @noindent
63 as shorthand for this:
64
65 @example
66 \score @{
67   \relative c'' @{
68     c4 a b c
69   @}
70   \layout @{ @}
71 @}
72 @end example
73
74 In other words, if the input contains a single music expression,
75 LilyPond will interpret the file as though the music expression
76 was wrapped up inside a @code{\score@{@}}.
77
78 @smallspace
79
80 A @code{\score} must begin with a compound music expression.
81 Remember that a music expression could be anything from a single
82 note to a huge
83
84 @example
85 @{
86   \new GrandStaff <<
87     @var{...insert the whole score of a Wagner opera in here...}
88   >>
89 @}
90 @end example
91
92 @noindent
93 Since everything is inside @code{@{ ... @}}, it counts
94 as one music expression.
95
96 As we saw previously, the @code{\score} can contain other things,
97 such as
98
99 @example
100 \score @{
101   @{ c'4 a b c' @}
102   \header @{ @}
103   \layout @{ @}
104   \midi @{ @}
105 @}
106 @end example
107
108 @noindent
109 Some people put some of those commands outside the @code{\score}
110 block -- for example, @code{\header} is often placed above the
111 @code{\score}.  That's just another shorthand that LilyPond
112 accepts.
113
114 @smallspace
115
116 @cindex variables
117
118 Another great shorthand is the ability to define variables.  All
119 the templates use this
120
121 @example
122 melody = \relative c' @{
123   c4 a b c
124 @}
125
126 \score @{
127   @{ \melody @}
128 @}
129 @end example
130
131 When LilyPond looks at this file, it takes the value of
132 @code{melody} (everything after the equals sign) and inserts it
133 whenever it sees @code{\melody}.  There's nothing special about
134 the names -- it could be @code{melody}, @code{global},
135 @code{pianorighthand}, or @code{foofoobarbaz}.  You can use
136 whatever variable names you want.  For more details, see
137 @ruser{Saving typing with variables and functions}.
138
139
140 @seealso
141
142 For a complete definition of the input format, see @ruser{File
143 structure}.
144
145
146 @node Score is a (single) compound musical expression
147 @subsection Score is a (single) compound musical expression
148
149 @cindex Compound music expression
150 @cindex Music expression, compound
151
152 We saw the general organization of LilyPond input files in the
153 previous section, @ref{How LilyPond files work}.  But we seemed to
154 skip over the most important part: how do we figure out what to
155 write after @code{\score}?
156
157 We didn't skip over it at all.  The big mystery is simply that
158 there @emph{is} no mystery.  This line explains it all:
159
160 @quotation
161 @emph{A @code{\score} must begin with a compound music expression.}
162 @end quotation
163
164 @noindent
165 You may find it useful to review @ruser{Music expressions
166 explained}.  In that section, we saw how to build big music
167 expressions from small pieces -- we started from notes, then
168 chords, etc.  Now we're going to start from a big music expression
169 and work our way down.
170
171 @example
172 \score @{
173   @{ % this brace begins the overall compound music expression
174     \new GrandStaff <<
175       @var{...insert the whole score of a Wagner opera in here...}
176     >>
177   @} % this brace ends the overall compound music expression
178   \layout @{ @}
179 @}
180 @end example
181
182 A whole Wagner opera would easily double the length of this
183 manual, so let's just add a singer and piano.  We don't need a
184 @code{GrandStaff} for this ensemble, so we shall remove it.  We
185 @emph{do} need a singer and a piano, though.
186
187 @example
188 \score @{
189   @{
190     <<
191       \new Staff = "singer" <<
192       >>
193       \new PianoStaff = piano <<
194       >>
195     >>
196   @}
197   \layout @{ @}
198 @}
199 @end example
200
201 Remember that we use @code{<<} and @code{>>} to show simultaneous
202 music.  And we definitely want to show the vocal part and piano
203 part at the same time, not one after the other!
204
205 @example
206 \score @{
207   @{
208     <<
209       \new Staff = "singer" <<
210         \new Voice = "vocal" @{ @}
211       >>
212       \new Lyrics \lyricsto vocal \new Lyrics @{ @}
213       \new PianoStaff = "piano" <<
214         \new Staff = "upper" @{ @}
215         \new Staff = "lower" @{ @}
216       >>
217     >>
218   @}
219   \layout @{ @}
220 @}
221 @end example
222
223 Now we have a lot more details.  We have the singer's staff: it
224 contains a @code{Voice} (in LilyPond, this term refers to a set of
225 notes, not necessarily vocal notes -- for example, a violin
226 generally plays one voice) and some lyrics.  We also have a piano
227 staff: it contains an upper staff (right hand) and a lower staff
228 (left hand).
229
230 At this stage, we could start filling in notes.  Inside the curly
231 braces next to @code{\new Voice = vocal}, we could start writing
232
233 @example
234 \relative c'' @{
235   a4 b c d
236 @}
237 @end example
238
239 But if we did that, the @code{\score} section would get pretty
240 long, and it would be harder to understand what was happening.  So
241 let's use variables instead.
242
243 @example
244 melody = @{ @}
245 text = @{ @}
246 upper = @{ @}
247 lower = @{ @}
248 \score @{
249   @{
250     <<
251       \new Staff = "singer" <<
252         \new Voice = "vocal" @{ \melody @}
253       >>
254       \new Lyrics \lyricsto vocal \new Lyrics @{ \text @}
255       \new PianoStaff = "piano" <<
256         \new Staff = "upper" @{ \upper @}
257         \new Staff = "lower" @{ \lower @}
258       >>
259     >>
260   @}
261   \layout @{ @}
262 @}
263 @end example
264
265 @noindent
266 Remember that you can use almost any name you like.  The
267 limitations on variable names are detailed in @ruser{File
268 structure}.
269
270 When writing (or reading) a @code{\score} section, just take it
271 slowly and carefully.  Start with the outer layer, then work on
272 each smaller layer.  It also really helps to be strict with
273 indentation -- make sure that each item on the same layer starts
274 on the same horizontal position in your text editor.
275
276
277 @node Expressions can be nested after the beginning
278 @subsection Expressions can be nested after the beginning
279
280 TODO: this title is teh suck.  :(
281
282 @lilypond[verbatim,quote,ragged-right]
283 \score {
284         <<
285                 \new Staff \relative c''{ c1 c c c c }
286                 \new StaffGroup \relative c''{ 
287                         \new Staff 
288                         c1 c
289                         << c1 \new Staff { c1 } >>
290                         c
291                 }
292         >>
293         \layout {
294                 
295                 \context{
296                         \Score
297
298                 }
299         }
300 }
301 @end lilypond
302
303
304 @node Voices contain music
305 @section Voices contain music
306
307 TODO: something cheesy and vaguely witty about voices being the
308 fundamental thing that includes music in lilypond.
309
310 @menu
311 * I'm seeing Voices::           
312 * Explicitly instantiating voices::  
313 * Voices and vocals::           
314 @end menu
315
316 @c too cheesy?  I'm not certain.  -gp
317 @node I'm seeing Voices
318 @subsection I'm seeing Voices
319
320 @cindex polyphony
321
322 TODO: add intro about voices vs. layers vs. whatever.
323
324 TODO: sex this up with colors and stuff.  -gp 
325
326 TODO: actually, a general rewrite is needed.  -gp
327
328
329 The easiest way to enter fragments with more than one voice on a
330 staff is to enter each voice as a sequence (with @code{@{...@}}),
331 and combine them simultaneously, separating the voices with
332 @code{\\}
333
334 @funindex \\
335
336 @lilypond[quote,verbatim,fragment]
337 \new Staff \relative c' {
338   c16 d e f
339   <<
340     { g4 f e | d2 e2 } \\
341     { r8 e4 d c8 ~ | c b16 a b8 g ~ g2 } \\
342     { s2. | s4 b4 c2 }
343   >>
344 }
345 @end lilypond
346
347 @cindex layers
348
349 The separator causes @internalsref{Voice}
350 contexts@footnote{Polyphonic voices are sometimes
351 called @q{layers} in other notation packages} to be instantiated.
352 They bear the names @code{"1"}, @code{"2"}, etc.  In each of these
353 contexts, vertical direction of slurs, stems, etc., is set
354 appropriately.
355
356 These voices are all separate from the voice that contains the
357 notes just outside the @code{<< \\ >>} construct.  This should be
358 noted when making changes at the voice level.  This also means
359 that slurs and ties cannot go into or out of a @code{<< \\ >>}
360 construct.  Conversely, parallel voices from separate @code{<< \\
361 >>} constructs on the same staff are the same voice.  Here is the
362 same example, with different noteheads and colors for each voice.
363 Note that the change to the note-head style in the main voice does
364 not affect the inside of the @code{<< \\ >>} constructs.  Also,
365 the change to the second voice in the first @code{<< \\ >>}
366 construct is effective in the second @code{<< \\ >>}, and the
367 voice is tied across the two constructs.
368
369 @cindex note heads, styles
370
371 @lilypond[quote,verbatim,fragment]
372 \new Staff \relative c' {
373   \override NoteHead #'style = #'cross
374   \override NoteHead #'color = #red
375   c16 d e f
376   <<
377     { g4 f e } \\
378     { \override NoteHead #'style = #'triangle
379       \override NoteHead #'color = #blue
380     r8 e4 d c8 ~ }
381   >> |
382   <<
383     { d2 e2 } \\
384     { c8 b16 a b8 g ~ g2 } \\
385     { \override NoteHead #'style = #'slash 
386       \override NoteHead #'color = #green
387       s4 b4 c2 }
388   >>
389 }
390 @end lilypond
391
392 Polyphony does not change the relationship of notes within a
393 @code{\relative @{ @}} block.  Each note is calculated relative to
394 the note immediately preceding it.
395
396 @example
397 \relative @{ noteA << noteB \\ noteC >> noteD @}
398 @end example
399
400 @code{noteC} is relative to @code{noteB}, not @code{noteA};
401 @code{noteD} is relative to @code{noteC}, not @code{noteB} or
402 @code{noteA}.
403
404
405 @node Explicitly instantiating voices
406 @subsection Explicitly instantiating voices
407
408 TODO: more colors and stuff.
409
410 @internalsref{Voice} contexts can also be instantiated manually
411 inside a @code{<< >>} block to create polyphonic music, using
412 @code{\voiceOne}, up to @code{\voiceFour} to assign stem
413 directions and a horizontal shift for each part.
414
415 Specifically,
416 @example
417 << \upper \\ \lower >>
418 @end example
419
420 @noindent
421 is equivalent to
422
423 @example
424 <<
425   \new Voice = "1" @{ \voiceOne \upper @}
426   \new Voice = "2" @{ \voiceTwo \lower @}
427 >>
428 @end example
429
430 The @code{\voiceXXX} commands set the direction of stems, slurs,
431 ties, articulations, text annotations, augmentation dots of dotted
432 notes, and fingerings.  @code{\voiceOne} and @code{\voiceThree}
433 make these objects point upwards, while @code{\voiceTwo} and
434 @code{\voiceFour} make them point downwards.  The command
435 @code{\oneVoice} will revert back to the normal setting.
436
437 An expression that appears directly inside a @code{<< >>} belongs
438 to the main voice.  This is useful when extra voices appear while
439 the main voice is playing.  Here is a more correct rendition of
440 the example from the previous section.  The crossed colored
441 noteheads demonstrate that the main melody is now in a single
442 voice context.
443
444 @lilypond[quote,ragged-right,verbatim]
445 \new Staff \relative c' {
446   \override NoteHead #'style = #'cross
447   \override NoteHead #'color = #red
448   c16 d e f
449   \voiceOne
450   <<
451     { g4 f e | d2 e2 }
452     \new Voice="1" { \voiceTwo
453       r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
454       \oneVoice
455     }
456     \new Voice { \voiceThree
457       s2. | s4 b4 c2
458       \oneVoice
459     }
460   >>
461   \oneVoice
462 }
463 @end lilypond
464
465 The correct definition of the voices allows the melody to be
466 slurred.
467
468 @lilypond[quote,ragged-right,verbatim]
469 \new Staff \relative c' {
470   c16^( d e f
471   \voiceOne
472   <<
473     { g4 f e | d2 e2) }
474     \context Voice="1" { \voiceTwo
475       r8 e4 d c8 ~ | c8 b16 a b8 g ~ g2
476       \oneVoice
477     }
478     \new Voice { \voiceThree
479       s2. s4 b4 c2
480       \oneVoice
481     }
482   >>
483   \oneVoice
484 }
485 @end lilypond
486
487 Avoiding the @code{\\} separator also allows nesting polyphony
488 constructs, which in some case might be a more natural way to
489 typeset the music.
490
491 @lilypond[quote,ragged-right,verbatim]
492 \new Staff \relative c' {
493   c16^( d e f
494   \voiceOne
495   <<
496     { g4 f e | d2 e2) }
497     \context Voice="1" { \voiceTwo
498       r8 e4 d c8 ~ |
499       <<
500         {c8 b16 a b8 g ~ g2}
501         \new Voice { \voiceThree
502           s4 b4 c2
503           \oneVoice
504         }
505       >>
506     \oneVoice
507     }
508   >>
509   \oneVoice
510 }
511 @end lilypond
512
513
514 @node Voices and vocals
515 @subsection Voices and vocals
516
517 Vocal music presents a special difficulty: we need to combine two
518 expressions -- notes and lyrics.
519
520 You have already seen the @code{\lyricsAdd@{@}} command, which
521 handles simple cases for you.  However, @code{\lyricsAdd@{@}} is
522 very limited.  For most music, you must explicitly link the lyrics
523 to the notes with @code{\lyricsTo@{@}}
524
525 @lilypond[quote,verbatim,fragment]
526 <<
527   \new Voice = "one" \relative c'' {
528     \autoBeamOff
529     \time 2/4
530     c4 b8. a16 g4. f8 e4 d c2
531   }
532   \new Lyrics \lyricsto "one" {
533     No more let sins and sor -- rows grow.
534   }
535 >>
536 @end lilypond
537
538 TODO: get some vocal person to write more.
539
540
541 @node TODO new sec fundamental
542 @section TODO new sec fundamental
543
544 blh blah
545
546
547 @menu
548 * On the un-nestedness of brackets and ties::  
549 * Up and down::                 
550 * Distances and measurements MAYBE MOVE::  
551 @end menu
552
553 @c my name start sucking the more docs I write. -gp
554 @node On the un-nestedness of brackets and ties
555 @subsection On the un-nestedness of brackets and ties
556
557 Different kinds of brackets and ties may be mixed freely,
558
559 TODO: improve this example
560
561 @lilypond[quote,verbatim,fragment,ragged-right]
562 {
563   r16[ g16 \times 2/3 {r16 e'8] }
564   g16( a \times 2/3 {b d e') }
565   g8[( a \times 2/3 {b d') e'~]}
566   \times 4/5 {e'32\( a b d' e'} a'4.\)
567 }
568 @end lilypond
569
570 TODO... add more info?  Fluff up the first sentence?
571
572
573 @node Up and down
574 @subsection Up and down
575
576 TODO: everything
577
578 By default, lilypnod does a pretty jazz'n job of picking
579 directions.  But in some cases, it may be desirable to force a
580 direction.
581
582 @verbatim
583 -
584 ^ _
585 @end verbatim
586
587
588 @node Distances and measurements MAYBE MOVE
589 @subsection Distances and measurements MAYBE MOVE
590
591 DISCUSS after working on other sections.
592
593 TODO: staff spaces, #UP #DOWN #LEFT #RIGHT.  Maybe move into tweaks?
594
595
596
597 @node Extending the templates
598 @section Extending the templates
599
600 You've read the tutorial, you know how to write music.  But how can you
601 get the staves that you want?  The templates are ok, but what if you
602 want something that isn't covered?
603
604 @menu
605 * Soprano and cello::           
606 * TODO another example of extending templates::  
607 @end menu
608
609 @node Soprano and cello
610 @subsection Soprano and cello
611
612 Start off with the template that seems closest to what you want to end
613 up with.  Let's say that you want to write something for soprano and
614 cello.  In this case, we would start with @q{Notes and lyrics} (for the
615 soprano part).
616
617 @example
618 \version "2.11.23"
619 melody = \relative c' @{
620   \clef treble
621   \key c \major
622   \time 4/4
623
624   a4 b c d
625 @}
626
627 text = \lyricmode @{
628   Aaa Bee Cee Dee
629 @}
630
631 \score@{
632   <<
633     \new Voice = "one" @{
634       \autoBeamOff
635       \melody
636     @}
637     \new Lyrics \lyricsto "one" \text
638   >>
639   \layout @{ @}
640   \midi @{ @}
641 @}
642 @end example
643
644 Now we want to add a cello part.  Let's look at the @q{Notes only} example:
645
646 @example
647 \version "2.11.23"
648 melody = \relative c' @{
649   \clef treble
650   \key c \major
651   \time 4/4
652
653   a4 b c d
654 @}
655
656 \score @{
657 \new Staff \melody
658 \layout @{ @}
659 \midi @{ @}
660 @}
661 @end example
662
663 We don't need two @code{\version} commands.  We'll need the @code{melody}
664 section.  We don't want two @code{\score} sections -- if we had two
665 @code{\score}s, we'd get the two parts separately.  We want them together,
666 as a duet.  Within the @code{\score} section, we don't need two
667 @code{\layout} or @code{\midi}.
668
669 If we simply cut and paste the @code{melody} section, we would end up with
670 two @code{melody} sections.  So let's rename them.  We'll call the section
671 for the soprano @code{sopranoMusic} and the section for the cello
672 @code{celloMusic}.  While we're doing this, let's rename @code{text}
673 to be @code{sopranoLyrics}.  Remember to rename both instances of all
674 these names -- both the initial definition (the
675 @code{melody = relative c' @{ } part) and the name's use (in the
676 @code{\score} section).
677
678 While we're doing this, let's change the cello part's staff -- celli
679 normally use bass clef.  We'll also give the cello some different
680 notes.
681
682 @example
683 \version "2.11.23"
684 sopranoMusic = \relative c' @{
685   \clef treble
686   \key c \major
687   \time 4/4
688
689   a4 b c d
690 @}
691
692 sopranoLyrics = \lyricmode @{
693   Aaa Bee Cee Dee
694 @}
695
696 celloMusic = \relative c @{
697   \clef bass
698   \key c \major
699   \time 4/4
700
701   d4 g fis8 e d4
702 @}
703
704 \score@{
705   <<
706     \new Voice = "one" @{
707       \autoBeamOff
708       \sopranoMusic
709     @}
710     \new Lyrics \lyricsto "one" \sopranoLyrics
711   >>
712   \layout @{ @}
713   \midi @{ @}
714 @}
715 @end example
716
717 This is looking promising, but the cello part won't appear in the
718 score -- we haven't used it in the @code{\score} section.  If we
719 want the cello part to appear under the soprano part, we need to add
720
721 @example
722 \new Staff \celloMusic
723 @end example
724
725 @noindent
726 underneath the soprano stuff.  We also need to add @code{<<} and
727 @code{>>} around the music -- that tells LilyPond that there's
728 more than one thing (in this case, @code{Staff}) happening at once.  The
729 @code{\score} looks like this now
730
731 @example
732 \score@{
733   <<
734     <<
735       \new Voice = "one" @{
736         \autoBeamOff
737         \sopranoMusic
738       @}
739       \new Lyrics \lyricsto "one" \sopranoLyrics
740     >>
741     \new Staff \celloMusic
742   >>
743   \layout @{ @}
744   \midi @{ @}
745 @}
746 @end example
747
748 @noindent
749 This looks a bit messy; the indentation is messed up now.  That is
750 easily fixed.  Here's the complete soprano and cello template.
751
752 @lilypond[quote,verbatim,ragged-right]
753 \version "2.11.23"
754 sopranoMusic = \relative c' {
755   \clef treble
756   \key c \major
757   \time 4/4
758
759   a4 b c d
760 }
761
762 sopranoLyrics = \lyricmode {
763   Aaa Bee Cee Dee
764 }
765
766 celloMusic = \relative c {
767   \clef bass
768   \key c \major
769   \time 4/4
770
771   d4 g fis8 e d4
772 }
773
774 \score{
775   <<
776     <<
777       \new Voice = "one" {
778         \autoBeamOff
779         \sopranoMusic
780       }
781       \new Lyrics \lyricsto "one" \sopranoLyrics
782     >>
783     \new Staff \celloMusic
784   >>
785   \layout { }
786   \midi { }
787 }
788 @end lilypond
789
790
791 @node TODO another example of extending templates
792 @subsection TODO another example of extending templates
793
794 TODO: somebody else fill this in.  You guys like vocal stuff,
795 right?  Get to it.  :)  -gp
796
797
798
799 @node Scores and parts
800 @section Scores and parts
801
802 TODO: this is really old stuff from the really old tutorial.
803 Rewrite, fix, etc.  Or maybe delete entirely.  -gp
804
805 In orchestral music, all notes are printed twice.  Once in a part for
806 the musicians, and once in a full score for the conductor.  Variables can
807 be used to avoid double work.  The music is entered once, and stored in
808 a variable.  The contents of that variable is then used to generate
809 both the part and the full score.
810
811 It is convenient to define the notes in a special file.  For example,
812 suppose that the file @file{horn-music.ly} contains the following part
813 of a horn/@/bassoon duo
814
815 @example
816 hornNotes = \relative c @{
817   \time 2/4
818   r4 f8 a cis4 f e d
819 @}
820 @end example
821
822 @noindent
823 Then, an individual part is made by putting the following in a file
824
825 @example
826 \include "horn-music.ly"
827 \header @{
828   instrument = "Horn in F"
829 @}
830
831 @{
832  \transpose f c' \hornNotes
833 @}
834 @end example
835
836 The line
837
838 @example
839 \include "horn-music.ly"
840 @end example
841
842 @noindent
843 substitutes the contents of @file{horn-music.ly} at this position in
844 the file, so @code{hornNotes} is defined afterwards.  The command
845 @code{\transpose f@tie{}c'} indicates that the argument, being
846 @code{\hornNotes}, should be transposed by a fifth upwards.  Sounding
847 @samp{f} is denoted by notated @code{c'}, which corresponds with the
848 tuning of a normal French Horn in@tie{}F.  The transposition can be seen
849 in the following output
850
851 @lilypond[quote,ragged-right]
852 \transpose f c' \relative c {
853   \time 2/4
854   r4 f8 a cis4 f e d
855 }
856 @end lilypond
857
858 In ensemble pieces, one of the voices often does not play for many
859 measures.  This is denoted by a special rest, the multi-measure
860 rest.  It is entered with a capital @samp{R} followed by a duration
861 (@code{1}@tie{}for a whole note, @code{2}@tie{}for a half note,
862 etc.).  By multiplying the
863 duration, longer rests can be constructed.  For example, this rest
864 takes 3@tie{}measures in 2/4 time
865
866 @example
867 R2*3
868 @end example
869
870 When printing the part, multi-rests
871 must be condensed.  This is done by setting a run-time variable
872
873 @example
874 \set Score.skipBars = ##t
875 @end example
876
877 @noindent
878 This command sets the property @code{skipBars} in the
879 @code{Score} context to true (@code{##t}).  Prepending the rest and
880 this option to the music above, leads to the following result
881
882 @lilypond[quote,ragged-right]
883 \transpose f c' \relative c {
884   \time 2/4
885   \set Score.skipBars = ##t
886   R2*3
887   r4 f8 a cis4 f e d
888 }
889 @end lilypond
890
891
892 The score is made by combining all of the music together.  Assuming
893 that the other voice is in @code{bassoonNotes} in the file
894 @file{bassoon-music.ly}, a score is made with
895
896 @example
897 \include "bassoon-music.ly"
898 \include "horn-music.ly"
899
900 <<
901   \new Staff \hornNotes
902   \new Staff \bassoonNotes
903 >>
904 @end example
905
906 @noindent
907 leading to
908
909 @lilypond[quote,ragged-right]
910 \relative c <<
911   \new Staff {
912     \time 2/4 R2*3
913     r4 f8 a cis4 f e d
914   }
915   \new Staff {
916     \clef bass
917     r4 d,8 f | gis4 c | b bes |
918     a8 e f4 | g d | gis f
919   }
920 >>
921 @end lilypond
922
923
924