]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/string-quartet-template-with-separate-parts.ly
Snippets: Replace \set Staff.instrumentName
[lilypond.git] / Documentation / snippets / string-quartet-template-with-separate-parts.ly
1 % DO NOT EDIT this file manually; it is automatically
2 % generated from Documentation/snippets/new
3 % Make any changes in Documentation/snippets/new/
4 % and then run scripts/auxiliar/makelsr.py
5 %
6 % This file is in the public domain.
7 %% Note: this file works from version 2.19.56
8 \version "2.19.56"
9
10 \header {
11   lsrtags = "preparing-parts, template, unfretted-strings"
12
13   texidoc = "
14 The @qq{String quartet template} snippet produces a nice string
15 quartet, but what if you needed to print parts? This new template
16 demonstrates how to use the @code{\\tag} feature to easily split a
17 piece into individual parts.
18
19 You need to split this template into separate files; the filenames are
20 contained in comments at the beginning of each file. @code{piece.ly}
21 contains all the music definitions. The other files – @code{score.ly},
22 @code{vn1.ly}, @code{vn2.ly}, @code{vla.ly}, and @code{vlc.ly} –
23 produce the appropriate part.
24
25
26 Do not forget to remove specified comments when using separate files!
27
28 "
29   doctitle = "String quartet template with separate parts"
30 } % begin verbatim
31
32 %%%%% piece.ly
33 %%%%% (This is the global definitions file)
34
35 global= {
36   \time 4/4
37   \key c \major
38 } % begin verbatim
39
40
41
42 Violinone = \new Voice {
43   \relative c'' {
44     c2 d e1
45     \bar "|."
46   }
47 }
48
49
50 Violintwo = \new Voice {
51   \relative c'' {
52     g2 f e1
53     \bar "|."
54   }
55 }
56
57
58 Viola = \new Voice {
59   \relative c' {
60     \clef alto
61     e2 d c1
62     \bar "|."
63   }
64 }
65
66
67 Cello = \new Voice {
68   \relative c' {
69     \clef bass
70     c2 b a1
71     \bar "|."
72   }
73 }
74
75
76 music = {
77   <<
78     \tag #'score \tag #'vn1
79     \new Staff \with { instrumentName = "Violin 1" }
80     << \global \Violinone >>
81
82     \tag #'score \tag #'vn2
83     \new Staff \with { instrumentName = "Violin 2" }
84     << \global \Violintwo>>
85
86     \tag #'score \tag #'vla
87     \new Staff \with { instrumentName = "Viola" }
88     << \global \Viola>>
89
90     \tag #'score \tag #'vlc
91     \new Staff \with { instrumentName = "Cello" }
92     << \global \Cello >>
93   >>
94 }
95
96 % These are the other files you need to save on your computer
97
98 % score.ly
99 % (This is the main file)
100
101 % uncomment the line below when using a separate file
102 %\include "piece.ly"
103
104 #(set-global-staff-size 14)
105
106 \score {
107   \new StaffGroup \keepWithTag #'score \music
108   \layout { }
109   \midi { }
110 }
111
112
113 %{ Uncomment this block when using separate files
114
115 % vn1.ly
116 % (This is the Violin 1 part file)
117
118 \include "piece.ly"
119 \score {
120   \keepWithTag #'vn1 \music
121   \layout { }
122 }
123
124
125 % vn2.ly
126 % (This is the Violin 2 part file)
127
128 \include "piece.ly"
129 \score {
130   \keepWithTag #'vn2 \music
131   \layout { }
132 }
133
134
135 % vla.ly
136 % (This is the Viola part file)
137
138 \include "piece.ly"
139 \score {
140   \keepWithTag #'vla \music
141   \layout { }
142 }
143
144
145 % vlc.ly
146 % (This is the Cello part file)
147
148 \include "piece.ly"
149 \score {
150   \keepWithTag #'vlc \music
151   \layout { }
152 }
153
154 %}