-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathklare.ly
149 lines (131 loc) · 3.39 KB
/
klare.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
\version "2.20.0"
blackNote =
#(ly:make-stencil
(list 'embedded-ps
"gsave
currentpoint translate
newpath
-.50 -0 .51 0 360 arc closepath
fill
grestore" )
(cons -1.02 1.02)
(cons -.51 .51)
)
whiteNote =
#(ly:make-stencil
(list 'embedded-ps
"gsave
currentpoint translate
newpath
0.05 setlinewidth
.50 -0 .485 0 360 arc closepath
gsave
1 setgray fill
grestore
stroke
grestore" )
(cons -1.02 1.02)
(cons -.51 .51)
)
blackLongNote =
#(ly:make-stencil
(list 'embedded-ps
"gsave
currentpoint translate
newpath
-.50 -0 .51 0 360 arc closepath
fill
newpath
0.12 setlinewidth
-.6 -0 .80 140 -140 arc
.2 setgray stroke
grestore" )
(cons -1.22 1.22)
(cons -.51 .51)
)
whiteLongNote =
#(ly:make-stencil
(list 'embedded-ps
"gsave
currentpoint translate
newpath
0.05 setlinewidth
.50 -0 .485 0 360 arc closepath
gsave
1 setgray fill
grestore
stroke
0.12 setlinewidth
.6 0 .80 -40 40 arc
.3 setgray stroke
grestore" )
(cons -1.22 1.22)
(cons -.51 .51)
)
%Based on the pitch, and duration, which note head
#(define (pitch-to-stencil pitch dur)
(if (= (remainder (ly:pitch-semitones pitch) 2) 0)
(if (< dur 2)
blackLongNote
blackNote)
(if (< dur 2)
whiteLongNote
whiteNote)
)
)
#(define (ps-stencil-notehead grob)
(pitch-to-stencil
(ly:event-property (event-cause grob) 'pitch)
(ly:grob-property grob 'duration-log)
)
)
clefKlareTreble = {
%\clef treble
\set Staff.clefGlyph = #"clefs.G"
\set Staff.middleCPosition = #-6
\set Staff.clefPosition = #1
}
clefKlareBass = {
%\clef "bass_13"
\set Staff.clefGlyph = #"clefs.F"
\set Staff.middleCPosition = #18
\set Staff.clefPosition = #11
}
\layout {
\context {
\Staff
\name KlareStaff
\alias Staff
staffLineLayoutFunction = #ly:pitch-semitones
\override StaffSymbol.line-positions = #'( -6 -2 6 10 )
\override StaffSymbol.ledger-positions = #'( -18 -14 -10 2 14 22 )
\override StaffSymbol.ledger-extra = #1
\override StaffSymbol.ledger-line-thickness = #'(.6 . 0)
%\override Stem #'no-stem-extend = ##t
\override Stem.thickness = #.5
\override NoteHead #'stencil = #ps-stencil-notehead
\override NoteHead #'stem-attachment = #'(0 . 0)
\override NoteHead #'X-offset = #0
\override SpacingSpanner.uniform-stretching = ##t
\override Score.SpacingSpanner.strict-note-spacing = ##t
\remove "Accidental_engraver"
\remove "Key_engraver"
%\remove "Clef_engraver"
\clefKlareTreble
%\remove "Time_signature_engraver"
\override TimeSignature #'Y-offset = #3
%\override NoteColumn.ignore-collision = ##t
}
\inherit-acceptability "KlareStaff" "Staff"
}
%% helpers for making a continuous note-space out of a PianoStaff
% http://lilypond.org/doc/v2.20/Documentation/notation/explicit-staff-and-system-positioning
stackStaves = {
\overrideProperty Score.NonMusicalPaperColumn.line-break-system-details
#'((alignment-distances . (12)))
}
% adds a C line on top of the standard staff
ExtendStaff = \with {
\override StaffSymbol #'line-positions = #'( -6 -2 6 10 18 )
\override StaffSymbol #'ledger-positions = #'( -18 -14 -10 2 14 22 26 )
}