-
Notifications
You must be signed in to change notification settings - Fork 3
/
template_piano_solo.ly
122 lines (106 loc) · 3.14 KB
/
template_piano_solo.ly
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
%\version "2.12.2"
%\header {
% title = "Foo"
% subtitle = "Bar"
% composer = "Baz"
% tagline = ""
%}
%global = {
% \tempo 4 = 60
% \key c \major
% \time 4/4
% \numericTimeSignature
%}
%upper = \relative c' {
% \clef treble
%}
%lower = \relative c {
% \clef bass
%}
%dynamics = {
%}
%pedal = {
%}
%chordnames = \chordmode {
%}
\score {
\new PianoStaff = "PianoStaff_pf" <<
\set PianoStaff.instrumentName = #"Piano"
\new ChordNames = "chordnames" \chordnames
\new Staff = "Staff_pfUpper" << \global \upper >>
\new Dynamics = "Dynamics_pf" \dynamics
\new Staff = "Staff_pfLower" << \global \lower >>
\new Dynamics = "pedal" \pedal
>>
\layout {
% define Dynamics context
\context {
\type "Engraver_group"
\name Dynamics
\alias Voice
\consists "Output_property_engraver"
\consists "Piano_pedal_engraver"
\consists "Script_engraver"
\consists "New_dynamic_engraver"
\consists "Dynamic_align_engraver"
\consists "Text_engraver"
\consists "Skip_event_swallow_translator"
\consists "Axis_group_engraver"
% keep spanners and text in the middle
\override DynamicLineSpanner #'Y-offset = #0
\override TextScript #'Y-offset = #-0.5
\override TextScript #'font-shape = #'italic
\override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
\override DynamicText #'extra-spacing-width = #'(0 . 0)
% XXX: this seems to have no effect, so hairpins are still not
% padded enough in some cases
\override Hairpin #'bound-padding = #2.0
% hack to fix incorrect placement of the instrument name when
% pedaling instructions are present
% http://lists.gnu.org/archive/html/lilypond-user/2010-07/msg00402.html
\override VerticalAxisGroup #'meta =
#(let* ((descr (assoc-get 'VerticalAxisGroup all-grob-descriptions))
(meta (assoc-get 'meta descr))
(ifaces (assoc-get 'interfaces meta)))
;; Adding piano-pedal-interface to this VerticalAxisGroup
;; prevents it being acknowledged by Instrument_name_engraver
(acons 'interfaces (cons 'piano-pedal-interface ifaces)
meta))
}
\context {
\PianoStaff
% modify PianoStaff context to accept ChordNames and Dynamics context
\accepts ChordNames
\accepts Dynamics
% decrease the fingering font size a bit
\override Fingering #'font-size = #-6
}
\context {
\ChordNames
\override ChordName #'font-size = #0
}
\context {
\Voice
% keep chord fingering instructions on the left side
fingeringOrientations = #'(left)
}
}
}
\score {
\unfoldRepeats {
\new PianoStaff = "PianoStaff_pf" <<
\new Staff = "Staff_pfUpper" << \global \upper \dynamics \pedal >>
\new Staff = "Staff_pfLower" << \global \lower \dynamics \pedal >>
>>
}
\midi {
% the following is a workaround to prevent multiple voices from being
% lumped into the same channel, which would inhibit overlapping notes
\context {
\Staff \remove "Staff_performer"
}
\context {
\Voice \consists "Staff_performer"
}
}
}