]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/two--partcombine-pairs-on-one-staff.ly
Add '-dcrop' option to ps and svg backends
[lilypond.git] / Documentation / snippets / two--partcombine-pairs-on-one-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.19.22"
8
9 \header {
10   lsrtags = "simultaneous-notes, staff-notation"
11
12   texidoc = "
13 The @code{\\partcombine} function takes two music expressions each
14 containing a part, and distributes them among four @code{Voice}s named
15 @qq{two} @qq{one} @qq{solo} and @qq{chords} depending on when and how
16 the parts merged into a common voice.   The voices output from
17 @code{\\partcombine} can have their layout properties adjusted in the
18 usual way.  Here we define extensions of @code{\\partcombine} to make
19 it easier to put four voices on a staff.
20
21 soprano = @{ d'4 | cis'  b  e'  d'8 cis' | cis'2 b @} alto = @{ fis4 |
22 e8 fis gis ais b4 b | b ais fis2 @} tenor = @{ a8 b | cis' dis' e'4 b8
23 cis' d'4 | gis cis' dis'2 @} bass = @{ fis8 gis | a4 gis g fis | eis
24 fis b,2 @}
25
26 \\new Staff <<
27   \\key b\\minor
28   \\clef alto
29   \\partial 4
30   \\transpose b b'
31   \\partcombineUp \\soprano \\alto
32   \\partcombineDown \\tenor \\bass >>
33
34 "
35   doctitle = "Two \\partcombine pairs on one staff"
36 } % begin verbatim
37
38 \layout {
39   \context {
40     \Staff
41     \accepts "VoiceBox"
42   }
43   \context {
44     \name "VoiceBox"
45     \type "Engraver_group"
46     \defaultchild "Voice"
47     \accepts "Voice"
48   }
49 }
50
51 partcombineUp =
52 #(define-music-function (partOne partTwo)
53   (ly:music? ly:music?)
54 "Take the music in @var{partOne} and @var{partTwo} and return
55 a @code{VoiceBox} named @q{Up} containing @code{Voice}s
56 that contain @var{partOne} and @var{partTwo} merged into one
57 voice where feasible.  This variant sets the default voicing
58 in the output to use upward stems."
59 #{
60   \new VoiceBox = "Up" <<
61     \context Voice = "one" { \voiceOne }
62     \context Voice = "two" { \voiceThree }
63     \context Voice = "shared" { \voiceOne }
64     \context Voice = "solo" { \voiceOne }
65     \partcombine #partOne #partTwo
66   >>
67 #})
68
69 partcombineDown = #
70 (define-music-function (partOne partTwo)
71   (ly:music? ly:music?)
72 "Take the music in @var{partOne} and @var{partTwo} and return
73 a @code{VoiceBox} named @q{Down} containing @code{Voice}s
74 that contain @var{partOne} and @var{partTwo} merged into one
75 voice where feasible.  This variant sets the default voicing
76 in the output to use downward stems."
77 #{
78   \new VoiceBox = "Down" <<
79     \set VoiceBox.soloText = #"Solo III"
80     \set VoiceBox.soloIIText = #"Solo IV"
81     \context Voice ="one" { \voiceFour }
82     \context Voice ="two" { \voiceTwo }
83     \context Voice ="shared" { \voiceFour }
84     \context Voice ="solo" { \voiceFour }
85     \partcombine #partOne #partTwo
86   >>
87 #})
88
89 soprano = { d'4 | cis'  b  e'  d'8 cis' | cis'2 b }
90 alto = { fis4 | e8 fis gis ais b4 b | b ais fis2 }
91 tenor = { a8 b | cis' dis' e'4 b8 cis' d'4 | gis cis' dis'2 }
92 bass = { fis8 gis | a4 gis g fis | eis fis b,2 }
93
94 \new Staff <<
95   \key b\minor
96   \clef alto
97   \partial 4
98   \transpose b b'
99   \partcombineUp \soprano \alto
100   \partcombineDown \tenor \bass
101 >>