]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/combining-two-parts-on-the-same-staff.ly
Snippets: Replace \set Staff.instrumentName
[lilypond.git] / Documentation / snippets / new / combining-two-parts-on-the-same-staff.ly
1 \version "2.19.56"
2
3 \header {
4   lsrtags = "simultaneous-notes, syntax-and-expressions, text"
5
6   texidoc = "
7 The part combiner tool ( @code{\\partcombine} command ) allows the
8 combination of several different parts on the same staff.  Text
9 directions such as @qq{solo} or @qq{a2} are added by default; to remove
10 them, simply set the property @code{printPartCombineTexts} to @code{f}.
11 For vocal scores (hymns), there is no need to add @qq{solo/a2} texts,
12 so they should be switched off.  However, it might be better not to use
13 it if there are any solos, as they won't be indicated.  In such cases,
14 standard polyphonic notation may be preferable.
15
16 This snippet presents the three ways two parts can be printed on a same
17 staff: standard polyphony, @code{\\partcombine} without texts, and
18 @code{\\partcombine} with texts.
19
20
21
22
23 "
24   doctitle = "Combining two parts on the same staff"
25 } % begin verbatim
26
27 %% Combining pedal notes with clef changes
28
29 musicUp = \relative c'' {
30   \time 4/4
31   a4 c4.( g8) a4 |
32   g4 e' g,( a8 b) |
33   c b a2.
34 }
35
36 musicDown = \relative c'' {
37   g4 e4.( d8) c4 |
38   r2 g'4( f8 e) |
39   d2 \stemDown a
40 }
41
42 \score {
43     <<
44     \new Staff \with { instrumentName = #"Standard polyphony" }
45
46       << \musicUp \\ \musicDown >>
47
48     \new Staff \with {
49       instrumentName = #"PartCombine without text"
50       printPartCombineTexts = ##f
51     }
52
53     \partcombine \musicUp \musicDown
54
55     \new Staff \with { instrumentName = #"PartCombine with text" }
56       \partcombine \musicUp \musicDown
57     >>
58   \layout {
59     indent = 6.0\cm
60     \context {
61       \Score
62       \override SystemStartBar.collapse-height = #30
63     }
64   }
65 }