]> git.donarmstrong.com Git - lilypond.git/blob - input/test/hara-kiri-switch.ly
release: 1.3.150
[lilypond.git] / input / test / hara-kiri-switch.ly
1
2 \header {
3 texidoc = "some instruments (notably: cello and double bass) are alternatively written on one and two staves. This is the way to do it:"
4 }
5 \version "1.3.146"
6
7
8 voiceOne =  \notes \relative c'' {
9         a1 a a
10         a2 a2
11         a2 a8 a a a
12 }
13
14 staffOne =  \context Staff = one <
15         \notes \context Voice=one < 
16                 \voiceOne
17         >
18 >
19
20 voiceTwo =  \notes \relative c' {
21         % we must have a Thread context before we can switch staffs
22         % in this case, the notes before the switching  will do that 
23         % implicitely
24         \context Thread
25
26         R1*3
27         c2 c2
28         \translator Staff=one
29         \translator Voice=one
30         c2
31         c8 c c c
32 }
33
34 staffTwo =  \context Staff = two <
35         % notes must go to Staff context: we want to switch Staff translators
36         %\notes \context Voice=one < 
37                 \voiceTwo
38         %>
39 >
40
41 grandstaff =  \context GrandStaff = one <
42         \staffOne
43         \staffTwo
44 >
45
46 \score{
47         \grandstaff
48         \paper{
49                 linewidth=80.0\mm
50
51                 \translator { \VoiceContext noAutoBeaming = ##t }
52                 \translator { \HaraKiriStaffContext }
53                 \translator { \OrchestralScoreContext skipBars = ##t }
54         }
55 }
56
57