4 @c A menu is needed before every deeper *section nesting of @nodes
5 @c Run M-x texinfo-all-menus-update
6 @c to automagically fill in these menus
7 @c before saving changes
13 * different staff sizes
16 * move some stuff to refman
17 * merge some stuff with refman entries
19 * add @ref{}s to lilypond-internals:
21 @reng{Name} to engraver
23 there's a very simple, very general noXXX mechanism; try
25 noop \property Staff.VoltaBrace = #'()
26 yes: \property Staff.VoltaBracket = #'((meta . ((interfaces . ()))))
38 * Manual beam settings:: Manual beam settings
39 * Engraver hacking:: Engraver hacking
40 * Part combiner:: Part combiner
41 * Markup text:: Markup text
42 * Apply hacking:: Apply hacking
43 * Embedded TeX:: Embedded TeX
44 * Embedded PostScript:: Embedded PostScript
48 @node Manual beam settings
49 @section Manual beam settings
58 @cindex @code{no-stem-extend}
60 Conventionally, stems and beams extend to the middle staff line. This
61 extension can be controlled through @code{Voice.Stem}'s grob-property
62 @code{no-stem-extend}:
65 @lilypond[fragment,relative,verbatim]
67 \property Voice.Stem \set #'no-stem-extend = ##t
72 The beam symbol can be tweaked through @code{Voice.Beam}'s
73 grob-properties @code{height} and @code{staff-position},
76 Set @code{height} to zero, to get horizontal beams:
79 @lilypond[fragment,relative,verbatim]
80 \property Voice.Beam \set #'direction = #1
81 \property Voice.Beam \set #'height = #0
86 Here's how you'd specify a weird looking beam that instead of being
87 horizontal, falls two staff spaces:
90 @lilypond[fragment,relative,verbatim]
91 \property Voice.Beam \set #'staff-position = #2
92 \property Voice.Beam \set #'height = #-2
96 @cindex @code{default-neutral-direction}
98 The direction of a perfectly centred beams can be
99 controlled through @code{Voice.Beam}'s grob-property
100 @code{default-neutral-direction}
103 @lilypond[fragment,relative,verbatim]
105 \property Voice.Beam \set #'default-neutral-direction = #-1
110 There are several ways to calculate the direction of a beam.
113 number count of up or down notes
115 mean center distance of all notes
117 mean centre distance weighted per note
120 You can spot the differences of these settings from these simple
124 @lilypond[fragment,relative,verbatim]
126 \property Voice.Beam \set #'dir-function = #beam-dir-mean
128 \property Voice.Beam \set #'dir-function = #beam-dir-median
134 @lilypond[fragment,relative,verbatim]
137 \property Voice.Beam \set #'dir-function = #beam-dir-mean
139 \property Voice.Beam \set #'dir-function = #beam-dir-median
144 These beam direction functions are defined in @file{scm/beam.scm}. If
145 your favourite algorithm isn't one of these, you can hook up your own.
149 @node Engraver hacking
150 @section Engraver hacking
152 No time signature, no barlines...
155 \notes \relative c'' {
164 \remove "Time_signature_engraver";
170 No staff, no clef, squash pitches
173 \notes { c4 c4 c8 c8 }
178 \remove Staff_symbol_engraver;
179 \consists Pitch_squash_engraver;
180 \remove Clef_engraver;
188 @section Part combiner
192 \context Staff = flauti <
194 \context Voice=one \partcombine Voice
195 \context Thread=one \notes\relative c'' {
196 c4 d e f | b,4 d c d | r2 e4 f | c4 d e f |
197 c4 r e f | c4 r e f | c4 r a r | a a r a |
198 a2 \property Voice.soloADue = ##f a |
200 \context Thread=two \notes\relative c'' {
201 g4 b d f | r2 c4 d | a c c d | a4. b8 c4 d
202 c r e r | r2 s2 | a,4 r a r | a r r a |
203 a2 \property Voice.soloADue = ##f a |
207 linewidth = 80 * \staffspace;
210 \consists Rest_engraver;
214 \remove Rest_engraver;
230 #(define text-flat '((font-relative-size . -2 ) (music "accidentals--1")))
232 \property VoiceCombineStaff.instrument = #`((kern . 0.5) (lines
233 "2 Clarinetti" (rows " (B" ,text-flat ")")))
236 \property StaffCombineStaff.instrument = #'((kern . 0.5)
237 (lines "Violoncello" (rows " e") (rows "Contrabasso")))
246 [todo: hack this into C++, use \tempo]
249 #(define note '(rows (music "noteheads-2" ((kern . -0.1) "flags-stem"))))
250 #(define eight-note `(rows ,note ((kern . -0.1) (music ((raise . 3.5) "flags-u3")))))
251 #(define dotted-eight-note `(rows ,eight-note (music "dots-dot")))
254 \notes\relative c'' {
255 a1^#`((rows (font-relative-size . -1)) ,dotted-eight-note " = 64")
261 TextScript \override #'font-shape = #'upright
272 @section Apply hacking
274 [Add Parenthesed note head example?]
276 [Add Smart transpose example?]
280 music = \notes { c'4 d'4( e'4 f'4 }
282 #(define (reverse-music music)
283 (let* ((elements (ly-get-mus-property music 'elements))
284 (reversed (reverse elements))
285 (span-dir (ly-get-mus-property music 'span-direction)))
287 (ly-set-mus-property music 'elements reversed)
290 (ly-set-mus-property music 'span-direction (- span-dir)))
292 (map reverse-music reversed)
299 \apply #reverse-music \music
301 \paper { linewidth = -1.; }
306 @section Embedded TeX
307 @lilypond[fragment,relative,verbatim]
308 a''^"3 $\\times$ \\`a deux"
311 @node Embedded PostScript
312 @section Embedded PostScript
314 Arbitrary lines and curves not supported...
316 [TODO:] Make a direct postscript command?
320 \notes \relative c'' {
321 a-#"\\embeddedps{3 4 moveto 5 3 rlineto stroke}"
322 -#"\\embeddedps{ [ 0 1 ] 0 setdash 3 5 moveto 5 -3 rlineto stroke}"
323 b-#"\\embeddedps{3 4 moveto 0 0 1 2 8 4 20 3.5 rcurveto stroke}"
327 \paper { linewidth = 70 * \staffspace; }