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